irrlib

irrlib Commit Details


Date:2013-08-24 12:03:00 (11 years 3 months ago)
Author:Natalie Adams
Branch:default
Commit:ca2aafbed07a
Message:Migrating from google code

Changes:
AExamples/Example_1.old/q3level.cpp (full)
AExamples/Example_10_DisableEscExit/main_x.cpp (full)
AExamples/Example_11_3DObjects/main_x.cpp (full)
AExamples/Example_1_Basic/main.cpp (full)
AExamples/Example_1_Basic/main_x.cpp (full)
AExamples/Example_2_SceneColor/main.cpp (full)
AExamples/Example_2_SceneColor/main_x.cpp (full)
AExamples/Example_3_Keyboard/main.cpp (full)
AExamples/Example_3_Keyboard/main_x.cpp (full)
AExamples/Example_4_WindowCaption/UsingStdString.cpp (full)
AExamples/Example_4_WindowCaption/UsingStringw.cpp (full)
AExamples/Example_4_WindowCaption/main.cpp (full)
AExamples/Example_4_WindowCaption/main_x.cpp (full)
AExamples/Example_5_Cursor/main.cpp (full)
AExamples/Example_5_Cursor/main_x.cpp (full)
AExamples/Example_6_GameLoop/main.cpp (full)
AExamples/Example_6_GameLoop/main_x.cpp (full)
AExamples/Example_7_Spheres/main.cpp (full)
AExamples/Example_7_Spheres/main_x.cpp (full)
AExamples/Example_8_Mouse/main.cpp (full)
AExamples/Example_8_Mouse/main_x.cpp (full)
AExamples/Example_9_PictoDraw/main.cpp (full)
AExamples/Example_9_PictoDraw/main_x.cpp (full)
AOld Versions/1.1/IrrLib.cpp (full)
AOld Versions/1.1/IrrLib.h (full)
AOld Versions/1.1/IrrSphere.cpp (full)
AOld Versions/1.1/IrrSphere.h (full)
AOld Versions/1.2/CHANGES (full)
AOld Versions/1.2/Irr2D.cpp (full)
AOld Versions/1.2/Irr2D.h (full)
AOld Versions/1.2/Irr3D.cpp (full)
AOld Versions/1.2/Irr3D.h (full)
AOld Versions/1.2/IrrColor.cpp (full)
AOld Versions/1.2/IrrColor.h (full)
AOld Versions/1.2/IrrLib.cpp (full)
AOld Versions/1.2/IrrLib.h (full)
AOld Versions/1.2/IrrLibBase.cpp (full)
AOld Versions/1.2/IrrLibBase.h (full)
AOld Versions/1.2/IrrLibGUI.cpp (full)
AOld Versions/1.2/IrrLibGUI.h (full)
AOld Versions/1.2/IrrSphere.cpp (full)
AOld Versions/1.2/IrrSphere.h (full)
AOld Versions/1.2/IrrSprite.cpp (full)
AOld Versions/1.2/IrrSprite.h (full)
AOld Versions/1.2/README (full)
AOld Versions/1/IrrLib.cpp (full)
AOld Versions/1/IrrLib.h (full)
AOld Versions/1/irrlibdocs.txt (full)
AStable Version/1.2.2/CHANGES (full)
AStable Version/1.2.2/Irr2D.cpp (full)
AStable Version/1.2.2/Irr2D.h (full)
AStable Version/1.2.2/Irr3D.cpp (full)
AStable Version/1.2.2/Irr3D.h (full)
AStable Version/1.2.2/IrrColor.cpp (full)
AStable Version/1.2.2/IrrColor.h (full)
AStable Version/1.2.2/IrrEventReciever.cpp (full)
AStable Version/1.2.2/IrrEventReciever.h (full)
AStable Version/1.2.2/IrrLib.cpp (full)
AStable Version/1.2.2/IrrLib.h (full)
AStable Version/1.2.2/IrrLibBase.cpp (full)
AStable Version/1.2.2/IrrLibBase.h (full)
AStable Version/1.2.2/IrrLibGUI.cpp (full)
AStable Version/1.2.2/IrrLibGUI.h (full)
AStable Version/1.2.2/IrrSphere.cpp (full)
AStable Version/1.2.2/IrrSphere.h (full)
AStable Version/1.2.2/IrrSprite.cpp (full)
AStable Version/1.2.2/IrrSprite.h (full)
AStable Version/1.2.2/README (full)
AStable Version/1.2.3/CHANGES (full)
AStable Version/1.2.3/CREDITS (full)
AStable Version/1.2.3/Irr2D.cpp (full)
AStable Version/1.2.3/Irr2D.h (full)
AStable Version/1.2.3/Irr3D.cpp (full)
AStable Version/1.2.3/Irr3D.h (full)
AStable Version/1.2.3/IrrColor.cpp (full)
AStable Version/1.2.3/IrrColor.h (full)
AStable Version/1.2.3/IrrEventReciever.cpp (full)
AStable Version/1.2.3/IrrEventReciever.h (full)
AStable Version/1.2.3/IrrLib.cpp (full)
AStable Version/1.2.3/IrrLib.h (full)
AStable Version/1.2.3/IrrLibBase.cpp (full)
AStable Version/1.2.3/IrrLibBase.h (full)
AStable Version/1.2.3/IrrLibData.cpp
AStable Version/1.2.3/IrrLibData.h (full)
AStable Version/1.2.3/IrrLibGUI.cpp (full)
AStable Version/1.2.3/IrrLibGUI.h (full)
AStable Version/1.2.3/IrrSphere.cpp (full)
AStable Version/1.2.3/IrrSphere.h (full)
AStable Version/1.2.3/IrrSprite.cpp (full)
AStable Version/1.2.3/IrrSprite.h (full)
AStable Version/1.2.3/README (full)
AStable Version/1.2.4/CHANGES (full)
AStable Version/1.2.4/CREDITS (full)
AStable Version/1.2.4/Irr2D.cpp (full)
AStable Version/1.2.4/Irr2D.h (full)
AStable Version/1.2.4/Irr3D.cpp (full)
AStable Version/1.2.4/Irr3D.h (full)
AStable Version/1.2.4/IrrColor.cpp (full)
AStable Version/1.2.4/IrrColor.h (full)
AStable Version/1.2.4/IrrEventReciever.cpp (full)
AStable Version/1.2.4/IrrEventReciever.h (full)
AStable Version/1.2.4/IrrLib.cpp (full)
AStable Version/1.2.4/IrrLib.h (full)
AStable Version/1.2.4/IrrLibBase.cpp (full)
AStable Version/1.2.4/IrrLibBase.h (full)
AStable Version/1.2.4/IrrLibData.cpp
AStable Version/1.2.4/IrrLibData.h (full)
AStable Version/1.2.4/IrrLibGUI.cpp (full)
AStable Version/1.2.4/IrrLibGUI.h (full)
AStable Version/1.2.4/IrrSphere.cpp (full)
AStable Version/1.2.4/IrrSphere.h (full)
AStable Version/1.2.4/IrrSprite.cpp (full)
AStable Version/1.2.4/IrrSprite.h (full)
AStable Version/1.2.4/README (full)
AStable Version/1.2.5/CHANGES (full)
AStable Version/1.2.5/CREDITS (full)
AStable Version/1.2.5/Irr2D.cpp (full)
AStable Version/1.2.5/Irr2D.h (full)
AStable Version/1.2.5/Irr3D.cpp (full)
AStable Version/1.2.5/Irr3D.h (full)
AStable Version/1.2.5/IrrColor.cpp (full)
AStable Version/1.2.5/IrrColor.h (full)
AStable Version/1.2.5/IrrEventReciever.cpp (full)
AStable Version/1.2.5/IrrEventReciever.h (full)
AStable Version/1.2.5/IrrLib.cpp (full)
AStable Version/1.2.5/IrrLib.h (full)
AStable Version/1.2.5/IrrLibBase.cpp (full)
AStable Version/1.2.5/IrrLibBase.h (full)
AStable Version/1.2.5/IrrLibDLL.dll
AStable Version/1.2.5/IrrLibData.cpp
AStable Version/1.2.5/IrrLibData.h (full)
AStable Version/1.2.5/IrrLibGUI.cpp (full)
AStable Version/1.2.5/IrrLibGUI.h (full)
AStable Version/1.2.5/IrrSphere.cpp (full)
AStable Version/1.2.5/IrrSphere.h (full)
AStable Version/1.2.5/IrrSprite.cpp (full)
AStable Version/1.2.5/IrrSprite.h (full)
AStable Version/1.2.5/README (full)
AStable Version/1.2.5/dll.cbp (full)
AStable Version/1.2.5/dll.layout (full)
AStable Version/1.2.5/libIrrLibDLL.a
AStable Version/1.2.6/CHANGES (full)
AStable Version/1.2.6/CREDITS (full)
AStable Version/1.2.6/Irr2D.cpp (full)
AStable Version/1.2.6/Irr2D.h (full)
AStable Version/1.2.6/Irr3D.cpp (full)
AStable Version/1.2.6/Irr3D.h (full)
AStable Version/1.2.6/IrrColor.cpp (full)
AStable Version/1.2.6/IrrColor.h (full)
AStable Version/1.2.6/IrrEventReciever.cpp (full)
AStable Version/1.2.6/IrrEventReciever.h (full)
AStable Version/1.2.6/IrrLib.cpp (full)
AStable Version/1.2.6/IrrLib.h (full)
AStable Version/1.2.6/IrrLibBase.cpp (full)
AStable Version/1.2.6/IrrLibBase.h (full)
AStable Version/1.2.6/IrrLibData.cpp
AStable Version/1.2.6/IrrLibData.h (full)
AStable Version/1.2.6/IrrLibGUI.cpp (full)
AStable Version/1.2.6/IrrLibGUI.h (full)
AStable Version/1.2.6/IrrSphere.cpp (full)
AStable Version/1.2.6/IrrSphere.h (full)
AStable Version/1.2.6/IrrSprite.cpp (full)
AStable Version/1.2.6/IrrSprite.h (full)
AStable Version/1.2.6/README (full)
AStable Version/1.2.7/CHANGES (full)
AStable Version/1.2.7/CREDITS (full)
AStable Version/1.2.7/Irr2D.cpp (full)
AStable Version/1.2.7/Irr2D.h (full)
AStable Version/1.2.7/Irr3D.cpp (full)
AStable Version/1.2.7/Irr3D.h (full)
AStable Version/1.2.7/IrrColor.cpp (full)
AStable Version/1.2.7/IrrColor.h (full)
AStable Version/1.2.7/IrrEventReciever.cpp (full)
AStable Version/1.2.7/IrrEventReciever.h (full)
AStable Version/1.2.7/IrrLib.cpp (full)
AStable Version/1.2.7/IrrLib.h (full)
AStable Version/1.2.7/IrrLibBase.cpp (full)
AStable Version/1.2.7/IrrLibBase.h (full)
AStable Version/1.2.7/IrrLibGUI.cpp (full)
AStable Version/1.2.7/IrrLibGUI.h (full)
AStable Version/1.2.7/IrrSphere.cpp (full)
AStable Version/1.2.7/IrrSphere.h (full)
AStable Version/1.2.7/IrrSprite.cpp (full)
AStable Version/1.2.7/IrrSprite.h (full)
AStable Version/1.2.7/README (full)
AStable Version/1.2.9/CHANGES (full)
AStable Version/1.2.9/CREDITS (full)
AStable Version/1.2.9/Irr2D.cpp (full)
AStable Version/1.2.9/Irr2D.h (full)
AStable Version/1.2.9/Irr3D.cpp (full)
AStable Version/1.2.9/Irr3D.h (full)
AStable Version/1.2.9/IrrColor.cpp (full)
AStable Version/1.2.9/IrrColor.h (full)
AStable Version/1.2.9/IrrData.h (full)
AStable Version/1.2.9/IrrEventReciever.cpp (full)
AStable Version/1.2.9/IrrEventReciever.h (full)
AStable Version/1.2.9/IrrLib.cpp (full)
AStable Version/1.2.9/IrrLib.h (full)
AStable Version/1.2.9/IrrLibBase.cpp (full)
AStable Version/1.2.9/IrrLibBase.h (full)
AStable Version/1.2.9/IrrLibGUI.cpp (full)
AStable Version/1.2.9/IrrLibGUI.h (full)
AStable Version/1.2.9/IrrSphere.cpp (full)
AStable Version/1.2.9/IrrSphere.h (full)
AStable Version/1.2.9/IrrSprite.cpp (full)
AStable Version/1.2.9/IrrSprite.h (full)
AStable Version/1.2.9/README (full)
AStable Version/1.3.3/CHANGES (full)
AStable Version/1.3.3/CREDITS (full)
AStable Version/1.3.3/Collision.h (full)
AStable Version/1.3.3/Irr2D.cpp (full)
AStable Version/1.3.3/Irr2D.h (full)
AStable Version/1.3.3/Irr2DLibObj.cpp
AStable Version/1.3.3/Irr2DLibObj.h
AStable Version/1.3.3/Irr3D.cpp (full)
AStable Version/1.3.3/Irr3D.h (full)
AStable Version/1.3.3/Irr3DLibObj.cpp (full)
AStable Version/1.3.3/Irr3DLibObj.h (full)
AStable Version/1.3.3/Irr3DObjColor.h (full)
AStable Version/1.3.3/Irr3DPos.h (full)
AStable Version/1.3.3/IrrColor.cpp (full)
AStable Version/1.3.3/IrrColor.h (full)
AStable Version/1.3.3/IrrDefines.h (full)
AStable Version/1.3.3/IrrEventReciever.cpp (full)
AStable Version/1.3.3/IrrEventReciever.h (full)
AStable Version/1.3.3/IrrFunctions.cpp (full)
AStable Version/1.3.3/IrrFunctions.h (full)
AStable Version/1.3.3/IrrGUIStruct.h (full)
AStable Version/1.3.3/IrrLib.cpp (full)
AStable Version/1.3.3/IrrLib.h (full)
AStable Version/1.3.3/IrrLibBase.cpp (full)
AStable Version/1.3.3/IrrLibBase.h (full)
AStable Version/1.3.3/IrrLibGUI.cpp (full)
AStable Version/1.3.3/IrrLibGUI.h (full)
AStable Version/1.3.3/IrrLibObj.h (full)
AStable Version/1.3.3/IrrObj.h (full)
AStable Version/1.3.3/IrrOpt.h (full)
AStable Version/1.3.3/IrrPhysics.cpp (full)
AStable Version/1.3.3/IrrPhysics.h (full)
AStable Version/1.3.3/IrrSphere.cpp (full)
AStable Version/1.3.3/IrrSphere.h (full)
AStable Version/1.3.3/IrrSprite.cpp (full)
AStable Version/1.3.3/IrrSprite.h (full)
AStable Version/1.3.3/Newton.h (full)
AStable Version/1.3.3/README (full)
AStable Version/1.3.3/_mouse.h (full)
AUnstable Version/1.2.2b/CHANGES (full)
AUnstable Version/1.2.2b/Irr2D.cpp (full)
AUnstable Version/1.2.2b/Irr2D.h (full)
AUnstable Version/1.2.2b/Irr3D.cpp (full)
AUnstable Version/1.2.2b/Irr3D.h (full)
AUnstable Version/1.2.2b/IrrColor.cpp (full)
AUnstable Version/1.2.2b/IrrColor.h (full)
AUnstable Version/1.2.2b/IrrEventReciever.h (full)
AUnstable Version/1.2.2b/IrrLib.cpp (full)
AUnstable Version/1.2.2b/IrrLib.h (full)
AUnstable Version/1.2.2b/IrrSphere.cpp (full)
AUnstable Version/1.2.2b/IrrSphere.h (full)
AUnstable Version/1.2.2b/IrrSprite.cpp (full)
AUnstable Version/1.2.2b/IrrSprite.h (full)
AUnstable Version/1.2.2b/README (full)
AUnstable Version/1.2.8/CHANGES (full)
AUnstable Version/1.2.8/CREDITS (full)
AUnstable Version/1.2.8/Irr2D.cpp (full)
AUnstable Version/1.2.8/Irr2D.h (full)
AUnstable Version/1.2.8/Irr3D.cpp (full)
AUnstable Version/1.2.8/Irr3D.h (full)
AUnstable Version/1.2.8/IrrColor.cpp (full)
AUnstable Version/1.2.8/IrrColor.h (full)
AUnstable Version/1.2.8/IrrEventReciever.cpp (full)
AUnstable Version/1.2.8/IrrEventReciever.h (full)
AUnstable Version/1.2.8/IrrLib.cpp (full)
AUnstable Version/1.2.8/IrrLib.h (full)
AUnstable Version/1.2.8/IrrLibBase.cpp (full)
AUnstable Version/1.2.8/IrrLibBase.h (full)
AUnstable Version/1.2.8/IrrLibGUI.cpp (full)
AUnstable Version/1.2.8/IrrLibGUI.h (full)
AUnstable Version/1.2.8/IrrSphere.cpp (full)
AUnstable Version/1.2.8/IrrSphere.h (full)
AUnstable Version/1.2.8/IrrSprite.cpp (full)
AUnstable Version/1.2.8/IrrSprite.h (full)
AUnstable Version/1.2.8/README (full)
AUnstable Version/1.2.9/CHANGES (full)
AUnstable Version/1.2.9/CREDITS (full)
AUnstable Version/1.2.9/Irr2D.cpp (full)
AUnstable Version/1.2.9/Irr2D.h (full)
AUnstable Version/1.2.9/Irr3D.cpp (full)
AUnstable Version/1.2.9/Irr3D.h (full)
AUnstable Version/1.2.9/IrrColor.cpp (full)
AUnstable Version/1.2.9/IrrColor.h (full)
AUnstable Version/1.2.9/IrrEventReciever.cpp (full)
AUnstable Version/1.2.9/IrrEventReciever.h (full)
AUnstable Version/1.2.9/IrrLib.cpp (full)
AUnstable Version/1.2.9/IrrLib.h (full)
AUnstable Version/1.2.9/IrrLibBase.cpp (full)
AUnstable Version/1.2.9/IrrLibBase.h (full)
AUnstable Version/1.2.9/IrrLibGUI.cpp (full)
AUnstable Version/1.2.9/IrrLibGUI.h (full)
AUnstable Version/1.2.9/IrrSphere.cpp (full)
AUnstable Version/1.2.9/IrrSphere.h (full)
AUnstable Version/1.2.9/IrrSprite.cpp (full)
AUnstable Version/1.2.9/IrrSprite.h (full)
AUnstable Version/1.2.9/README (full)
AUnstable Version/1.2b/Irr2D.cpp (full)
AUnstable Version/1.2b/Irr2D.h (full)
AUnstable Version/1.2b/IrrColor.cpp (full)
AUnstable Version/1.2b/IrrColor.h (full)
AUnstable Version/1.2b/IrrLib.cpp (full)
AUnstable Version/1.2b/IrrLib.h (full)
AUnstable Version/1.2b/IrrSphere.cpp (full)
AUnstable Version/1.2b/IrrSphere.h (full)
AUnstable Version/1.3.0/CHANGES (full)
AUnstable Version/1.3.0/CREDITS (full)
AUnstable Version/1.3.0/Irr2D.cpp (full)
AUnstable Version/1.3.0/Irr2D.h (full)
AUnstable Version/1.3.0/Irr3D.cpp (full)
AUnstable Version/1.3.0/Irr3D.h (full)
AUnstable Version/1.3.0/IrrColor.cpp (full)
AUnstable Version/1.3.0/IrrColor.h (full)
AUnstable Version/1.3.0/IrrData.h (full)
AUnstable Version/1.3.0/IrrEventReciever.cpp (full)
AUnstable Version/1.3.0/IrrEventReciever.h (full)
AUnstable Version/1.3.0/IrrLib.cpp (full)
AUnstable Version/1.3.0/IrrLib.h (full)
AUnstable Version/1.3.0/IrrLibBase.cpp (full)
AUnstable Version/1.3.0/IrrLibBase.h (full)
AUnstable Version/1.3.0/IrrLibGUI.cpp (full)
AUnstable Version/1.3.0/IrrLibGUI.h (full)
AUnstable Version/1.3.0/IrrSphere.cpp (full)
AUnstable Version/1.3.0/IrrSphere.h (full)
AUnstable Version/1.3.0/IrrSprite.cpp (full)
AUnstable Version/1.3.0/IrrSprite.h (full)
AUnstable Version/1.3.0/README (full)
AUnstable Version/1.3.1/Changes (full)
AUnstable Version/1.3.1/Credits (full)
AUnstable Version/1.3.1/Irr2d.cpp (full)
AUnstable Version/1.3.1/Irr2d.h (full)
AUnstable Version/1.3.1/Irr3d.cpp (full)
AUnstable Version/1.3.1/Irr3d.h (full)
AUnstable Version/1.3.1/IrrEventReciever.cpp (full)
AUnstable Version/1.3.1/IrrEventReciever.h (full)
AUnstable Version/1.3.1/IrrLibBase.cpp (full)
AUnstable Version/1.3.1/IrrLibBase.h (full)
AUnstable Version/1.3.1/IrrLibGUI.cpp (full)
AUnstable Version/1.3.1/IrrLibGUI.h (full)
AUnstable Version/1.3.1/IrrSphere.cpp (full)
AUnstable Version/1.3.1/IrrSphere.h (full)
AUnstable Version/1.3.1/IrrSprite.cpp (full)
AUnstable Version/1.3.1/IrrSprite.h (full)
AUnstable Version/1.3.1/Irrcolor.cpp (full)
AUnstable Version/1.3.1/Irrcolor.h (full)
AUnstable Version/1.3.1/Irrdata.h (full)
AUnstable Version/1.3.1/Irrlib.cpp (full)
AUnstable Version/1.3.1/Irrlib.h (full)
AUnstable Version/1.3.1/Readme (full)
AUnstable Version/1.3.2/CHANGES (full)
AUnstable Version/1.3.2/CREDITS (full)
AUnstable Version/1.3.2/Irr2D.cpp (full)
AUnstable Version/1.3.2/Irr2D.h (full)
AUnstable Version/1.3.2/Irr3D.cpp (full)
AUnstable Version/1.3.2/Irr3D.h (full)
AUnstable Version/1.3.2/Irr3DObj.cpp (full)
AUnstable Version/1.3.2/Irr3DObj.h (full)
AUnstable Version/1.3.2/IrrColor.cpp (full)
AUnstable Version/1.3.2/IrrColor.h (full)
AUnstable Version/1.3.2/IrrData.h (full)
AUnstable Version/1.3.2/IrrEventReciever.cpp (full)
AUnstable Version/1.3.2/IrrEventReciever.h (full)
AUnstable Version/1.3.2/IrrFunctions.cpp (full)
AUnstable Version/1.3.2/IrrFunctions.h (full)
AUnstable Version/1.3.2/IrrLib.cpp (full)
AUnstable Version/1.3.2/IrrLib.h (full)
AUnstable Version/1.3.2/IrrLibBase.cpp (full)
AUnstable Version/1.3.2/IrrLibBase.h (full)
AUnstable Version/1.3.2/IrrLibGUI.cpp (full)
AUnstable Version/1.3.2/IrrLibGUI.h (full)
AUnstable Version/1.3.2/IrrPhysics.cpp (full)
AUnstable Version/1.3.2/IrrPhysics.h (full)
AUnstable Version/1.3.2/IrrSphere.cpp (full)
AUnstable Version/1.3.2/IrrSphere.h (full)
AUnstable Version/1.3.2/IrrSprite.cpp (full)
AUnstable Version/1.3.2/IrrSprite.h (full)
AUnstable Version/1.3.2/Newton.h (full)
AUnstable Version/1.3.2/README (full)
AUnstable Version/1.3.3/CHANGES (full)
AUnstable Version/1.3.3/CREDITS (full)
AUnstable Version/1.3.3/Collision.h (full)
AUnstable Version/1.3.3/Copy of IrrFunctions.cpp (full)
AUnstable Version/1.3.3/Irr2D.cpp (full)
AUnstable Version/1.3.3/Irr2D.h (full)
AUnstable Version/1.3.3/Irr2DLibObj.cpp (full)
AUnstable Version/1.3.3/Irr2DLibObj.h (full)
AUnstable Version/1.3.3/Irr3D.cpp (full)
AUnstable Version/1.3.3/Irr3D.h (full)
AUnstable Version/1.3.3/Irr3DLibObj.cpp (full)
AUnstable Version/1.3.3/Irr3DLibObj.h (full)
AUnstable Version/1.3.3/Irr3DObjColor.h (full)
AUnstable Version/1.3.3/Irr3DPos.h (full)
AUnstable Version/1.3.3/IrrColor.cpp (full)
AUnstable Version/1.3.3/IrrColor.h (full)
AUnstable Version/1.3.3/IrrDefines.h (full)
AUnstable Version/1.3.3/IrrDevices.h (full)
AUnstable Version/1.3.3/IrrEventReciever.cpp (full)
AUnstable Version/1.3.3/IrrEventReciever.h (full)
AUnstable Version/1.3.3/IrrFunctions.cpp (full)
AUnstable Version/1.3.3/IrrFunctions.h (full)
AUnstable Version/1.3.3/IrrGUIStruct.h (full)
AUnstable Version/1.3.3/IrrLib.cpp (full)
AUnstable Version/1.3.3/IrrLib.h (full)
AUnstable Version/1.3.3/IrrLibBase.cpp (full)
AUnstable Version/1.3.3/IrrLibBase.h (full)
AUnstable Version/1.3.3/IrrLibGUI.cpp (full)
AUnstable Version/1.3.3/IrrLibGUI.h (full)
AUnstable Version/1.3.3/IrrLibObj.h (full)
AUnstable Version/1.3.3/IrrObj.h (full)
AUnstable Version/1.3.3/IrrOpt.h (full)
AUnstable Version/1.3.3/IrrPhysics.cpp (full)
AUnstable Version/1.3.3/IrrPhysics.h (full)
AUnstable Version/1.3.3/IrrSphere.cpp (full)
AUnstable Version/1.3.3/IrrSphere.h (full)
AUnstable Version/1.3.3/IrrSprite.cpp (full)
AUnstable Version/1.3.3/IrrSprite.h (full)
AUnstable Version/1.3.3/IrrText.cpp (full)
AUnstable Version/1.3.3/IrrText.h (full)
AUnstable Version/1.3.3/Newton.h (full)
AUnstable Version/1.3.3/README (full)
AUnstable Version/1.3.3/_mouse.h (full)
AUnstable Version/1.3.3/dList.h (full)
AUnstable Version/1.3.3/dMatrix.cpp (full)
AUnstable Version/1.3.3/dMatrix.h (full)
AUnstable Version/1.3.3/dQuaternion.cpp (full)
AUnstable Version/1.3.3/dQuaternion.h (full)
AUnstable Version/1.3.3/dVector.h (full)
AUnstable Version/1.3.3/glut.h (full)
AUnstable Version/1.3.3/main.cpp (full)
AUnstable Version/1.3.3/stdafx.h (full)
AWIP/INFO (full)
AWIP/Irr2D.h (full)
AWIP/Irr2DObj.cpp (full)
AWIP/Irr2DObj.h (full)
AWIP/Irr2d.cpp (full)
AWIP/Irr3D.cpp (full)
AWIP/Irr3DObj.cpp (full)
AWIP/Irr3DObj.h (full)
AWIP/Irr3d.h (full)
AWIP/IrrColor.cpp (full)
AWIP/IrrColor.h (full)
AWIP/IrrLib.cpp (full)
AWIP/IrrLib.h (full)
AWIP/Newton.h (full)
AWIP/dlls/newton.dll
AWIP/dlls/newton.lib
AWIP/dlls/newton.map (full)
AWIP/dlls/newton.pdb

File differences

Examples/Example_1.old/q3level.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include <iostream>
#include "../../IrrLib/IrrLib.h"
using namespace std;
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
int main(){
IrrLib Irrlicht(3, 640, 480, 16, false, true, true);
Irrlicht.ReadArchive("../../media/map-20kdm2.pk3");
Irrlicht.LoadQ3Level("20kdm2.bsp");
Irrlicht.NodePos(-1300, -144, -1249);
//Sets the camera at that x, y, z position
Irrlicht.AddFPSCam();
Irrlicht.VisibleCursor(false);
int lastFPS = -1;
int fps = -1;
while (Irrlicht.DeviceIsRunning())
if (Irrlicht.IsActiveWindow())
{
Irrlicht.BeginScene();
Irrlicht.DrawAll();
Irrlicht.EndScene();
fps = Irrlicht.GetFPSCount();
if (lastFPS != fps)
{
stringw str = L"Irrlicht Engine - Quake 3 Map example [";
str += Irrlicht.GetDriverName();
str += "] FPS:";
str += fps;
Irrlicht.SetWindowCaption(str);
lastFPS = fps;
}
}
Irrlicht.EndIrrlicht();
return 0; //the deconstructor will delete all our dynamic vars so we don't have horriable memory leaks!
//That was easy wasn't it?
//Everything is now humanreadable, I think your next door neighbor could even figure out whats going on....maybe
}
Examples/Example_10_DisableEscExit/main_x.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include <iostream>
#include "IrrLib.h"
#include <irrlicht.h>
using namespace std;
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
int main(){
IrrLib Irrlicht(5, 640, 480, 16, false, true, false);
Irrlicht.IrrEvent.SetEscExit(false);
while (Irrlicht.DeviceIsRunning())
if (Irrlicht.IsActiveWindow())
{
Irrlicht.BeginScene();
Irrlicht.DrawAll();
Irrlicht.EndScene();
}
Irrlicht.EndIrrlicht();
return 0;
}
Examples/Example_11_3DObjects/main_x.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#include <iostream>
#include "IrrLib.h"
#include <irrlicht.h>
using namespace std;
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
int main(){
IrrLib Irrlicht(5, 640, 480, 16, false, true, false);
Irr3DObjColor col1;
Irr3DObjColor col2;
int nHits;
int nTimes = 0;
//Color 1
col1.a = 255;
col1.r = 0;
col1.g = 255;
col1.b = 5;
//color 2
col2.a = 255;
col2.r = 0;
col2.g = 255;
col2.b = 255;
//Pos 1
Irr3DPos pos1;
pos1.x = 0;
pos1.y = 0;
pos1.z = 0;
Irr3DObj obj1;
obj1->setColor(col1);
obj1->setMesh("sphere.3ds");
Irr3DObj obj2;
obj2->setMesh("cube.3ds");
obj2->setColor(col2);
obj1->addToScene();
obj2->addToScene();
Irrlicht.AddFPSCam();
while (Irrlicht.DeviceIsRunning())
if (Irrlicht.IsActiveWindow())
{
nHits = CheckForCollision(obj1,obj2);
if (nHits > 0)
{
cout << "The sphere collided with the squre " << nTimes << endl;
nTimes++;
}
if (Irrlicht.IrrEvent.keyStates[KEY_KEY_W]){
Irrlicht.IrrEvent.keyStates[KEY_KEY_W] = false;
pos1.x = pos1.x + 10;
obj1->Move(pos1);
}
if (Irrlicht.IrrEvent.keyStates[KEY_KEY_S]){
Irrlicht.IrrEvent.keyStates[KEY_KEY_S] = false;
pos1.x = pos1.x - 10;
obj1->Move(pos1);
}
Irrlicht.BeginScene(Irrlicht.Color.RED);
Irrlicht.DrawAll();
Irrlicht.EndScene();
nHits = 0;
}
Irrlicht.EndIrrlicht();
return 0;
}
Examples/Example_1_Basic/main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#include <iostream>
#include "IrrLib.h"
#include <irrlicht.h>
using namespace std;
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
int main(){
/*
Driver types:
0 = NULL
1 = EDT_SOFTWARE
2 = EDT_BURNINGSVIDEO
3 = EDT_OPENGL
4 = EDT_DIRECT3D8 *Note not supported by Microsoft anymore
5 = EDT_DIRECT3D9 *Reccommended
defualt = EDT_SOFTWARE
If you are confused using the driver types consider using an enum:
//note you can name the drivers what ever you want, C++ will still number them correctly assuming they are in this order
enum IrrDriverType { NULL, EDT_SOFTWARE, EDT_BURNINGSVIDEO, EDT_OPENGL, EDT_DIRECT3D8, EDT_DIRECT3D9 };
IrrDriverType = EDT_DIRECT3D9;
//then pass IrrDriverType to Irrlicht constructor
IrrLib Irrlicht(IrrDriverType, 640, 480, 16, false, true, false);
Note: Do not set vsync, last param, to true unless you want to slow down your
software. ie playing doom on a $5,000 gaming machine, would be wise to use vsync
in that senerio.
*/
//This is a non defualt constructor for the IrrLib
//Defualt uses software with 640x480 res and all settings to false
// You can declare a default Irrlicht like this:
// IrrLib Irrlicht;
/*
IrrLib::IrrLib(int nDrivertype, int width, int height, int bits, bool fullscreen, bool stencilbuffer, bool vsync);
As you can see from the function prototype, I am created a new Irrlicht device using Direct3D9 driver, 640x480 res, with fullscreen off, stencil buffer on, and vsync off
*/
IrrLib Irrlicht(5, 640, 480, 16, false, true, false);
//if Irrlicht is the active window
// You don't have to use it, but your 'game' will still be running if the user alt tabs to word or something
//Lets create a loop until the Irrlicht device is stoped
while (Irrlicht.DeviceIsRunning())
if (Irrlicht.IsActiveWindow())
{
//Default begin scene uses a grey background
Irrlicht.BeginScene();
//Tells Irrlicht to draw everything to the screen, GUI elements/3D-2D objects including spheres
Irrlicht.DrawAll();
//Tells Irrlicht that we are done drawing anything
Irrlicht.EndScene();
}
//Our game is done, tell Irrlicht to clean up and exit
Irrlicht.EndIrrlicht();
return 0; //the deconstructor will delete all our dynamic vars so we don't have horriable memory leaks!
}
Examples/Example_1_Basic/main_x.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include <iostream>
#include "IrrLib.h"
#include <irrlicht.h>
using namespace std;
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
int main(){
IrrLib Irrlicht(5, 640, 480, 16, false, true, false);
while (Irrlicht.DeviceIsRunning())
if (Irrlicht.IsActiveWindow())
{
Irrlicht.BeginScene();
Irrlicht.DrawAll();
Irrlicht.EndScene();
}
Irrlicht.EndIrrlicht();
return 0;
}
Examples/Example_2_SceneColor/main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#include <iostream>
#include "IrrLib.h"
#include <irrlicht.h>
using namespace std;
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
int main(){
/*
Driver types:
0 = NULL
1 = EDT_SOFTWARE
2 = EDT_BURNINGSVIDEO
3 = EDT_OPENGL
4 = EDT_DIRECT3D8 *Note not supported by Microsoft anymore
5 = EDT_DIRECT3D9 *Reccommended
defualt = EDT_SOFTWARE
Note: Do not set vsync, last param, to true unless you want to slow down your
software. ie playing doom on a $5,000 gaming machine, would be wise to use vsync
in that senerio.
*/
//This is a non defualt constructor for the IrrLib
//Defualt uses software with 640x480 res and all settings to false
// You can declare a default Irrlicht like this:
// IrrLib Irrlicht;
/*
IrrLib::IrrLib(int nDrivertype, int width, int height, int bits, bool fullscreen, bool stencilbuffer, bool vsync);
As you can see from the function prototype, I am created a new Irrlicht device using Direct3D9 driver, 640x480 res, with fullscreen off, stencil buffer on, and vsync off
*/
IrrLib Irrlicht(5, 640, 480, 16, false, true, false);
//if Irrlicht is the active window
// You don't have to use it, but your 'game' will still be running if the user alt tabs to word or something
//Lets create a loop until the Irrlicht device is stoped
while (Irrlicht.DeviceIsRunning())
if (Irrlicht.IsActiveWindow())
{
//black background
Irrlicht.BeginScene(SColor(255, 255, 255));
//For the background color you have another choice:
/*
Irrlicht.BeginScene(Irrlicht.Color("green"));
*/
//This would also work, because the color class is a wrapper for some basic colors.
/* Other choices include:
red
green
blue
dark green
pink
grey
*/
//Tells Irrlicht to draw everything to the screen, GUI elements/3D-2D objects including spheres
Irrlicht.DrawAll();
//Tells Irrlicht that we are done drawing anything
Irrlicht.EndScene();
}
//Our game is done, tell Irrlicht to clean up and exit
Irrlicht.EndIrrlicht();
return 0; //the deconstructor will delete all our dynamic vars so we don't have horriable memory leaks!
}
Examples/Example_2_SceneColor/main_x.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include <iostream>
#include "IrrLib.h"
#include <irrlicht.h>
using namespace std;
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
int main(){
IrrLib Irrlicht(5, 640, 480, 16, false, true, false);
while (Irrlicht.DeviceIsRunning())
if (Irrlicht.IsActiveWindow())
{
Irrlicht.BeginScene(SColor(255, 255, 255, 255));
Irrlicht.DrawAll();
Irrlicht.EndScene();
}
Irrlicht.EndIrrlicht();
return 0;
}
Examples/Example_3_Keyboard/main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#include <iostream>
#include "IrrLib.h"
#include <irrlicht.h>
using namespace std;
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
int main(){
/*
Driver types:
0 = NULL
1 = EDT_SOFTWARE
2 = EDT_BURNINGSVIDEO
3 = EDT_OPENGL
4 = EDT_DIRECT3D8 *Note not supported by Microsoft anymore
5 = EDT_DIRECT3D9 *Reccommended
defualt = EDT_SOFTWARE
Note: Do not set vsync, last param, to true unless you want to slow down your
software. ie playing doom on a $5,000 gaming machine, would be wise to use vsync
in that senerio.
*/
//This is a non defualt constructor for the IrrLib
//Defualt uses software with 640x480 res and all settings to false
// You can declare a default Irrlicht like this:
// IrrLib Irrlicht;
/*
IrrLib::IrrLib(int nDrivertype, int width, int height, int bits, bool fullscreen, bool stencilbuffer, bool vsync);
As you can see from the function prototype, I am created a new Irrlicht device using Direct3D9 driver, 640x480 res, with fullscreen off, stencil buffer on, and vsync off
*/
IrrLib Irrlicht(5, 640, 480, 16, false, true, false);
//if Irrlicht is the active window
// You don't have to use it, but your 'game' will still be running if the user alt tabs to word or something
//Lets create a loop until the Irrlicht device is stoped
while (Irrlicht.DeviceIsRunning())
if (Irrlicht.IsActiveWindow())
{
//grey background
Irrlicht.BeginScene();
//Tells Irrlicht to draw everything to the screen, GUI elements/3D-2D objects including spheres
Irrlicht.DrawAll();
//Tells Irrlicht that we are done drawing anything
Irrlicht.EndScene();
//If user hits escape, exit
//Note* Exit condition has to be done last else you will get a nonsense error from Irrlicht saying it couldn't draw.
if (Irrlicht.IrrEvent.keyStates[KEY_ESCAPE]){
Irrlicht.IrrEvent.keyStates[KEY_ESCAPE] = false;
Irrlicht.Exit();
}
}
//Our game is done, tell Irrlicht to clean up and exit
Irrlicht.EndIrrlicht();
return 0; //the deconstructor will delete all our dynamic vars so we don't have horriable memory leaks!
}
Examples/Example_3_Keyboard/main_x.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include <iostream>
#include "IrrLib.h"
#include <irrlicht.h>
using namespace std;
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
int main(){
IrrLib Irrlicht(5, 640, 480, 16, false, true, false);
while (Irrlicht.DeviceIsRunning())
if (Irrlicht.IsActiveWindow())
{
Irrlicht.BeginScene();
Irrlicht.DrawAll();
Irrlicht.EndScene();
if (Irrlicht.IrrEvent.keyStates[KEY_ESCAPE]){
Irrlicht.IrrEvent.keyStates[KEY_ESCAPE] = false;
Irrlicht.Exit();
}
}
Irrlicht.EndIrrlicht();
return 0;
}
Examples/Example_4_WindowCaption/UsingStdString.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#include <iostream>
#include "IrrLib.h"
#include <irrlicht.h>
using namespace std;
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
int main(){
/*
Driver types:
0 = NULL
1 = EDT_SOFTWARE
2 = EDT_BURNINGSVIDEO
3 = EDT_OPENGL
4 = EDT_DIRECT3D8 *Note not supported by Microsoft anymore
5 = EDT_DIRECT3D9 *Reccommended
defualt = EDT_SOFTWARE
Note: Do not set vsync, last param, to true unless you want to slow down your
software. ie playing doom on a $5,000 gaming machine, would be wise to use vsync
in that senerio.
*/
//This is a non defualt constructor for the IrrLib
//Defualt uses software with 640x480 res and all settings to false
// You can declare a default Irrlicht like this:
// IrrLib Irrlicht;
/*
IrrLib::IrrLib(int nDrivertype, int width, int height, int bits, bool fullscreen, bool stencilbuffer, bool vsync);
As you can see from the function prototype, I am created a new Irrlicht device using Direct3D9 driver, 640x480 res, with fullscreen off, stencil buffer on, and vsync off
*/
IrrLib Irrlicht(5, 640, 480, 16, false, true, false);
//if Irrlicht is the active window
// You don't have to use it, but your 'game' will still be running if the user alt tabs to word or something
//Lets create a loop until the Irrlicht device is stoped
while (Irrlicht.DeviceIsRunning())
if (Irrlicht.IsActiveWindow())
{
//grey background
Irrlicht.BeginScene();
//Tells Irrlicht to draw everything to the screen, GUI elements/3D-2D objects including spheres
Irrlicht.DrawAll();
//Tells Irrlicht that we are done drawing anything
Irrlicht.EndScene();
//If user hits escape, exit
//Note* Exit condition has to be done last else you will get a nonsense error from Irrlicht saying it couldn't draw.
if (Irrlicht.IrrEvent.keyStates[KEY_ESCAPE]){
Irrlicht.IrrEvent.keyStates[KEY_ESCAPE] = false;
Irrlicht.Exit();
}
//This demostrates using std::string to set a window caption
std::string str = "IrrLib is cool!";
//Every class in Irrlicht knows some basic conversion
//See the following examples for more options
/*
You can also convert a stringw to a std::string using
stringw tmpw = L"This is fun!";
std::string tmp = Irrlicht.stringw_to_stdstring(tmpw);
Every class also knows how to convert an int to std::string
std::string snum = Irrlicht.int_to_string(5);
*/
Irrlicht.SetWindowCaption(Irrlicht.stdstring_to_stringw(str));
}
//Our game is done, tell Irrlicht to clean up and exit
Irrlicht.EndIrrlicht();
return 0; //the deconstructor will delete all our dynamic vars so we don't have horriable memory leaks!
}
Examples/Example_4_WindowCaption/UsingStringw.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#include <iostream>
#include "IrrLib.h"
#include <irrlicht.h>
using namespace std;
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
int main(){
/*
Driver types:
0 = NULL
1 = EDT_SOFTWARE
2 = EDT_BURNINGSVIDEO
3 = EDT_OPENGL
4 = EDT_DIRECT3D8 *Note not supported by Microsoft anymore
5 = EDT_DIRECT3D9 *Reccommended
defualt = EDT_SOFTWARE
Note: Do not set vsync, last param, to true unless you want to slow down your
software. ie playing doom on a $5,000 gaming machine, would be wise to use vsync
in that senerio.
*/
//This is a non defualt constructor for the IrrLib
//Defualt uses software with 640x480 res and all settings to false
// You can declare a default Irrlicht like this:
// IrrLib Irrlicht;
/*
IrrLib::IrrLib(int nDrivertype, int width, int height, int bits, bool fullscreen, bool stencilbuffer, bool vsync);
As you can see from the function prototype, I am created a new Irrlicht device using Direct3D9 driver, 640x480 res, with fullscreen off, stencil buffer on, and vsync off
*/
IrrLib Irrlicht(5, 640, 480, 16, false, true, false);
//if Irrlicht is the active window
// You don't have to use it, but your 'game' will still be running if the user alt tabs to word or something
//Lets create a loop until the Irrlicht device is stoped
while (Irrlicht.DeviceIsRunning())
if (Irrlicht.IsActiveWindow())
{
//grey background
Irrlicht.BeginScene();
//Tells Irrlicht to draw everything to the screen, GUI elements/3D-2D objects including spheres
Irrlicht.DrawAll();
//Tells Irrlicht that we are done drawing anything
Irrlicht.EndScene();
//If user hits escape, exit
//Note* Exit condition has to be done last else you will get a nonsense error from Irrlicht saying it couldn't draw.
if (Irrlicht.IrrEvent.keyStates[KEY_ESCAPE]){
Irrlicht.IrrEvent.keyStates[KEY_ESCAPE] = false;
Irrlicht.Exit();
}
//This demostrates using irrlichts stringw data type
//See the following examples for more options
stringw str = L"Hello world, this is a fun game!";
Irrlicht.SetWindowCaption(str);
}
//Our game is done, tell Irrlicht to clean up and exit
Irrlicht.EndIrrlicht();
return 0; //the deconstructor will delete all our dynamic vars so we don't have horriable memory leaks!
}
Examples/Example_4_WindowCaption/main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#include <iostream>
#include "IrrLib.h"
#include <irrlicht.h>
using namespace std;
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
int main(){
/*
Driver types:
0 = NULL
1 = EDT_SOFTWARE
2 = EDT_BURNINGSVIDEO
3 = EDT_OPENGL
4 = EDT_DIRECT3D8 *Note not supported by Microsoft anymore
5 = EDT_DIRECT3D9 *Reccommended
defualt = EDT_SOFTWARE
Note: Do not set vsync, last param, to true unless you want to slow down your
software. ie playing doom on a $5,000 gaming machine, would be wise to use vsync
in that senerio.
*/
//This is a non defualt constructor for the IrrLib
//Defualt uses software with 640x480 res and all settings to false
// You can declare a default Irrlicht like this:
// IrrLib Irrlicht;
/*
IrrLib::IrrLib(int nDrivertype, int width, int height, int bits, bool fullscreen, bool stencilbuffer, bool vsync);
As you can see from the function prototype, I am created a new Irrlicht device using Direct3D9 driver, 640x480 res, with fullscreen off, stencil buffer on, and vsync off
*/
IrrLib Irrlicht(5, 640, 480, 16, false, true, false);
//if Irrlicht is the active window
// You don't have to use it, but your 'game' will still be running if the user alt tabs to word or something
//Lets create a loop until the Irrlicht device is stoped
while (Irrlicht.DeviceIsRunning())
if (Irrlicht.IsActiveWindow())
{
//grey background
Irrlicht.BeginScene();
//Tells Irrlicht to draw everything to the screen, GUI elements/3D-2D objects including spheres
Irrlicht.DrawAll();
//Tells Irrlicht that we are done drawing anything
Irrlicht.EndScene();
//If user hits escape, exit
//Note* Exit condition has to be done last else you will get a nonsense error from Irrlicht saying it couldn't draw.
if (Irrlicht.IrrEvent.keyStates[KEY_ESCAPE]){
Irrlicht.IrrEvent.keyStates[KEY_ESCAPE] = false;
Irrlicht.Exit();
}
//This demostrates setting a static window caption
Irrlicht.SetWindowCaption(L"Hello world, this is a fun game!");
}
//Our game is done, tell Irrlicht to clean up and exit
Irrlicht.EndIrrlicht();
return 0; //the deconstructor will delete all our dynamic vars so we don't have horriable memory leaks!
}
Examples/Example_4_WindowCaption/main_x.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#include <iostream>
#include "IrrLib.h"
#include <irrlicht.h>
using namespace std;
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
int main(){
IrrLib Irrlicht(5, 640, 480, 16, false, true, false);
while (Irrlicht.DeviceIsRunning())
if (Irrlicht.IsActiveWindow())
{
Irrlicht.BeginScene();
Irrlicht.DrawAll();
Irrlicht.EndScene();
if (Irrlicht.IrrEvent.keyStates[KEY_ESCAPE]){
Irrlicht.IrrEvent.keyStates[KEY_ESCAPE] = false;
Irrlicht.Exit();
}
std::string str = "IrrLib is cool!";
Irrlicht.SetWindowCaption(Irrlicht.stdstring_to_stringw(str));
}
Irrlicht.EndIrrlicht();
return 0;
}
----------------------
#include <iostream>
#include "IrrLib.h"
#include <irrlicht.h>
using namespace std;
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
int main(){
IrrLib Irrlicht(5, 640, 480, 16, false, true, false);
while (Irrlicht.DeviceIsRunning())
if (Irrlicht.IsActiveWindow())
{
Irrlicht.BeginScene();
Irrlicht.DrawAll();
Irrlicht.EndScene();
if (Irrlicht.IrrEvent.keyStates[KEY_ESCAPE]){
Irrlicht.IrrEvent.keyStates[KEY_ESCAPE] = false;
Irrlicht.Exit();
}
stringw str = L"Hello world, this is a fun game!";
Irrlicht.SetWindowCaption(str);
}
Irrlicht.EndIrrlicht();
return 0;
}
------------------------------------------------------
#include <iostream>
#include "IrrLib.h"
#include <irrlicht.h>
using namespace std;
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
int main(){
IrrLib Irrlicht(5, 640, 480, 16, false, true, false);
while (Irrlicht.DeviceIsRunning())
if (Irrlicht.IsActiveWindow())
{
Irrlicht.BeginScene();
Irrlicht.DrawAll();
Irrlicht.EndScene();
if (Irrlicht.IrrEvent.keyStates[KEY_ESCAPE]){
Irrlicht.IrrEvent.keyStates[KEY_ESCAPE] = false;
Irrlicht.Exit();
}
Irrlicht.SetWindowCaption(L"Hello world, this is a fun game!");
}
Irrlicht.EndIrrlicht();
return 0;
}
Examples/Example_5_Cursor/main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#include <iostream>
#include "IrrLib.h"
#include <irrlicht.h>
using namespace std;
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
int main(){
/*
Driver types:
0 = NULL
1 = EDT_SOFTWARE
2 = EDT_BURNINGSVIDEO
3 = EDT_OPENGL
4 = EDT_DIRECT3D8 *Note not supported by Microsoft anymore
5 = EDT_DIRECT3D9 *Reccommended
defualt = EDT_SOFTWARE
Note: Do not set vsync, last param, to true unless you want to slow down your
software. ie playing doom on a $5,000 gaming machine, would be wise to use vsync
in that senerio.
*/
//This is a non defualt constructor for the IrrLib
//Defualt uses software with 640x480 res and all settings to false
// You can declare a default Irrlicht like this:
// IrrLib Irrlicht;
/*
IrrLib::IrrLib(int nDrivertype, int width, int height, int bits, bool fullscreen, bool stencilbuffer, bool vsync);
As you can see from the function prototype, I am created a new Irrlicht device using Direct3D9 driver, 640x480 res, with fullscreen off, stencil buffer on, and vsync off
*/
IrrLib Irrlicht(5, 640, 480, 16, false, true, false);
//You only need one line to hide the mouse cursor if you want
Irrlicht.VisibleCursor(false);
//if Irrlicht is the active window
// You don't have to use it, but your 'game' will still be running if the user alt tabs to word or something
//Lets create a loop until the Irrlicht device is stoped
while (Irrlicht.DeviceIsRunning())
if (Irrlicht.IsActiveWindow())
{
//Default begin scene uses a grey background
Irrlicht.BeginScene();
//Tells Irrlicht to draw everything to the screen, GUI elements/3D-2D objects including spheres
Irrlicht.DrawAll();
//Tells Irrlicht that we are done drawing anything
Irrlicht.EndScene();
}
//Our game is done, tell Irrlicht to clean up and exit
Irrlicht.EndIrrlicht();
return 0; //the deconstructor will delete all our dynamic vars so we don't have horriable memory leaks!
}
Examples/Example_5_Cursor/main_x.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include <iostream>
#include "IrrLib.h"
#include <irrlicht.h>
using namespace std;
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
int main(){
IrrLib Irrlicht(5, 640, 480, 16, false, true, false);
Irrlicht.VisibleCursor(false);
while (Irrlicht.DeviceIsRunning())
if (Irrlicht.IsActiveWindow())
{
Irrlicht.BeginScene();
Irrlicht.DrawAll();
Irrlicht.EndScene();
}
Irrlicht.EndIrrlicht();
return 0;
}
Examples/Example_6_GameLoop/main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#include <iostream>
#include "IrrLib.h"
#include <irrlicht.h>
using namespace std;
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
int main(){
/*
Driver types:
0 = NULL
1 = EDT_SOFTWARE
2 = EDT_BURNINGSVIDEO
3 = EDT_OPENGL
4 = EDT_DIRECT3D8 *Note not supported by Microsoft anymore
5 = EDT_DIRECT3D9 *Reccommended
defualt = EDT_SOFTWARE
Note: Do not set vsync, last param, to true unless you want to slow down your
software. ie playing doom on a $5,000 gaming machine, would be wise to use vsync
in that senerio.
*/
//This is a non defualt constructor for the IrrLib
//Defualt uses software with 640x480 res and all settings to false
// You can declare a default Irrlicht like this:
// IrrLib Irrlicht;
/*
IrrLib::IrrLib(int nDrivertype, int width, int height, int bits, bool fullscreen, bool stencilbuffer, bool vsync);
As you can see from the function prototype, I am created a new Irrlicht device using Direct3D9 driver, 640x480 res, with fullscreen off, stencil buffer on, and vsync off
*/
IrrLib Irrlicht(5, 640, 480, 16, false, true, false);
//if Irrlicht is the active window
// You don't have to use it, but your 'game' will still be running if the user alt tabs to word or something
//Lets create a loop until the Irrlicht device is stoped
while (Irrlicht.DeviceIsRunning())
if (Irrlicht.IsActiveWindow())
{
//Lets start a game loop
//Default game loop is 30ms, you can also use:
/*
Irrlicht.CheckGameLoop(60);
*/
//To set a custom gameloop timer
if(Irrlicht.CheckGameLoop()){
//Default begin scene uses a grey background
Irrlicht.BeginScene();
//Tells Irrlicht to draw everything to the screen, GUI elements/3D-2D objects including spheres
Irrlicht.DrawAll();
//Tells Irrlicht that we are done drawing anything
Irrlicht.EndScene();
}
}
//Our game is done, tell Irrlicht to clean up and exit
Irrlicht.EndIrrlicht();
return 0; //the deconstructor will delete all our dynamic vars so we don't have horriable memory leaks!
}
Examples/Example_6_GameLoop/main_x.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include <iostream>
#include "IrrLib.h"
#include <irrlicht.h>
using namespace std;
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
int main(){
IrrLib Irrlicht(5, 640, 480, 16, false, true, false);
while (Irrlicht.DeviceIsRunning())
if (Irrlicht.IsActiveWindow())
{
if(Irrlicht.CheckGameLoop()){
Irrlicht.BeginScene();
Irrlicht.DrawAll();
Irrlicht.EndScene();
}
}
//Our game is done, tell Irrlicht to clean up and exit
Irrlicht.EndIrrlicht();
return 0; //the deconstructor will delete all our dynamic vars so we don't have horriable memory leaks!
}
Examples/Example_7_Spheres/main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#include <iostream>
#include "IrrLib.h"
#include <irrlicht.h>
using namespace std;
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
int main(){
/*
Driver types:
0 = NULL
1 = EDT_SOFTWARE
2 = EDT_BURNINGSVIDEO
3 = EDT_OPENGL
4 = EDT_DIRECT3D8 *Note not supported by Microsoft anymore
5 = EDT_DIRECT3D9 *Reccommended
defualt = EDT_SOFTWARE
If you are confused using the driver types consider using an enum:
//note you can name the drivers what ever you want, C++ will still number them correctly assuming they are in this order
enum IrrDriverType { NULL, EDT_SOFTWARE, EDT_BURNINGSVIDEO, EDT_OPENGL, EDT_DIRECT3D8, EDT_DIRECT3D9 };
IrrDriverType = EDT_DIRECT3D9;
//then pass IrrDriverType to Irrlicht constructor
IrrLib Irrlicht(IrrDriverType, 640, 480, 16, false, true, false);
Note: Do not set vsync, last param, to true unless you want to slow down your
software. ie playing doom on a $5,000 gaming machine, would be wise to use vsync
in that senerio.
*/
//This is a non defualt constructor for the IrrLib
//Defualt uses software with 640x480 res and all settings to false
// You can declare a default Irrlicht like this:
// IrrLib Irrlicht;
/*
IrrLib::IrrLib(int nDrivertype, int width, int height, int bits, bool fullscreen, bool stencilbuffer, bool vsync);
As you can see from the function prototype, I am created a new Irrlicht device using Direct3D9 driver, 640x480 res, with fullscreen off, stencil buffer on, and vsync off
*/
IrrLib Irrlicht(5, 640, 480, 16, false, true, false);
int sphere1 = Irrlicht.Irr3DLib.Sphere.CreateNewSphereNode(0, 0, 30, "../../media/wall.bmp", false);
int sphere2 = Irrlicht.Irr3DLib.Sphere.CreateNewSphereNode(0, 20, 40, "../../media/wall.bmp", false);
int sphere3 = Irrlicht.Irr3DLib.Sphere.CreateNewSphereNode(0, 0, 50, "../../media/wall.bmp", false);
//if Irrlicht is the active window
// You don't have to use it, but your 'game' will still be running if the user alt tabs to word or something
//Lets create a loop until the Irrlicht device is stoped
while (Irrlicht.DeviceIsRunning())
if (Irrlicht.IsActiveWindow())
{
//Default begin scene uses a grey background
Irrlicht.BeginScene();
//Tells Irrlicht to draw everything to the screen, GUI elements/3D-2D objects including spheres
Irrlicht.DrawAll();
//Tells Irrlicht that we are done drawing anything
Irrlicht.EndScene();
}
//Our game is done, tell Irrlicht to clean up and exit
Irrlicht.EndIrrlicht();
return 0; //the deconstructor will delete all our dynamic vars so we don't have horriable memory leaks!
}
Examples/Example_7_Spheres/main_x.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include <iostream>
#include "IrrLib.h"
#include <irrlicht.h>
using namespace std;
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
int main(){
IrrLib Irrlicht(5, 640, 480, 16, false, true, false);
int sphere1 = Irrlicht.Irr3DLib.Sphere.CreateNewSphereNode(0, 0, 30, "../../media/wall.bmp", false);
int sphere2 = Irrlicht.Irr3DLib.Sphere.CreateNewSphereNode(0, 20, 40, "../../media/wall.bmp", false);
int sphere3 = Irrlicht.Irr3DLib.Sphere.CreateNewSphereNode(0, 0, 50, "../../media/wall.bmp", false);
while (Irrlicht.DeviceIsRunning())
if (Irrlicht.IsActiveWindow())
{
Irrlicht.BeginScene();
Irrlicht.DrawAll();
Irrlicht.EndScene();
}
Irrlicht.EndIrrlicht();
return 0;
}
Examples/Example_8_Mouse/main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#include <iostream>
#include "IrrLib.h"
#include <irrlicht.h>
using namespace std;
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
int main(){
/*
Driver types:
0 = NULL
1 = EDT_SOFTWARE
2 = EDT_BURNINGSVIDEO
3 = EDT_OPENGL
4 = EDT_DIRECT3D8 *Note not supported by Microsoft anymore
5 = EDT_DIRECT3D9 *Reccommended
defualt = EDT_SOFTWARE
If you are confused using the driver types consider using an enum:
//note you can name the drivers what ever you want, C++ will still number them correctly assuming they are in this order
enum IrrDriverType { NULL, EDT_SOFTWARE, EDT_BURNINGSVIDEO, EDT_OPENGL, EDT_DIRECT3D8, EDT_DIRECT3D9 };
IrrDriverType = EDT_DIRECT3D9;
//then pass IrrDriverType to Irrlicht constructor
IrrLib Irrlicht(IrrDriverType, 640, 480, 16, false, true, false);
Note: Do not set vsync, last param, to true unless you want to slow down your
software. ie playing doom on a $5,000 gaming machine, would be wise to use vsync
in that senerio.
*/
//This is a non defualt constructor for the IrrLib
//Defualt uses software with 640x480 res and all settings to false
// You can declare a default Irrlicht like this:
// IrrLib Irrlicht;
/*
IrrLib::IrrLib(int nDrivertype, int width, int height, int bits, bool fullscreen, bool stencilbuffer, bool vsync);
As you can see from the function prototype, I am created a new Irrlicht device using Direct3D9 driver, 640x480 res, with fullscreen off, stencil buffer on, and vsync off
*/
IrrLib Irrlicht(5, 640, 480, 16, false, true, false);
//if Irrlicht is the active window
// You don't have to use it, but your 'game' will still be running if the user alt tabs to word or something
//Lets create a loop until the Irrlicht device is stoped
std::string cap;
while (Irrlicht.DeviceIsRunning())
if (Irrlicht.IsActiveWindow())
{
//IrrEvent class has 2 functions for mouse handling
//getMouseX() returns the X pos of the mouse as an int
//getMouseY() returns the Y pos of the mouse as an int
cap = "Mouse X = " + Irrlicht.int_to_string(Irrlicht.IrrEvent.getMouseX()) + " Mouse Y = " + Irrlicht.int_to_string(Irrlicht.IrrEvent.getMouseY());
Irrlicht.SetWindowCaption(Irrlicht.stdstring_to_stringw(cap));
//Default begin scene uses a grey background
Irrlicht.BeginScene();
//Tells Irrlicht to draw everything to the screen, GUI elements/3D-2D objects including spheres
Irrlicht.DrawAll();
//Tells Irrlicht that we are done drawing anything
Irrlicht.EndScene();
}
//Our game is done, tell Irrlicht to clean up and exit
Irrlicht.EndIrrlicht();
return 0; //the deconstructor will delete all our dynamic vars so we don't have horriable memory leaks!
}
Examples/Example_8_Mouse/main_x.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include <iostream>
#include "IrrLib.h"
#include <irrlicht.h>
using namespace std;
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
int main(){
IrrLib Irrlicht(5, 640, 480, 16, false, true, false);
std::string cap;
while (Irrlicht.DeviceIsRunning())
if (Irrlicht.IsActiveWindow())
{
cap = "Mouse X = " + Irrlicht.int_to_string(Irrlicht.IrrEvent.getMouseX()) + " Mouse Y = " + Irrlicht.int_to_string(Irrlicht.IrrEvent.getMouseY());
Irrlicht.SetWindowCaption(Irrlicht.stdstring_to_stringw(cap));
Irrlicht.BeginScene();
Irrlicht.DrawAll();
Irrlicht.EndScene();
}
Irrlicht.EndIrrlicht();
return 0;
}
Examples/Example_9_PictoDraw/main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#include <iostream>
#include "IrrLib.h"
#include <irrlicht.h>
using namespace std;
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
int main(){
IrrLib Irrlicht(5, 640, 480, 16, false, true, false);
//Create a variable to determine if we should draw under the mouse or not
bool draw = false;
//Screen caption
std::string cap;
//Future use of screen resolution
dimension2d<s32> res;
//Declare 2 mouse containters so we can find out if the user has moved the mouse
position2d<s32> mxy;
position2d<s32> lastmxy;
//This function returns the size of the window Irrlicht is currently using
res = Irrlicht.GetScreenSize();
//Set the caption
cap = "Height in pixels: " + Irrlicht.int_to_string(res.Height) + " Width in pixels: " + Irrlicht.int_to_string(res.Width);
Irrlicht.SetWindowCaption(Irrlicht.stdstring_to_stringw(cap));
while (Irrlicht.DeviceIsRunning())
if (Irrlicht.IsActiveWindow())
{
//I was in a Red color mood when I made this, you can chose from a varity of colors.
Irrlicht.BeginScene(Irrlicht.Color.RED);
//If the user hits the left mouse button
if (Irrlicht.IrrEvent.mouseStates[0])
{
//we need to set it to false so we don't detect it again
Irrlicht.IrrEvent.mouseStates[0] = false;
//The user clicked the mouse so we need to turn drawing on and record the mouse
//pos so we can find out later if they move the mouse
if (draw == false){
lastmxy.Y = Irrlicht.IrrEvent.getMouseY();
lastmxy.X = Irrlicht.IrrEvent.getMouseX();
draw = true;
}
else
//turn it off
draw = false;
}
//if drawing is on
if (draw)
{
//Get current mouse pos
mxy.Y = Irrlicht.IrrEvent.getMouseY();
mxy.X = Irrlicht.IrrEvent.getMouseX();
//If current mouse pos != last mouse pos then add the line to Irr2D's vector of lines
//So Irr2D will know how many lines to draw and where to draw them
//Also record this pos so we can compare it later
if (mxy != lastmxy){
Irrlicht.Irr2DLib.AddLines(lastmxy, mxy, Irrlicht.Color.GREEN);
lastmxy = mxy;
}
}
//This is new, this tells Irr2D to draw all lines that it has collected so far
Irrlicht.Irr2DLib.DrawLines();
//The usual stuff
Irrlicht.DrawAll();
Irrlicht.EndScene();
}
Irrlicht.EndIrrlicht();
return 0;
}
Examples/Example_9_PictoDraw/main_x.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#include <iostream>
#include "IrrLib.h"
#include <irrlicht.h>
using namespace std;
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
int main(){
IrrLib Irrlicht(5, 640, 480, 16, false, true, false);
bool draw = false;
std::string cap;
dimension2d<s32> res;
position2d<s32> mxy;
position2d<s32> lastmxy;
res = Irrlicht.GetScreenSize();
cap = "Height in pixels: " + Irrlicht.int_to_string(res.Height) + " Width in pixels: " + Irrlicht.int_to_string(res.Width);
Irrlicht.SetWindowCaption(Irrlicht.stdstring_to_stringw(cap));
while (Irrlicht.DeviceIsRunning())
if (Irrlicht.IsActiveWindow())
{
Irrlicht.BeginScene(Irrlicht.Color.RED);
if (Irrlicht.IrrEvent.mouseStates[0])
{
Irrlicht.IrrEvent.mouseStates[0] = false;
if (draw == false){
lastmxy.Y = Irrlicht.IrrEvent.getMouseY();
lastmxy.X = Irrlicht.IrrEvent.getMouseX();
draw = true;
}
else
draw = false;
}
if (draw)
{
mxy.Y = Irrlicht.IrrEvent.getMouseY();
mxy.X = Irrlicht.IrrEvent.getMouseX();
if (mxy != lastmxy){
Irrlicht.Irr2DLib.AddLines(lastmxy, mxy, Irrlicht.Color.GREEN);
lastmxy = mxy;
}
}
Irrlicht.Irr2DLib.DrawLines();
Irrlicht.DrawAll();
Irrlicht.EndScene();
}
Irrlicht.EndIrrlicht();
return 0;
}
Old Versions/1.1/IrrLib.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Version 1.1
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include "IrrLib.h"
#include <irrlicht.h>
#include <strings.h>
#include "IrrSphere.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
//TODO: Create own class for handling inputs!
/*IrrLib::IrrLib(MastEventReceiver & receiver){
this->device = createDevice(EDT_SOFTWARE, dimension2d<s32>(640, 480), 16, false, false, false, &receiver);
if (this->device == 0)
exit(1);
IrrLib::Init();
}*/
IrrLib::IrrLib(){
this->device = createDevice(EDT_SOFTWARE, dimension2d<s32>(640, 480), 16, false, false, false, 0);
if (this->device == 0)
exit(1);
IrrLib::Init();
}
IrrLib::IrrLib(video::E_DRIVER_TYPE drivertype, core::dimension2d<s32> & res, u32 bits, bool fullscreen, bool stencilbuffer, bool vsync){
//MyEventReceiver receiver;
this->device = createDevice(drivertype, res, bits, fullscreen, stencilbuffer, vsync, 0);
if (this->device == 0)
exit(1);
IrrLib::Init();
}
IrrLib::IrrLib(int nDrivertype, int width, int height, int bits, bool fullscreen, bool stencilbuffer, bool vsync){
//MyEventReceiver receiver;
video::E_DRIVER_TYPE drivertype;
switch (nDrivertype){
case 0: //TODO: finish this switch case
drivertype = EDT_NULL;
break;
case 1:
drivertype = EDT_SOFTWARE;
break;
case 2:
drivertype = EDT_BURNINGSVIDEO;
break;
case 3:
drivertype = EDT_OPENGL;
break;
case 4:
drivertype = EDT_DIRECT3D8;
//TODO: Find how to detect if DX is complied into Irrlicht
//TODO: Find how to detecht for linux
break;
case 5:
drivertype = EDT_DIRECT3D9;
break;
default:
drivertype = EDT_SOFTWARE;
break;
}
this->device = createDevice(drivertype, dimension2d<s32>(width, height), bits, fullscreen, stencilbuffer, vsync, 0);
if (this->device == 0)
exit(1);
IrrLib::Init();
}
IrrLib::~IrrLib (){ //Our moms wont clean up after us!
//Although I'm sure Irrlicht does this for us already, its always a good idea to check!
/*if (this->device != NULL)
delete this->device;
if (this->driver != NULL)
delete this->driver;
if (this->smgr != NULL)
delete this->smgr;
if (this->mesh != NULL)
delete this->mesh;
if (this->node != NULL)
delete this->node;*/ //it seems Irrlicht picks up after us...
//however we created newNodes, now we need to delete it!
}
void IrrLib::Init(){
//this->numNodes = 0;
//this->nodeNew = new ISceneNode[10];
this->driver = this->device->getVideoDriver();
this->smgr = this->device->getSceneManager();
Sphere.SetSmgr(this->smgr);
Sphere.SetDriver(this->driver);
}
void IrrLib::ReadArchive(std::string file){
this->device->getFileSystem()->addZipFileArchive(file.c_str());
}
void IrrLib::LoadQ3Level(std::string q3level){
this->mesh = this->smgr->getMesh(q3level.c_str());
this->node = 0;
if (this->mesh)
this->node = this->smgr->addOctTreeSceneNode(this->mesh->getMesh(0), 0, -1, 128);
}
void IrrLib::NodePos(int x, int y, int z){
if (this->node)
this->node->setPosition(core::vector3df(x, y, z));
}
void IrrLib::NodePos(){
if (this->node)
this->node->setPosition(core::vector3df(0, 0, 0));
}
void IrrLib::AddFPSCam(){
this->cam = this->smgr->addCameraSceneNodeFPS();
}
void IrrLib::AddFPSCam(f32 x, f32 y, f32 z)
{
this->cam = this->smgr->addCameraSceneNodeFPS();
this->cam->setPosition(irr::core::vector3df(x, y, z));
}
void IrrLib::VisibleCursor(bool tf){
if (tf == false)
this->device->getCursorControl()->setVisible(false);
else
this->device->getCursorControl()->setVisible(true);
}
int IrrLib::GetFPSCount(){
return this->driver->getFPS();
}
bool IrrLib::DeviceIsRunning(){
return this->device->run();
}
bool IrrLib::IsActiveWindow(){
return this->device->isWindowActive();
}
void IrrLib::BeginScene(){
this->driver->beginScene(true, true, video::SColor(0,200,200,200));
}
void IrrLib::BeginScene(irr::video::SColor color){
this->driver->beginScene(true, true, color);
}
void IrrLib::BeginScene(bool usebackBuffer, bool usezBuffer, irr::video::SColor color){
this->driver->beginScene(usebackBuffer, usezBuffer, color);
}
void IrrLib::DrawAll(){
this->smgr->drawAll();
//this->device->getGUIEnvironment()->drawAll();
}
void IrrLib::EndScene(){
this->driver->endScene();
}
void IrrLib::SetWindowCaption(stringw str){
this->device->setWindowCaption(str.c_str());
}
irr::core::stringw IrrLib::GetDriverName(){
return this->driver->getName();
}
void IrrLib::EndIrrlicht(){
this->device->drop();
}
void IrrLib::KeyPress(char key){
this->key = key;
}
char IrrLib::KeyPressed(){
return key;
}
Old Versions/1.1/IrrLib.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Version 1.1
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRLIB_H
#define IRRLIB_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
#include "IrrSphere.h"
//Start class
class IrrLib {
private:
/* Create an Irrlicht device as private because the class should handle
All irrlicht interaction */
irr::IrrlichtDevice *device;
// Tells Irrlicht what driver to use
//video::E_DRIVER_TYPE driverType;
/*
Get a pointer to the video driver and the SceneManager so that
we do not always have to write device->getVideoDriver() and
device->getSceneManager().
*/
irr::video::IVideoDriver* driver;
irr::scene::ISceneManager* smgr;
/*
Get a pointer to the 'mesh' aka the level.
Note: This is for Quake3 levels, ie bsp maps.
*/
irr::scene::IAnimatedMesh* mesh;
irr::scene::ISceneNode* node;
irr::scene::ISceneNode * tempNode; //use this to store nodeNew's data so we can resize it
irr::scene::ICameraSceneNode * cam;
char key;
void IrrLib::Init();
public:
IrrSphere Sphere; //This has to be public to be able to access the Sphere class
IrrLib::IrrLib();
//IrrLib::IrrLib(MastEventReceiver & receiver);
IrrLib::IrrLib(irr::video::E_DRIVER_TYPE drivertype, irr::core::dimension2d<irr::s32> & res, irr::u32 bits, bool fullscreen, bool stencilbuffer, bool vsync);
IrrLib::IrrLib(int drivertype, int width, int height, int bits, bool fullscreen, bool stencilbuffer, bool vsync);
IrrLib::~IrrLib(); //Our moms wont clean up after us!
void IrrLib::ReadArchive(std::string file);
void IrrLib::LoadQ3Level(std::string q3level);
void IrrLib::NodePos(int x, int y, int z); //I think this moves the actual camera?
void IrrLib::NodePos();
void IrrLib::AddFPSCam();
void IrrLib::AddFPSCam(irr::f32 x, irr::f32 y, irr::f32 z);
void IrrLib::VisibleCursor(bool tf);
int IrrLib::GetFPSCount();
bool IrrLib::DeviceIsRunning();
bool IrrLib::IsActiveWindow();
void IrrLib::BeginScene();
void IrrLib::BeginScene(irr::video::SColor color);
void IrrLib::BeginScene(bool usebackBuffer, bool usezBuffer, irr::video::SColor color);
//TODO: Add one more for human readable colors and hex colors!
void IrrLib::DrawAll();
void IrrLib::EndScene();
void IrrLib::SetWindowCaption(irr::core::stringw str);
irr::core::stringw IrrLib::GetDriverName();
//TODO: Make function to turn stringw to string and visa versa
void IrrLib::EndIrrlicht(); //Renamed from KillIrrlicht to EndIrrlicht
//TODO: Add logging
void IrrLib::KeyPress(char key);
char IrrLib::KeyPressed();
};
#endif
Old Versions/1.1/IrrSphere.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Version 1.1
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include "IrrLib.h"
#include "IrrSphere.h"
#include <irrlicht.h>
#include <strings.h>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
void IrrSphere::SetSmgr(irr::scene::ISceneManager* smgr){
this->smgr = smgr;
}
void IrrSphere::SetDriver(irr::video::IVideoDriver* driver){
this->driver = driver;
}
int IrrSphere::CreateNewSphereNode(int x, int y, int z, std::string texture, bool light){
//TODO: Resize after 10, and add 10 more to the mix!
this->nodeNew[this->numNodes] = this->smgr->addSphereSceneNode();
this->nodeNew[this->numNodes]->setPosition(core::vector3df(x,y,z));
this->nodeNew[this->numNodes]->setMaterialTexture(0, this->driver->getTexture(texture.c_str()));
this->nodeNew[this->numNodes]->setMaterialFlag(video::EMF_LIGHTING, light);
this->numNodes++;
return this->numNodes--;
/*this->node = this->smgr->addSphereSceneNode();
this->node->setPosition(core::vector3df(x,y,z));
this->node->setMaterialTexture(0, this->driver->getTexture(texture.c_str()));
this->node->setMaterialFlag(video::EMF_LIGHTING, light);*/
}
irr::core::vector3df IrrSphere::GetSphereVector(int sphere){
return this->nodeNew[sphere]->getPosition();
}
void IrrSphere::SetSphereVector(int sphere, irr::core::vector3df v){
this->nodeNew[sphere]->setPosition(v);
}
IrrSphere::IrrSphere(){
this->numNodes = 0;
}
IrrSphere::~IrrSphere(){
for(int i = 0; i < numNodes; ++i)
delete this->nodeNew[i];
delete this->nodeNew;
}
Old Versions/1.1/IrrSphere.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Version 1.1
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRSPHERE_H
#define IRRSPHERE_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
#include "IrrLib.h"
class IrrSphere
{
private:
irr::scene::ISceneNode* nodeNew[10];
int numNodes;
irr::scene::ISceneManager* smgr;
irr::video::IVideoDriver* driver;
public:
void IrrSphere::SetDriver(irr::video::IVideoDriver* driver);
void IrrSphere::SetSmgr(irr::scene::ISceneManager* smgr);
int IrrSphere::CreateNewSphereNode(int x, int y, int z, std::string texture, bool light); //this is going to take my advanced C++ skillz!
irr::core::vector3df IrrSphere::GetSphereVector(int sphere);
void IrrSphere::SetSphereVector(int sphere, irr::core::vector3df v);
IrrSphere::IrrSphere();
IrrSphere::~IrrSphere();
};
#endif
Old Versions/1.2/CHANGES
1
2
3
4
5
Version 1.2
+ Added a Irr3DLib class that will control all 3D objects
+ Also Added a Irr2D class that works on the same concept.
+ IrrSphere is now owned by Irr3DLib
+ Updated the examples using the latest code
Old Versions/1.2/Irr2D.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include "IrrLib.h"
//#include "IrrSphere.h" //You probably aren't going to be using 3D objects in a 2D environment!
#include "Irr2D.h"
#include <irrlicht.h>
#include <strings.h>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
Irr2D::Irr2D(){
this->numTextures = 0;
//NA Should we set textures to new
}
Irr2D::~Irr2D(){
for(int i = 0; i < numTextures; ++i)
delete this->textures[i];
delete this->textures;
}
void Irr2D::SetSmgr(irr::scene::ISceneManager* smgr){
this->smgr = smgr;
Sprite.SetSmgr(smgr);
}
void Irr2D::SetDriver(irr::video::IVideoDriver* driver){
this->driver = driver;
Sprite.SetDriver(driver);
}
void Irr2D::LoadTexturemap(std::string file){
this->texturemap = driver->getTexture(file.c_str());
}
int Irr2D::LoadTexture(std::string file){
this->textures[this->numTextures] = driver->getTexture(file.c_str());
this->numTextures++;
return numTextures--;
}
Old Versions/1.2/Irr2D.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRR2D_H
#define IRR2D_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
#include "IrrLib.h"
#include "IrrSprite.h"
class Irr2D {
private:
irr::scene::ISceneManager* smgr;
irr::video::IVideoDriver* driver;
irr::video::ITexture* texturemap;
int numTextures;
irr::video::ITexture* textures[10];
public:
//Irr2D::Irr2D();
IrrSprite Sprite;
Irr2D::Irr2D();
Irr2D::~Irr2D();
void Irr2D::SetDriver(irr::video::IVideoDriver* driver);
void Irr2D::SetSmgr(irr::scene::ISceneManager* smgr);
void Irr2D::LoadTexturemap(std::string file);
int Irr2D::LoadTexture(std::string file);
void Irr2D::DrawImage(int texture, const irr::core::position2d<irr::s32> & destPos);
void Irr2D::DrawImage(const irr::core::position2d<irr::s32> & destPos, const irr::core::rect<irr::s32> & sourceRect, const irr::core::rect<irr::s32> * clipRect, irr::video::SColor color, bool useAlphaChannelOfTexture);
void Irr2D::DrawLine(const irr::core::position2d<irr::s32> & start, const irr::core::position2d<irr::s32> & end, irr::video::SColor color);
};
#endif
Old Versions/1.2/Irr3D.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <strings.h>
//#include "IrrLib.h"
//Libraries we create go here
#include "IrrSphere.h"
//#include "IrrColor.h"
#include "Irr3D.h"
#include <irrlicht.h>
//#include "Irr2D.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
void Irr3D::SetDriver(irr::video::IVideoDriver* driver) //so much for copying and pasting code from the header file
{
this->driver = driver;
Sphere.SetDriver(driver);
}
void Irr3D::SetSmgr(irr::scene::ISceneManager* smgr)
{
this->smgr = smgr;
Sphere.SetSmgr(smgr);
}
Irr3D::Irr3D()
{
//do stuff here!
}
Irr3D::~Irr3D()
{
//delete stuff here!
}
Old Versions/1.2/Irr3D.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRR3D_H
#define IRR3D_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
#include "IrrSphere.h"
//#include "IrrColor.h"
//#include "Irr3D.h"
//#include "Irr2D.h" This is a 3D class not 2D
/* However due to Irrlciht's nature mixing 2D with 3D is possible */
//Start class
class Irr3D {
private:
irr::video::IVideoDriver* driver;
irr::scene::ISceneManager* smgr;
public:
IrrSphere Sphere;
Irr3D::Irr3D();
Irr3D::~Irr3D();
void Irr3D::SetDriver(irr::video::IVideoDriver* driver);
void Irr3D::SetSmgr(irr::scene::ISceneManager* smgr);
};
#endif
Old Versions/1.2/IrrColor.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <irrlicht.h>
#include <strings.h>
//#include "IrrLib.h"
#include "IrrColor.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
void IrrColor::test(){
//do nothing
}
SColor IrrColor::returnColor(std::string color){
int nColor = -1;
if (color == "red")
nColor = 1;
else if (color == "green")
nColor = 2;
else if (color == "blue")
nColor = 3;
else if (color == "dark green")
nColor = 4;
else if (color == "pink")
nColor = 5;
else if (color == "grey")
nColor = 6;
switch (nColor){
case 1:
return SColor(255, 255, 0, 0);
break;
case 2:
return SColor(255, 0, 255, 0);
break;
case 3:
return SColor(255, 0, 0, 255);
break;
case 4:
return SColor(255, 0, 50, 0);
break;
case 5:
return SColor(255, 255, 10, 255);
break;
case 6:
return SColor(255,200,200,200);
break;
default:
return SColor(255,200,200,200);
break;
}// TODO: Make this function modular
}
Old Versions/1.2/IrrColor.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRCOLOR_H
#define IRRCOLOR_H
#include <iostream>
#include <strings.h>
#include "irrlicht.h"
//#include "IrrLib.h"
class IrrColor {
private:
//who knows?
public:
void IrrColor::test();
irr::video::SColor IrrColor::returnColor(std::string color);
};
#endif
Old Versions/1.2/IrrLib.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <irrlicht.h>
#include <strings.h>
#include "IrrLib.h"
//Libraries we create go here
//#include "IrrSphere.h"
#include "IrrColor.h"
#include "Irr2D.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
//TODO: Create own class for handling inputs!
/*IrrLib::IrrLib(MastEventReceiver & receiver){
this->device = createDevice(EDT_SOFTWARE, dimension2d<s32>(640, 480), 16, false, false, false, &receiver);
if (this->device == 0)
exit(1);
IrrLib::Init();
}*/
IrrLib::IrrLib(){
this->device = createDevice(EDT_SOFTWARE, dimension2d<s32>(640, 480), 16, false, false, false, 0);
if (this->device == 0)
exit(1);
IrrLib::Init();
}
IrrLib::IrrLib(video::E_DRIVER_TYPE drivertype, core::dimension2d<s32> & res, u32 bits, bool fullscreen, bool stencilbuffer, bool vsync){
//MyEventReceiver receiver;
this->device = createDevice(drivertype, res, bits, fullscreen, stencilbuffer, vsync, 0);
if (this->device == 0)
exit(1);
IrrLib::Init();
}
IrrLib::IrrLib(int nDrivertype, int width, int height, int bits, bool fullscreen, bool stencilbuffer, bool vsync){
//MyEventReceiver receiver;
video::E_DRIVER_TYPE drivertype;
switch (nDrivertype){
case 0: //TODO: finish this switch case
drivertype = EDT_NULL;
break;
case 1:
drivertype = EDT_SOFTWARE;
break;
case 2:
drivertype = EDT_BURNINGSVIDEO;
break;
case 3:
drivertype = EDT_OPENGL;
break;
case 4:
drivertype = EDT_DIRECT3D8;
//*Note: It seems as Microsoft has stoped supporting DX 8.1, so you can not compile it into Irrlicht engine anymore
//TODO: Find how to detect if DX is complied into Irrlicht
//TODO: Find how to detecht for linux
break;
case 5:
drivertype = EDT_DIRECT3D9;
break;
default:
drivertype = EDT_SOFTWARE;
break;
}
this->device = createDevice(drivertype, dimension2d<s32>(width, height), bits, fullscreen, stencilbuffer, vsync, 0);
if (this->device == 0)
exit(1);
IrrLib::Init();
}
IrrLib::~IrrLib (){ //Our moms wont clean up after us!
//Although I'm sure Irrlicht does this for us already, its always a good idea to check!
/*if (this->device != NULL)
delete this->device;
if (this->driver != NULL)
delete this->driver;
if (this->smgr != NULL)
delete this->smgr;
if (this->mesh != NULL)
delete this->mesh;
if (this->node != NULL)
delete this->node;*/ //it seems Irrlicht picks up after us...
//however we created newNodes, now we need to delete it!
}
void IrrLib::Init(){
//this->numNodes = 0;
//this->nodeNew = new ISceneNode[10];
this->driver = this->device->getVideoDriver();
this->smgr = this->device->getSceneManager();
Irr3DLib.SetSmgr(this->smgr);
Irr3DLib.SetDriver(this->driver);
Irr2DLib.SetSmgr(this->smgr);
Irr2DLib.SetDriver(this->driver);
}
void IrrLib::ReadArchive(std::string file){
this->device->getFileSystem()->addZipFileArchive(file.c_str());
}
void IrrLib::LoadQ3Level(std::string q3level){
this->mesh = this->smgr->getMesh(q3level.c_str());
this->node = 0;
if (this->mesh)
this->node = this->smgr->addOctTreeSceneNode(this->mesh->getMesh(0), 0, -1, 128);
}
void IrrLib::MapPos(int x, int y, int z){
if (this->node)
this->node->setPosition(core::vector3df(x, y, z));
}
void IrrLib::MapPos(){
if (this->node)
this->node->setPosition(core::vector3df(0, 0, 0));
}
void IrrLib::AddFPSCam(){
this->cam = this->smgr->addCameraSceneNodeFPS();
}
void IrrLib::AddFPSCam(f32 x, f32 y, f32 z)
{
this->cam = this->smgr->addCameraSceneNodeFPS();
this->cam->setPosition(irr::core::vector3df(x, y, z));
}
void IrrLib::VisibleCursor(bool tf){
if (tf == false)
this->device->getCursorControl()->setVisible(false);
else
this->device->getCursorControl()->setVisible(true);
}
int IrrLib::GetFPSCount(){
return this->driver->getFPS();
}
bool IrrLib::DeviceIsRunning(){
return this->device->run();
}
bool IrrLib::IsActiveWindow(){
return this->device->isWindowActive();
}
void IrrLib::BeginScene(){
this->driver->beginScene(true, true, video::SColor(0,200,200,200));
}
void IrrLib::BeginScene(irr::video::SColor color){
this->driver->beginScene(true, true, color);
}
void IrrLib::BeginScene(bool usebackBuffer, bool usezBuffer, irr::video::SColor color){
this->driver->beginScene(usebackBuffer, usezBuffer, color);
}
void IrrLib::DrawAll(){
this->smgr->drawAll();
//this->device->getGUIEnvironment()->drawAll();
}
void IrrLib::EndScene(){
this->driver->endScene();
}
void IrrLib::SetWindowCaption(stringw str){
this->device->setWindowCaption(str.c_str());
}
irr::core::stringw IrrLib::GetDriverName(){
return this->driver->getName();
}
void IrrLib::EndIrrlicht(){
this->device->drop();
}
void IrrLib::KeyPress(char key){
this->key = key;
}
char IrrLib::KeyPressed(){
return key;
}
irr::f32 IrrLib::getX(){
return this->smgr->getActiveCamera()->getPosition().X;
}
irr::f32 IrrLib::getY(){
return this->smgr->getActiveCamera()->getPosition().Y;
}
irr::f32 IrrLib::getZ(){
return this->smgr->getActiveCamera()->getPosition().Z;
}
Old Versions/1.2/IrrLib.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRLIB_H
#define IRRLIB_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
#include "Irr3D.h"
#include "IrrColor.h"
#include "Irr2D.h"
//Start class
class IrrLib {
private:
/* Create an Irrlicht device as private because the class should handle
All irrlicht interaction */
irr::IrrlichtDevice *device;
// Tells Irrlicht what driver to use
//video::E_DRIVER_TYPE driverType;
/*
Get a pointer to the video driver and the SceneManager so that
we do not always have to write device->getVideoDriver() and
device->getSceneManager().
*/
irr::video::IVideoDriver* driver;
irr::scene::ISceneManager* smgr;
/*
Get a pointer to the 'mesh' aka the level.
Note: This is for Quake3 levels, ie bsp maps.
*/
irr::scene::IAnimatedMesh* mesh;
irr::scene::ISceneNode* node;
irr::scene::ISceneNode * tempNode; //use this to store nodeNew's data so we can resize it
irr::scene::ICameraSceneNode * cam;
char key;
void IrrLib::Init();
/*friend class IrrColor;
friend class Irr2DLib;
friend class Sphere;*/
public:
//IrrSphere Sphere; //This has to be public to be able to access the Sphere class
/* IrrSphere is now in Irr3D class */
//Prehaps put this into a IrrLib3D class?
Irr3D Irr3DLib;
IrrColor Color; //Color class...not much of a class but lets keep it OO
Irr2D Irr2DLib; //1/2 variable to be labeled like this due to variables not able to begin with a number
IrrLib::IrrLib();
//IrrLib::IrrLib(MastEventReceiver & receiver);
IrrLib::IrrLib(irr::video::E_DRIVER_TYPE drivertype, irr::core::dimension2d<irr::s32> & res, irr::u32 bits, bool fullscreen, bool stencilbuffer, bool vsync);
IrrLib::IrrLib(int drivertype, int width, int height, int bits, bool fullscreen, bool stencilbuffer, bool vsync);
IrrLib::~IrrLib(); //Our moms wont clean up after us!
void IrrLib::ReadArchive(std::string file);
void IrrLib::LoadQ3Level(std::string q3level);
void IrrLib::MapPos(int x, int y, int z); //I think this moves the actual camera?
void IrrLib::MapPos();
void IrrLib::AddFPSCam();
void IrrLib::AddFPSCam(irr::f32 x, irr::f32 y, irr::f32 z);
void IrrLib::VisibleCursor(bool tf);
int IrrLib::GetFPSCount();
bool IrrLib::DeviceIsRunning();
bool IrrLib::IsActiveWindow();
void IrrLib::BeginScene();
void IrrLib::BeginScene(irr::video::SColor color);
void IrrLib::BeginScene(bool usebackBuffer, bool usezBuffer, irr::video::SColor color);
//TODO: Add one more for human readable colors and hex colors!
void IrrLib::DrawAll();
void IrrLib::EndScene();
void IrrLib::SetWindowCaption(irr::core::stringw str);
irr::core::stringw IrrLib::GetDriverName();
//TODO: Make function to turn stringw to string and visa versa
void IrrLib::EndIrrlicht(); //Renamed from KillIrrlicht to EndIrrlicht
//TODO: Add logging
void IrrLib::KeyPress(char key);
char IrrLib::KeyPressed();
irr::f32 getX();
irr::f32 getY();
irr::f32 getZ();
};
#endif
Old Versions/1.2/IrrLibBase.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <irrlicht.h>
#include "IrrLibBase.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
void IrrLibBase::SetDriver(IVideoDriver* driver) //can be overloaded
{
this->driver = driver;
}
void IrrLibBase::SetSmgr(ISceneManager* smgr)
{
this->smgr = smgr;
}
Old Versions/1.2/IrrLibBase.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRLIBBASE_H
#define IRRLIBBASE_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
class IrrLibBase {
protected:
irr::video::IVideoDriver* driver;
irr::scene::ISceneManager* smgr;
public:
void IrrLibBase::SetDriver(irr::video::IVideoDriver* driver);
void IrrLibBase::SetSmgr(irr::scene::ISceneManager* smgr);
};
#endif
Old Versions/1.2/IrrLibGUI.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <strings.h>
#include <irrlicht.h>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
IrrLibGUI::IrrLibGUI()
{
//NA does it need to do anything at init?
this->nStaticText = 0;
this->env = device->getGUIEnvironment(); //NA yes we do!
}
IrrLibGUI::~IrrLibGUI()
{
//NA Do we have to delete anything?
}
IrrLibGUI::Clear()
{
this->env->clear();
}
IrrLibGUI::DrawAll()
{
this->env->drawAll();
}
IrrLibGUI::AddStaticText()
{
this->env->addStaticText(L"Powered by IrrLib.", rect<s32>(0,0,0,0), true);
}
IrrLibGUI::AddStaticText(std::string message)
{
this->env->addStaticText(message.c_str(), rect<s32>(0,0,0,0), true);
}
IrrLibGUI::AddStaticText(std::string message, int x1, int y1, int x2, int y2)
{
this->env->addStaticText(message.c_str(), rect<s32>(x1,y1,x2,y2), true);
}
IrrLibGUI::AddStaticText(std::string message, int x1, int y1, int x2, int y2, bool border, bool wordwrap)
{
this->env->addStaticText(message.c_str(), rect<s32>(x1,y1,x2,y2), border, wordwrap);
}
IrrLibGUI::AddStaticText(std::string message, int x1, int y1, int x2, int y2, bool border, bool wordwrap, int id, bool fillbackground)
{
this->env->addStaticText(message.c_str(), rect<s32>(x1,y1,x2,y2), border, wordwrap, 0, id, fillbackground);
}
IrrLibGUI::AddStaticText(std::string message, const core::rect< s32 > &rectangle)
{
this->env->addStaticText(message.c_str(), rectangle);
}
IrrLibGUI::AddStaticText(std::string message, const core::rect< s32 > &rectangle, bool border, bool wordwrap)
{
this->env->addStaticText(message.c_str(), rectangle, border, wordwrap);
}
IrrLibGUI::AddStaticText(std::string message, const core::rect< s32 > &rectangle, bool border, bool wordwrap, int id, bool fillbackground)
{
this->env->addStaticText(message.c_str(), rectangle, border, wordwrap, 0, id, background);
}
Old Versions/1.2/IrrLibGUI.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRLIBGUI_H
#define IRRLIBGUI_H
#include <iostream>
#include <strings.h>
#include <irrlicht.h>
#include "IrrLibBase.h"
class IrrLibGUI: public IrrLibBase {
private:
irr::gui::IGUISkin* skin;
irr::gui::IGUIFont* font;
irr::gui::IGUIEnvironment* env = device->getGUIEnvironment();
//TODO: Create an array storing all messages
int nStaticText;
irr::gui::IGUIStaticText* arrStaticText[10];
public:
IrrLibGUI::IrrLibGUI();
IrrLibGUI::~IrrLibGUI();
IrrLibGUI::Clear();
IrrLibGUI::DrawAll();
IrrLibGUI::AddStaticText(); //NA eh a default text adder why not?
IrrLibGUI::AddStaticText(std::string message);
IrrLibGUI::AddStaticText(std::string message, int x1, int y1, int x2, int y2);
IrrLibGUI::AddStaticText(std::string message, int x1, int y1, int x2, int y2, bool border, bool wordwrap);
IrrLibGUI::AddStaticText(std::string message, int x1, int y1, int x2, int y2, bool border, bool wordwrap, int id, bool fillbackground);
IrrLibGUI::AddStaticText(std::string message, const irr::core::rect< s32 > &rectangle);
IrrLibGUI::AddStaticText(std::string message, const irr::core::rect< s32 > &rectangle, bool border, bool wordwrap);
IrrLibGUI::AddStaticText(std::string message, const irr::core::rect< s32 > &rectangle, bool border, bool wordwrap, int id, bool fillbackground);
#endif
Old Versions/1.2/IrrSphere.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include "IrrLib.h"
#include "IrrSphere.h"
#include <irrlicht.h>
#include <strings.h>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
void IrrSphere::SetSmgr(irr::scene::ISceneManager* smgr){
this->smgr = smgr;
}
void IrrSphere::SetDriver(irr::video::IVideoDriver* driver){
this->driver = driver;
}
int IrrSphere::CreateNewSphereNode(int x, int y, int z, std::string texture, bool light){
//TODO: Resize after 10, and add 10 more to the mix!
this->nodeNew[this->numNodes] = this->smgr->addSphereSceneNode();
this->nodeNew[this->numNodes]->setPosition(core::vector3df(x,y,z));
this->nodeNew[this->numNodes]->setMaterialTexture(0, this->driver->getTexture(texture.c_str()));
this->nodeNew[this->numNodes]->setMaterialFlag(video::EMF_LIGHTING, light);
this->numNodes++;
return this->numNodes--;
/*this->node = this->smgr->addSphereSceneNode();
this->node->setPosition(core::vector3df(x,y,z));
this->node->setMaterialTexture(0, this->driver->getTexture(texture.c_str()));
this->node->setMaterialFlag(video::EMF_LIGHTING, light);*/
}
irr::core::vector3df IrrSphere::GetSphereVector(int sphere){
return this->nodeNew[sphere]->getPosition();
}
void IrrSphere::SetSphereVector(int sphere, irr::core::vector3df v){
this->nodeNew[sphere]->setPosition(v);
}
IrrSphere::IrrSphere(){
this->numNodes = 0;
}
IrrSphere::~IrrSphere(){
for(int i = 0; i < numNodes; ++i)
delete this->nodeNew[i];
delete this->nodeNew;
}
Old Versions/1.2/IrrSphere.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRSPHERE_H
#define IRRSPHERE_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
//#include "IrrLib.h"
class IrrSphere
{
private:
irr::scene::ISceneNode* nodeNew[10];
int numNodes;
irr::scene::ISceneManager* smgr;
irr::video::IVideoDriver* driver;
public:
void IrrSphere::SetDriver(irr::video::IVideoDriver* driver);
void IrrSphere::SetSmgr(irr::scene::ISceneManager* smgr);
int IrrSphere::CreateNewSphereNode(int x, int y, int z, std::string texture, bool light); //this is going to take my advanced C++ skillz!
irr::core::vector3df IrrSphere::GetSphereVector(int sphere);
void IrrSphere::SetSphereVector(int sphere, irr::core::vector3df v);
IrrSphere::IrrSphere();
//IrrSphere::IrrSphere(IrrLib*);
IrrSphere::~IrrSphere();
};
#endif
Old Versions/1.2/IrrSprite.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <irrlicht.h>
#include <strings.h>
#include "IrrLib.h"
//Libraries we create go here
#include "IrrSphere.h"
#include "IrrColor.h"
#include "Irr2D.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
IrrSprite::IrrSprite()
{
//do stuff
}
IrrSprite::~IrrSprite()
{
//delete stuff
}
void IrrSprite::SetDriver(irr::video::IVideoDriver* driver)
{
this->driver = driver;
}
void IrrSprite::SetSmgr(irr::scene::ISceneManager* smgr)
{
this->smgr = smgr;
}
Old Versions/1.2/IrrSprite.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRSPRITE_H
#define IRRSPRITE_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
#include "IrrSphere.h"
#include "IrrColor.h"
#include "Irr2D.h"
#include "IrrSprite.h"
//Start class
class IrrSprite {
private:
irr::video::IVideoDriver* driver;
irr::scene::ISceneManager* smgr;
public:
IrrSprite::IrrSprite();
IrrSprite::~IrrSprite();
void IrrSprite::SetDriver(irr::video::IVideoDriver* driver);
void IrrSprite::SetSmgr(irr::scene::ISceneManager* smgr);
// I forgot a semicolon here....and it wasn't compling
//Thats 1 bad thing about OOP if there is an error you don't know where the @#$@# the problem is!
};
#endif
Old Versions/1.2/README
1
2
3
4
5
6
7
8
9
10
11
12
13
Irrlicht Library Wrapper
Created by Nathan Adams
Version 1.2
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
Please leave all files intact if you redistrubte this software.
How to use:
Add all the files to your Irrlicht project, you could compile it into a DLL if you wanted too, but for now just add all the files to your project.
Then inside your complier add the directory that you have the IrrLib files and use #include "IrrLib.h" to refrence it, and you are good to go!
Old Versions/1/IrrLib.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Version 1
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include "IrrLib.h"
#include <irrlicht.h>
#include <strings.h>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
//TODO: Create own class for handling inputs!
/*IrrLib::IrrLib(MastEventReceiver & receiver){
this->device = createDevice(EDT_SOFTWARE, dimension2d<s32>(640, 480), 16, false, false, false, &receiver);
if (this->device == 0)
exit(1);
IrrLib::Init();
}*/
IrrLib::IrrLib(){
this->device = createDevice(EDT_SOFTWARE, dimension2d<s32>(640, 480), 16, false, false, false, 0);
if (this->device == 0)
exit(1);
IrrLib::Init();
}
IrrLib::IrrLib(video::E_DRIVER_TYPE drivertype, core::dimension2d<s32> & res, u32 bits, bool fullscreen, bool stencilbuffer, bool vsync){
//MyEventReceiver receiver;
this->device = createDevice(drivertype, res, bits, fullscreen, stencilbuffer, vsync, 0);
if (this->device == 0)
exit(1);
IrrLib::Init();
}
IrrLib::IrrLib(int nDrivertype, int width, int height, int bits, bool fullscreen, bool stencilbuffer, bool vsync){
//MyEventReceiver receiver;
video::E_DRIVER_TYPE drivertype;
switch (nDrivertype){
case 0: //TODO: finish this switch case
drivertype = EDT_NULL;
break;
case 1:
drivertype = EDT_SOFTWARE;
break;
case 2:
drivertype = EDT_BURNINGSVIDEO;
break;
case 3:
drivertype = EDT_OPENGL;
break;
case 4:
drivertype = EDT_DIRECT3D8;
//TODO: Find how to detect if DX is complied into Irrlicht
//TODO: Find how to detecht for linux
break;
case 5:
drivertype = EDT_DIRECT3D9;
break;
default:
drivertype = EDT_SOFTWARE;
break;
}
this->device = createDevice(drivertype, dimension2d<s32>(width, height), bits, fullscreen, stencilbuffer, vsync, 0);
if (this->device == 0)
exit(1);
IrrLib::Init();
}
IrrLib::~IrrLib (){ //Our moms wont clean up after us!
//Although I'm sure Irrlicht does this for us already, its always a good idea to check!
/*if (this->device != NULL)
delete this->device;
if (this->driver != NULL)
delete this->driver;
if (this->smgr != NULL)
delete this->smgr;
if (this->mesh != NULL)
delete this->mesh;
if (this->node != NULL)
delete this->node;*/ //it seems Irrlicht picks up after us...
//however we created newNodes, now we need to delete it!
for(int i = 0; i < numNodes; ++i)
delete this->nodeNew[i];
delete this->nodeNew;
}
void IrrLib::Init(){
this->numNodes = 0;
//this->nodeNew = new ISceneNode[10];
this->driver = this->device->getVideoDriver();
this->smgr = this->device->getSceneManager();
}
void IrrLib::ReadArchive(std::string file){
this->device->getFileSystem()->addZipFileArchive(file.c_str());
}
void IrrLib::LoadQ3Level(std::string q3level){
this->mesh = this->smgr->getMesh(q3level.c_str());
this->node = 0;
if (this->mesh)
this->node = this->smgr->addOctTreeSceneNode(this->mesh->getMesh(0), 0, -1, 128);
}
void IrrLib::NodePos(int x, int y, int z){
if (this->node)
this->node->setPosition(core::vector3df(x, y, z));
}
void IrrLib::NodePos(){
if (this->node)
this->node->setPosition(core::vector3df(0, 0, 0));
}
void IrrLib::AddFPSCam(){
this->cam = this->smgr->addCameraSceneNodeFPS();
}
void IrrLib::AddFPSCam(f32 x, f32 y, f32 z)
{
this->cam = this->smgr->addCameraSceneNodeFPS();
this->cam->setPosition(irr::core::vector3df(x, y, z));
}
void IrrLib::VisibleCursor(bool tf){
if (tf == false)
this->device->getCursorControl()->setVisible(false);
else
this->device->getCursorControl()->setVisible(true);
}
int IrrLib::GetFPSCount(){
return this->driver->getFPS();
}
bool IrrLib::DeviceIsRunning(){
return this->device->run();
}
bool IrrLib::IsActiveWindow(){
return this->device->isWindowActive();
}
void IrrLib::BeginScene(){
this->driver->beginScene(true, true, video::SColor(0,200,200,200));
}
void IrrLib::BeginScene(irr::video::SColor color){
this->driver->beginScene(true, true, color);
}
void IrrLib::BeginScene(bool usebackBuffer, bool usezBuffer, irr::video::SColor color){
this->driver->beginScene(usebackBuffer, usezBuffer, color);
}
void IrrLib::DrawAll(){
this->smgr->drawAll();
//this->device->getGUIEnvironment()->drawAll();
}
void IrrLib::EndScene(){
this->driver->endScene();
}
void IrrLib::SetWindowCaption(stringw str){
this->device->setWindowCaption(str.c_str());
}
irr::core::stringw IrrLib::GetDriverName(){
return this->driver->getName();
}
void IrrLib::EndIrrlicht(){
this->device->drop();
}
void IrrLib::KeyPress(char key){
this->key = key;
}
char IrrLib::KeyPressed(){
return key;
}
int IrrLib::CreateNewSphereNode(int x, int y, int z, std::string texture, bool light){
this->nodeNew[this->numNodes] = this->smgr->addSphereSceneNode();
this->nodeNew[this->numNodes]->setPosition(core::vector3df(x,y,z));
this->nodeNew[this->numNodes]->setMaterialTexture(0, this->driver->getTexture(texture.c_str()));
this->nodeNew[this->numNodes]->setMaterialFlag(video::EMF_LIGHTING, light);
this->numNodes++;
return this->numNodes--;
/*this->node = this->smgr->addSphereSceneNode();
this->node->setPosition(core::vector3df(x,y,z));
this->node->setMaterialTexture(0, this->driver->getTexture(texture.c_str()));
this->node->setMaterialFlag(video::EMF_LIGHTING, light);*/
return 0;
}
irr::core::vector3df IrrLib::GetSphereVector(int sphere){
return this->nodeNew[sphere]->getPosition();
}
void IrrLib::SetSphereVector(int sphere, irr::core::vector3df v){
this->nodeNew[sphere]->setPosition(v);
}
Old Versions/1/IrrLib.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Version 1
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRLIB_H
#define IRRLIB_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
//Start class
class IrrLib {
private:
/* Create an Irrlicht device as private because the class should handle
All irrlicht interaction */
irr::IrrlichtDevice *device;
// Tells Irrlicht what driver to use
//video::E_DRIVER_TYPE driverType;
/*
Get a pointer to the video driver and the SceneManager so that
we do not always have to write device->getVideoDriver() and
device->getSceneManager().
*/
irr::video::IVideoDriver* driver;
irr::scene::ISceneManager* smgr;
/*
Get a pointer to the 'mesh' aka the level.
Note: This is for Quake3 levels, ie bsp maps.
*/
irr::scene::IAnimatedMesh* mesh;
irr::scene::ISceneNode* node;
irr::scene::ISceneNode* nodeNew[10];
irr::scene::ISceneNode * tempNode; //use this to store nodeNew's data so we can resize it
int numNodes;
irr::scene::ICameraSceneNode * cam;
char key;
void IrrLib::Init();
public:
IrrLib::IrrLib();
//IrrLib::IrrLib(MastEventReceiver & receiver);
IrrLib::IrrLib(irr::video::E_DRIVER_TYPE drivertype, irr::core::dimension2d<irr::s32> & res, irr::u32 bits, bool fullscreen, bool stencilbuffer, bool vsync);
IrrLib::IrrLib(int drivertype, int width, int height, int bits, bool fullscreen, bool stencilbuffer, bool vsync);
IrrLib::~IrrLib(); //Our moms wont clean up after us!
void IrrLib::ReadArchive(std::string file);
void IrrLib::LoadQ3Level(std::string q3level);
void IrrLib::NodePos(int x, int y, int z); //I think this moves the actual camera?
void IrrLib::NodePos();
void IrrLib::AddFPSCam();
void IrrLib::AddFPSCam(irr::f32 x, irr::f32 y, irr::f32 z);
void IrrLib::VisibleCursor(bool tf);
int IrrLib::GetFPSCount();
bool IrrLib::DeviceIsRunning();
bool IrrLib::IsActiveWindow();
void IrrLib::BeginScene();
void IrrLib::BeginScene(irr::video::SColor color);
void IrrLib::BeginScene(bool usebackBuffer, bool usezBuffer, irr::video::SColor color);
//TODO: Add one more for human readable colors and hex colors!
void IrrLib::DrawAll();
void IrrLib::EndScene();
void IrrLib::SetWindowCaption(irr::core::stringw str);
irr::core::stringw IrrLib::GetDriverName();
//TODO: Make function to turn stringw to string and visa versa
void IrrLib::EndIrrlicht(); //Renamed from KillIrrlicht to EndIrrlicht
//TODO: Add logging
void IrrLib::KeyPress(char key);
char IrrLib::KeyPressed();
int IrrLib::CreateNewSphereNode(int x, int y, int z, std::string texture, bool light); //this is going to take my advanced C++ skillz!
irr::core::vector3df IrrLib::GetSphereVector(int sphere);
void IrrLib::SetSphereVector(int sphere, irr::core::vector3df v);
};
#endif
Old Versions/1/irrlibdocs.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
IrrLib Documentation:f
------------------------
//Important Note from the start: C++ is case senstitive, ReadArchive is not the same as readarchive
Private:
irr::IrrlichtDevice *device;
This is the main device for 'talking' to Irrlicht. This is very important and only the class should interact with it.
irr::video::IVideoDriver* driver;
irr::scene::ISceneManager* smgr;
The driver handles textures and the smgr handles putting models in the scene.
irr::scene::IAnimatedMesh* mesh;
irr::scene::ISceneNode* node;
A mesh object stores a mesh, aka a q3 level. A node, from what I understand contains where the camera should be placed.
Public: //These functions are the ones you call!
IrrLib::IrrLib();
IrrLib::IrrLib(irr::video::E_DRIVER_TYPE drivertype, irr::core::dimension2d<irr::s32> & res, irr::u32 bits, bool fullscreen, bool stencilbuffer, bool vsync, irr::IEventReceiver * receiver);
IrrLib::IrrLib(int drivertype, int width, int height, int bits, bool fullscreen, bool stencilbuffer, bool vsync, irr::IEventReceiver * receiver);
All 3 of those are class constructor. They construct both the class AND Irrlicht.
The first one loads it with defualt values, using software driver.
The second is more for the hard core Irrlicht users, you pass the normal Irrlicht values.
The third is for new users, you don't need a PhD in order to use it.
Code Example:
int main(){
IrrLib Irrlicht; //you are free to name the class variable whatever you want
//This use the defualt constructor, creates an Irrlicht device with defualt values.
}
int main(){
IrrLib Irrlicht(EDT_OPENGL, core::dimension2d<s32>(640, 480), 16, false, false, false, 0);
//This uses the second constructor
}
int main(){
IrrLib Irrlicht(3, 640, 480, 16, false, false, false, 0)
//This uses the third constructor using the opengl driver.
}
Table for drivertype:
0 - EDT_NULL;
1 - EDT_SOFTWARE;
2 - EDT_BURNINGSVIDEO;
3 - EDT_OPENGL;
4 - EDT_DIRECT3D8;
5 - EDT_DIRECT3D9;
default - EDT_SOFTWARE;
//Be careful with 4 and 5 when using someone else's complied Irrlicht, it could crash your program or cause a memory leak if DirectX is not complied into the library!
IrrLib::~IrrLib();
The deconstructor, clean up after ourselves because our moms wont! Need to clear up some dynamic variables that was created so we don't have memory leaks.
/*
Simple so far eh?
Don't worry it gets harder ;)
*/
void IrrLib::ReadArchive(std::string file)
This loads an archive into Irrlicht.
Code Example:
int main(){
IrrLib Irrlicht;
Irrlicht.ReadArchive("c:\program files\my game\myzip.zip");
}
void IrrLib::LoadQ3Level(std::string q3level);
This loads a q3 level onto the scene.
Code Example:
int main(){
IrrLib Irrlicht;
Irrlicht.ReadArchive("c:\program files\my game\myzip.zip");
Irrlicht.LoadQ3Level("20kdm2.bsp");
}
void IrrLib::CameraPos(int x, int y, int z); //I think this moves the actual camera?
void IrrLib::CameraPos();
CameraPos is an overloaded function for a reason, sometimes you do model the level around the orgin, and sometimes you don't.
So I took in account both to make it easier for people using this library.
Code Example:
int main(){
IrrLib Irrlicht;
Irrlicht.ReadArchive("c:\program files\my game\myzip.zip");
Irrlicht.LoadQ3Level("20kdm2.bsp");
IrrLib.CameraPos();
//Sets the camera at the orgin
}
int main(){
IrrLib Irrlicht;
Irrlicht.ReadArchive("c:\program files\my game\myzip.zip");
Irrlicht.LoadQ3Level("20kdm2.bsp");
IrrLib.CameraPos(-1300, -144, -1249);
//Sets the camera at that x, y, z position
}
void IrrLib::AddFPSCam();
This simply adds a camera FPS style. Will add other cameras later.
Code Example:
int main(){
IrrLib Irrlicht;
Irrlicht.ReadArchive("c:\program files\my game\myzip.zip");
Irrlicht.LoadQ3Level("20kdm2.bsp");
IrrLib.CameraPos(-1300, -144, -1249);
//Sets the camera at that x, y, z position
Irrlicht.AddFPSCam();
}
void IrrLib::VisibleCursor(bool tf);
This hides or shows the mouse cursor. Usually you want it hidden.
Code Example:
int main(){
IrrLib Irrlicht;
Irrlicht.ReadArchive("c:\program files\my game\myzip.zip");
Irrlicht.LoadQ3Level("20kdm2.bsp");
IrrLib.CameraPos(-1300, -144, -1249);
//Sets the camera at that x, y, z position
Irrlicht.AddFPSCam();
Irrlicht.VisibleCursor(false);
}
int IrrLib::GetFPSCount();
This returns an int of what the current frames per second count is.
int main(){
IrrLib Irrlicht;
cout << Irrlicht.GetFPSCount() << endl;
return 0;
}
bool IrrLib::DeviceIsRunning();
This returns weither or not the Irrlicht device is running, aka a test to see if the user exists.
Code Example:
int main(){
IrrLib Irrlicht;
Irrlicht.ReadArchive("c:\program files\my game\myzip.zip");
Irrlicht.LoadQ3Level("20kdm2.bsp");
IrrLib.CameraPos(-1300, -144, -1249);
//Sets the camera at that x, y, z position
Irrlicht.AddFPSCam();
Irrlicht.VisibleCursor(false);
while (Irrlicht.DeviceIsRunning()){
//Do cool stuff
}
}
bool IrrLib::IsActiveWindow();
This returns if the Irrlicht spawned window is the window, ie did the user alt tab to play a game of freecell?
int main(){
IrrLib Irrlicht;
Irrlicht.ReadArchive("c:\program files\my game\myzip.zip");
Irrlicht.LoadQ3Level("20kdm2.bsp");
IrrLib.CameraPos(-1300, -144, -1249);
//Sets the camera at that x, y, z position
Irrlicht.AddFPSCam();
Irrlicht.VisibleCursor(false);
while (Irrlicht.DeviceIsRunning()){
if (Irrlicht.IsActiveWindow())
{
//Do cool stuff
}
}
}
void IrrLib::BeginScene();
void IrrLib::BeginScene(irr::video::SColor color);
void IrrLib::BeginScene(bool usebackBuffer, bool usezBuffer, irr::video::SColor color);
This has 3 overloaded functions to allow more of a customization to the interaction between Irrlicht Library -> Irrlicht Engine.
The first uses default values, backbuffer = true, zBuffer = true, and a 'color' of video::SColor(0,200,200,200). //grey I think?
The second assumes, backbuffer = true, zBuffer = true, and a custom color of your choice for the backcolor.
The third is all your choice.
Code Example:
int main(){
IrrLib Irrlicht;
Irrlicht.ReadArchive("c:\program files\my game\myzip.zip");
Irrlicht.LoadQ3Level("20kdm2.bsp");
IrrLib.CameraPos(-1300, -144, -1249);
//Sets the camera at that x, y, z position
Irrlicht.AddFPSCam();
Irrlicht.VisibleCursor(false);
while (Irrlicht.DeviceIsRunning()){
if (Irrlicht.IsActiveWindow())
{
Irrlicht.BeginScene();
}
}
}
int main(){
IrrLib Irrlicht;
Irrlicht.ReadArchive("c:\program files\my game\myzip.zip");
Irrlicht.LoadQ3Level("20kdm2.bsp");
IrrLib.CameraPos(-1300, -144, -1249);
//Sets the camera at that x, y, z position
Irrlicht.AddFPSCam();
Irrlicht.VisibleCursor(false);
while (Irrlicht.DeviceIsRunning()){
if (Irrlicht.IsActiveWindow())
{
Irrlicht.BeginScene(video::SColor(0,200,200,200));
}
}
}
int main(){
IrrLib Irrlicht;
Irrlicht.ReadArchive("c:\program files\my game\myzip.zip");
Irrlicht.LoadQ3Level("20kdm2.bsp");
IrrLib.CameraPos(-1300, -144, -1249);
//Sets the camera at that x, y, z position
Irrlicht.AddFPSCam();
Irrlicht.VisibleCursor(false);
while (Irrlicht.DeviceIsRunning()){
if (Irrlicht.IsActiveWindow())
{
Irrlicht.BeginScene(false, false, video::SColor(0,200,200,200));
}
}
}
void IrrLib::DrawAll();
Draws everything on the scene.
Code Example:
int main(){
IrrLib Irrlicht;
Irrlicht.ReadArchive("c:\program files\my game\myzip.zip");
Irrlicht.LoadQ3Level("20kdm2.bsp");
IrrLib.CameraPos(-1300, -144, -1249);
//Sets the camera at that x, y, z position
Irrlicht.AddFPSCam();
Irrlicht.VisibleCursor(false);
while (Irrlicht.DeviceIsRunning()){
if (Irrlicht.IsActiveWindow())
{
Irrlicht.BeginScene();
Irrlicht.DrawAll();
}
}
}
void IrrLib::EndScene()
Ends the scene.
Code Example:
int main(){
IrrLib Irrlicht;
Irrlicht.ReadArchive("c:\program files\my game\myzip.zip");
Irrlicht.LoadQ3Level("20kdm2.bsp");
IrrLib.CameraPos(-1300, -144, -1249);
//Sets the camera at that x, y, z position
Irrlicht.AddFPSCam();
Irrlicht.VisibleCursor(false);
while (Irrlicht.DeviceIsRunning()){
if (Irrlicht.IsActiveWindow())
{
Irrlicht.BeginScene();
Irrlicht.DrawAll();
Irrlicht.EndScene();
}
}
}
void IrrLib::SetWindowCaption(irr::core::stringw str);
Tells Irrlicht what to set the window caption.
Code Example:
int main(){
IrrLib Irrlicht;
Irrlicht.ReadArchive("c:\program files\my game\myzip.zip");
Irrlicht.LoadQ3Level("20kdm2.bsp");
IrrLib.CameraPos(-1300, -144, -1249);
//Sets the camera at that x, y, z position
Irrlicht.AddFPSCam();
Irrlicht.VisibleCursor(false);
while (Irrlicht.DeviceIsRunning()){
if (Irrlicht.IsActiveWindow())
{
Irrlicht.BeginScene();
Irrlicht.DrawAll();
Irrlicht.EndScene();
Irrlicht.SetWindowCaption(L"Irrlicht is awsome!");
}
}
}
irr:core::stringw IrrLib::GetDriverName();
Returns a stringw of what the driver name is.
Code Example:
int main(){
IrrLib Irrlicht;
Irrlicht.ReadArchive("c:\program files\my game\myzip.zip");
Irrlicht.LoadQ3Level("20kdm2.bsp");
IrrLib.CameraPos(-1300, -144, -1249);
//Sets the camera at that x, y, z position
Irrlicht.AddFPSCam();
Irrlicht.VisibleCursor(false);
while (Irrlicht.DeviceIsRunning()){
if (Irrlicht.IsActiveWindow())
{
Irrlicht.BeginScene();
Irrlicht.DrawAll();
Irrlicht.EndScene();
Irrlicht.SetWindowCaption(L"Irrlicht is awsome! This is using " + Irrlicht.GetDriverName());
}
}
}
void IrrLib::EndIrrlicht();
Ends the Irrlicht scene.
int main(){
IrrLib Irrlicht;
Irrlicht.ReadArchive("c:\program files\my game\myzip.zip");
Irrlicht.LoadQ3Level("20kdm2.bsp");
IrrLib.CameraPos(-1300, -144, -1249);
//Sets the camera at that x, y, z position
Irrlicht.AddFPSCam();
Irrlicht.VisibleCursor(false);
while (Irrlicht.DeviceIsRunning()){
if (Irrlicht.IsActiveWindow())
{
Irrlicht.BeginScene();
Irrlicht.DrawAll();
Irrlicht.EndScene();
Irrlicht.SetWindowCaption(L"Irrlicht is awsome! This is using " + Irrlicht.GetDriverName())
}
}
IrrLib.EndIrrlicht();
return 0; //the deconstructor will delete all our dynamic vars so we don't have horriable memory leaks!
}
Part 2: Putting it all together!
//This exmaple is example #2 from the Irrlicht doc examples
int main(){
IrrLib Irrlicht;
Irrlicht.ReadArchive("../../media/map-20kdm2.pk3");
Irrlicht.LoadQ3Level("20kdm2.bsp");
IrrLib.CameraPos(-1300, -144, -1249);
//Sets the camera at that x, y, z position
Irrlicht.AddFPSCam();
Irrlicht.VisibleCursor(false);
int lastFPS = -1;
while (Irrlicht.DeviceIsRunning()){
if (Irrlicht.IsActiveWindow())
{
Irrlicht.BeginScene();
Irrlicht.DrawAll();
Irrlicht.EndScene();
int fps = Irrlicht.GetFPSCount();
if (lastFPS != fps)
{
core::stringw str = L"Irrlicht Engine - Quake 3 Map example [";
str += Irrlicht.GetDriverName();
str += "] FPS:";
str += fps;
Irrlicht.SetWindowCaption(str.c_str());
lastfps = fps;
}
}
}
IrrLib.EndIrrlicht();
return 0; //the deconstructor will delete all our dynamic vars so we don't have horriable memory leaks!
//That was easy wasn't it?
//Everything is now humanreadable, I think your next door neighbor could even figure out whats going on....maybe
}
Stable Version/1.2.2/CHANGES
1
2
3
4
5
6
7
8
9
10
11
12
Version 1.2
+ Added a Irr3DLib class that will control all 3D objects
+ Also Added a Irr2D class that works on the same concept.
+ IrrSphere is now owned by Irr3DLib
+ Updated the examples using the latest code
Version 1.2.2
+ Added IrrEventReciever to handle all input
- Still under work
+ Fixed some misc coding bugs
+ Added template class
+ Added sprite class
+ Added GUI class
Stable Version/1.2.2/Irr2D.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
//#include "IrrLib.h"
//#include "IrrSphere.h" //You probably aren't going to be using 3D objects in a 2D environment!
#include <irrlicht.h>
#include <strings.h>
#include "Irr2D.h"
#include "IrrSprite.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
Irr2D::Irr2D(){
this->numTextures = 0;
//NA Should we set textures to new
}
Irr2D::~Irr2D(){
for(int i = 0; i < numTextures; ++i)
delete this->textures[i];
delete this->textures;
}
void Irr2D::SetSmgr(irr::scene::ISceneManager* smgr){
this->smgr = smgr;
Sprite.SetSmgr(smgr);
}
void Irr2D::SetDriver(irr::video::IVideoDriver* driver){
this->driver = driver;
Sprite.SetDriver(driver);
}
void Irr2D::LoadTexturemap(std::string file){
this->texturemap = driver->getTexture(file.c_str());
}
int Irr2D::LoadTexture(std::string file){
this->textures[this->numTextures] = driver->getTexture(file.c_str());
this->numTextures++;
return numTextures--;
}
Stable Version/1.2.2/Irr2D.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRR2D_H
#define IRR2D_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
//#include "IrrLib.h"
#include "IrrSprite.h"
class Irr2D {
private:
irr::scene::ISceneManager* smgr;
irr::video::IVideoDriver* driver;
irr::video::ITexture* texturemap;
int numTextures;
irr::video::ITexture* textures[10];
public:
//Irr2D::Irr2D();
IrrSprite Sprite;
Irr2D::Irr2D();
Irr2D::~Irr2D();
void Irr2D::SetDriver(irr::video::IVideoDriver* driver);
void Irr2D::SetSmgr(irr::scene::ISceneManager* smgr);
void Irr2D::LoadTexturemap(std::string file);
int Irr2D::LoadTexture(std::string file);
void Irr2D::DrawImage(int texture, const irr::core::position2d<irr::s32> & destPos);
void Irr2D::DrawImage(const irr::core::position2d<irr::s32> & destPos, const irr::core::rect<irr::s32> & sourceRect, const irr::core::rect<irr::s32> * clipRect, irr::video::SColor color, bool useAlphaChannelOfTexture);
void Irr2D::DrawLine(const irr::core::position2d<irr::s32> & start, const irr::core::position2d<irr::s32> & end, irr::video::SColor color);
};
#endif
Stable Version/1.2.2/Irr3D.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <strings.h>
//#include "IrrLib.h"
//Libraries we create go here
#include "IrrSphere.h"
//#include "IrrColor.h"
#include "Irr3D.h"
#include <irrlicht.h>
//#include "Irr2D.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
void Irr3D::SetDriver(irr::video::IVideoDriver* driver) //so much for copying and pasting code from the header file
{
this->driver = driver;
Sphere.SetDriver(driver);
}
void Irr3D::SetSmgr(irr::scene::ISceneManager* smgr)
{
this->smgr = smgr;
Sphere.SetSmgr(smgr);
}
Irr3D::Irr3D()
{
//do stuff here!
}
Irr3D::~Irr3D()
{
//delete stuff here!
}
Stable Version/1.2.2/Irr3D.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRR3D_H
#define IRR3D_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
#include "IrrSphere.h"
//#include "IrrColor.h"
//#include "Irr3D.h"
//#include "Irr2D.h" This is a 3D class not 2D
/* However due to Irrlciht's nature mixing 2D with 3D is possible */
//Start class
class Irr3D {
private:
irr::video::IVideoDriver* driver;
irr::scene::ISceneManager* smgr;
public:
IrrSphere Sphere;
Irr3D::Irr3D();
Irr3D::~Irr3D();
void Irr3D::SetDriver(irr::video::IVideoDriver* driver);
void Irr3D::SetSmgr(irr::scene::ISceneManager* smgr);
};
#endif
Stable Version/1.2.2/IrrColor.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <irrlicht.h>
#include <strings.h>
//#include "IrrLib.h"
#include "IrrColor.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
void IrrColor::test(){
//do nothing
}
SColor IrrColor::returnColor(std::string color){
int nColor = -1;
if (color == "red")
nColor = 1;
else if (color == "green")
nColor = 2;
else if (color == "blue")
nColor = 3;
else if (color == "dark green")
nColor = 4;
else if (color == "pink")
nColor = 5;
else if (color == "grey")
nColor = 6;
switch (nColor){
case 1:
return SColor(255, 255, 0, 0);
break;
case 2:
return SColor(255, 0, 255, 0);
break;
case 3:
return SColor(255, 0, 0, 255);
break;
case 4:
return SColor(255, 0, 50, 0);
break;
case 5:
return SColor(255, 255, 10, 255);
break;
case 6:
return SColor(255,200,200,200);
break;
default:
return SColor(255,200,200,200);
break;
}// TODO: Make this function modular
}
Stable Version/1.2.2/IrrColor.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRCOLOR_H
#define IRRCOLOR_H
#include <iostream>
#include <strings.h>
#include "irrlicht.h"
//#include "IrrLib.h"
class IrrColor {
private:
//who knows?
public:
void IrrColor::test();
irr::video::SColor IrrColor::returnColor(std::string color);
};
#endif
Stable Version/1.2.2/IrrEventReciever.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include "IrrEventReciever.h"
#include "IrrLib.h"
#include <irrlicht.h>
#include <iostream>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
bool IrrEventReciever::OnEvent(SEvent event)
{
if (event.EventType == irr::EET_KEY_INPUT_EVENT) {
if (!event.KeyInput.PressedDown)
//keyStates[event.KeyInput.Key] = true;
cout << "Key was hit: " << event.KeyInput.Key << endl;
//else
//cout << "Key was not hit" << endl;
//keyStates[event.KeyInput.Key] = false;
}
return false;
}
Stable Version/1.2.2/IrrEventReciever.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRREVENTRECIEVER_H
#define IRREVENTRECIEVER_H
//#include "IrrLib.h"
#include <irrlicht.h>
class IrrEventReciever : public irr::IEventReceiver
{
public:
virtual bool OnEvent(irr::SEvent event);
};
#endif
Stable Version/1.2.2/IrrLib.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <irrlicht.h>
#include <strings.h>
#include "IrrLib.h"
//Libraries we create go here
//#include "IrrSphere.h"
#include "IrrColor.h"
//#include "Irr2D.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
//TODO: Create own class for handling inputs!
/*IrrLib::IrrLib(MastEventReceiver & receiver){
this->device = createDevice(EDT_SOFTWARE, dimension2d<s32>(640, 480), 16, false, false, false, &receiver);
if (this->device == 0)
exit(1);
IrrLib::Init();
}*/
IrrLib::IrrLib(){
this->device = createDevice(EDT_SOFTWARE, dimension2d<s32>(640, 480), 16, false, false, false, &this->irecv);
if (this->device == 0)
exit(1);
IrrLib::Init();
}
IrrLib::IrrLib(video::E_DRIVER_TYPE drivertype, core::dimension2d<s32> & res, u32 bits, bool fullscreen, bool stencilbuffer, bool vsync){
//MyEventReceiver receiver;
this->device = createDevice(drivertype, res, bits, fullscreen, stencilbuffer, vsync, &this->irecv);
if (this->device == 0)
exit(1);
IrrLib::Init();
}
IrrLib::IrrLib(int nDrivertype, int width, int height, int bits, bool fullscreen, bool stencilbuffer, bool vsync){
//MyEventReceiver receiver;
video::E_DRIVER_TYPE drivertype;
switch (nDrivertype){
case 0: //TODO: finish this switch case
drivertype = EDT_NULL;
break;
case 1:
drivertype = EDT_SOFTWARE;
break;
case 2:
drivertype = EDT_BURNINGSVIDEO;
break;
case 3:
drivertype = EDT_OPENGL;
break;
case 4:
drivertype = EDT_DIRECT3D8;
//*Note: It seems as Microsoft has stoped supporting DX 8.1, so you can not compile it into Irrlicht engine anymore
//TODO: Find how to detect if DX is complied into Irrlicht
//TODO: Find how to detecht for linux
break;
case 5:
drivertype = EDT_DIRECT3D9;
break;
default:
drivertype = EDT_SOFTWARE;
break;
}
this->device = createDevice(drivertype, dimension2d<s32>(width, height), bits, fullscreen, stencilbuffer, vsync, &this->irecv);
if (this->device == 0)
exit(1);
IrrLib::Init();
}
IrrLib::~IrrLib (){ //Our moms wont clean up after us!
//Although I'm sure Irrlicht does this for us already, its always a good idea to check!
/*if (this->device != NULL)
delete this->device;
if (this->driver != NULL)
delete this->driver;
if (this->smgr != NULL)
delete this->smgr;
if (this->mesh != NULL)
delete this->mesh;
if (this->node != NULL)
delete this->node;*/ //it seems Irrlicht picks up after us...
//however we created newNodes, now we need to delete it!
}
void IrrLib::Init(){
//this->numNodes = 0;
//this->nodeNew = new ISceneNode[10];
this->driver = this->device->getVideoDriver();
this->smgr = this->device->getSceneManager();
Irr3DLib.SetSmgr(this->smgr);
Irr3DLib.SetDriver(this->driver);
//Irr2DLib.SetSmgr(this->smgr);
//Irr2DLib.SetDriver(this->driver);
GUI.SetEnv(this->device->getGUIEnvironment());
}
void IrrLib::ReadArchive(std::string file){
this->device->getFileSystem()->addZipFileArchive(file.c_str());
}
void IrrLib::LoadQ3Level(std::string q3level){
this->mesh = this->smgr->getMesh(q3level.c_str());
this->node = 0;
if (this->mesh)
this->node = this->smgr->addOctTreeSceneNode(this->mesh->getMesh(0), 0, -1, 128);
}
void IrrLib::MapPos(int x, int y, int z){
if (this->node)
this->node->setPosition(core::vector3df(x, y, z));
}
void IrrLib::MapPos(){
if (this->node)
this->node->setPosition(core::vector3df(0, 0, 0));
}
void IrrLib::AddFPSCam(){
this->cam = this->smgr->addCameraSceneNodeFPS();
}
void IrrLib::AddFPSCam(f32 x, f32 y, f32 z)
{
this->cam = this->smgr->addCameraSceneNodeFPS();
this->cam->setPosition(irr::core::vector3df(x, y, z));
}
void IrrLib::VisibleCursor(bool tf){
if (tf == false)
this->device->getCursorControl()->setVisible(false);
else
this->device->getCursorControl()->setVisible(true);
}
int IrrLib::GetFPSCount(){
return this->driver->getFPS();
}
bool IrrLib::DeviceIsRunning(){
return this->device->run();
}
bool IrrLib::IsActiveWindow(){
return this->device->isWindowActive();
}
void IrrLib::BeginScene(){
this->driver->beginScene(true, true, video::SColor(0,200,200,200));
}
void IrrLib::BeginScene(irr::video::SColor color){
this->driver->beginScene(true, true, color);
}
void IrrLib::BeginScene(bool usebackBuffer, bool usezBuffer, irr::video::SColor color){
this->driver->beginScene(usebackBuffer, usezBuffer, color);
}
void IrrLib::DrawAll(){
this->smgr->drawAll();
//this->device->getGUIEnvironment()->drawAll();
}
void IrrLib::EndScene(){
this->driver->endScene();
}
void IrrLib::SetWindowCaption(stringw str){
this->device->setWindowCaption(str.c_str());
}
irr::core::stringw IrrLib::GetDriverName(){
return this->driver->getName();
}
void IrrLib::EndIrrlicht(){
this->device->drop();
}
void IrrLib::KeyPress(char key){
this->key = key;
}
char IrrLib::KeyPressed(){
return key;
}
irr::f32 IrrLib::getX(){
return this->smgr->getActiveCamera()->getPosition().X;
}
irr::f32 IrrLib::getY(){
return this->smgr->getActiveCamera()->getPosition().Y;
}
irr::f32 IrrLib::getZ(){
return this->smgr->getActiveCamera()->getPosition().Z;
}
Stable Version/1.2.2/IrrLib.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRLIB_H
#define IRRLIB_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
#include <irrlicht.h>
/* We have to include Irrlichts libs */
#include "Irr3D.h"
#include "IrrColor.h"
#include "IrrLibGUI.h"
#include "IrrEventReciever.h"
#include "Irr2D.h"
//Start class
class IrrLib {
private:
/* Create an Irrlicht device as private because the class should handle
All irrlicht interaction */
irr::IrrlichtDevice *device;
// Tells Irrlicht what driver to use
//video::E_DRIVER_TYPE driverType;
/*
Get a pointer to the video driver and the SceneManager so that
we do not always have to write device->getVideoDriver() and
device->getSceneManager().
*/
irr::video::IVideoDriver* driver;
irr::scene::ISceneManager* smgr;
/*
Get a pointer to the 'mesh' aka the level.
Note: This is for Quake3 levels, ie bsp maps.
*/
irr::scene::IAnimatedMesh* mesh;
irr::scene::ISceneNode* node;
irr::scene::ISceneNode * tempNode; //use this to store nodeNew's data so we can resize it
irr::scene::ICameraSceneNode * cam;
char key;
void IrrLib::Init();
/*friend class IrrColor;
friend class Irr2DLib;
friend class Sphere;*/
public:
//IrrSphere Sphere; //This has to be public to be able to access the Sphere class
/* IrrSphere is now in Irr3D class */
//Prehaps put this into a IrrLib3D class?
Irr3D Irr3DLib;
IrrColor Color; //Color class...not much of a class but lets keep it OO
Irr2D Irr2DLib; //1/2 variable to be labeled like this due to variables not able to begin with a number
IrrLibGUI GUI;
IrrEventReciever irecv;
IrrLib::IrrLib();
//IrrLib::IrrLib(MastEventReceiver & receiver);
IrrLib::IrrLib(irr::video::E_DRIVER_TYPE drivertype, irr::core::dimension2d<irr::s32> & res, irr::u32 bits, bool fullscreen, bool stencilbuffer, bool vsync);
IrrLib::IrrLib(int drivertype, int width, int height, int bits, bool fullscreen, bool stencilbuffer, bool vsync);
IrrLib::~IrrLib(); //Our moms wont clean up after us!
void IrrLib::ReadArchive(std::string file);
void IrrLib::LoadQ3Level(std::string q3level);
void IrrLib::MapPos(int x, int y, int z); //I think this moves the actual camera?
void IrrLib::MapPos();
void IrrLib::AddFPSCam();
void IrrLib::AddFPSCam(irr::f32 x, irr::f32 y, irr::f32 z);
void IrrLib::VisibleCursor(bool tf);
int IrrLib::GetFPSCount();
bool IrrLib::DeviceIsRunning();
bool IrrLib::IsActiveWindow();
void IrrLib::BeginScene();
void IrrLib::BeginScene(irr::video::SColor color);
void IrrLib::BeginScene(bool usebackBuffer, bool usezBuffer, irr::video::SColor color);
//TODO: Add one more for human readable colors and hex colors!
void IrrLib::DrawAll();
void IrrLib::EndScene();
void IrrLib::SetWindowCaption(irr::core::stringw str);
irr::core::stringw IrrLib::GetDriverName();
//TODO: Make function to turn stringw to string and visa versa
void IrrLib::EndIrrlicht(); //Renamed from KillIrrlicht to EndIrrlicht
//TODO: Add logging
void IrrLib::KeyPress(char key);
char IrrLib::KeyPressed();
irr::f32 getX();
irr::f32 getY();
irr::f32 getZ();
};
#endif
Stable Version/1.2.2/IrrLibBase.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <irrlicht.h>
#include "IrrLibBase.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
void IrrLibBase::SetDriver(IVideoDriver* driver) //can be overloaded
{
this->driver = driver;
}
void IrrLibBase::SetSmgr(ISceneManager* smgr)
{
this->smgr = smgr;
}
Stable Version/1.2.2/IrrLibBase.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRLIBBASE_H
#define IRRLIBBASE_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
class IrrLibBase {
protected:
irr::video::IVideoDriver* driver;
irr::scene::ISceneManager* smgr;
public:
void IrrLibBase::SetDriver(irr::video::IVideoDriver* driver);
void IrrLibBase::SetSmgr(irr::scene::ISceneManager* smgr);
};
#endif
Stable Version/1.2.2/IrrLibGUI.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <strings.h>
#include <irrlicht.h>
#include "IrrLibGUI.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
IrrLibGUI::IrrLibGUI()
{
//NA does it need to do anything at init?
this->nStaticText = 0;
//this->env = this->device->getGUIEnvironment(); //NA yes we do!
}
IrrLibGUI::~IrrLibGUI()
{
//NA Do we have to delete anything?
}
void IrrLibGUI::SetEnv(IGUIEnvironment* env)
{
this->env = env;
}
void IrrLibGUI::Clear()
{
this->env->clear();
}
void IrrLibGUI::DrawAll()
{
this->env->drawAll();
}
void IrrLibGUI::AddStaticText()
{
this->env->addStaticText(L"Powered by IrrLib.", rect<s32>(0,0,0,0), true);
}
void IrrLibGUI::AddStaticText(std::string message)
{
this->env->addStaticText((wchar_t*)message.c_str(), rect<s32>(0,0,0,0), true);
}
void IrrLibGUI::AddStaticText(std::string message, int x1, int y1, int x2, int y2)
{
this->env->addStaticText((wchar_t*)message.c_str(), rect<s32>(x1,y1,x2,y2), true);
}
void IrrLibGUI::AddStaticText(std::string message, int x1, int y1, int x2, int y2, bool border, bool wordwrap)
{
this->env->addStaticText((wchar_t*)message.c_str(), rect<s32>(x1,y1,x2,y2), border, wordwrap);
}
void IrrLibGUI::AddStaticText(std::string message, int x1, int y1, int x2, int y2, bool border, bool wordwrap, int id, bool fillbackground)
{
this->env->addStaticText((wchar_t*)message.c_str(), rect<s32>(x1,y1,x2,y2), border, wordwrap, 0, id, fillbackground);
}
void IrrLibGUI::AddStaticText(std::string message, const core::rect< s32 > &rectangle)
{
this->env->addStaticText((wchar_t*)message.c_str(), rectangle);
}
void IrrLibGUI::AddStaticText(std::string message, const core::rect< s32 > &rectangle, bool border, bool wordwrap)
{
this->env->addStaticText((wchar_t*)message.c_str(), rectangle, border, wordwrap);
}
void IrrLibGUI::AddStaticText(std::string message, const core::rect< s32 > &rectangle, bool border, bool wordwrap, int id, bool fillbackground)
{
this->env->addStaticText((wchar_t*)message.c_str(), rectangle, border, wordwrap, 0, id, fillbackground);
}
Stable Version/1.2.2/IrrLibGUI.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRLIBGUI_H
#define IRRLIBGUI_H
#include <iostream>
#include <strings.h>
#include <irrlicht.h>
#include "IrrLibBase.h"
class IrrLibGUI: public IrrLibBase {
private:
irr::gui::IGUISkin* skin;
irr::gui::IGUIFont* font;
irr::gui::IGUIEnvironment* env;
//TODO: Create an array storing all messages
int nStaticText;
irr::gui::IGUIStaticText* arrStaticText[10];
public:
IrrLibGUI::IrrLibGUI();
IrrLibGUI::~IrrLibGUI();
void IrrLibGUI::SetEnv(irr::gui::IGUIEnvironment* env);
void IrrLibGUI::Clear();
void IrrLibGUI::DrawAll();
void IrrLibGUI::AddStaticText(); //NA eh a default text adder why not?
void IrrLibGUI::AddStaticText(std::string message);
void IrrLibGUI::AddStaticText(std::string message, int x1, int y1, int x2, int y2);
void IrrLibGUI::AddStaticText(std::string message, int x1, int y1, int x2, int y2, bool border, bool wordwrap);
void IrrLibGUI::AddStaticText(std::string message, int x1, int y1, int x2, int y2, bool border, bool wordwrap, int id, bool fillbackground);
void IrrLibGUI::AddStaticText(std::string message, const irr::core::rect< irr::s32 > &rectangle);
void IrrLibGUI::AddStaticText(std::string message, const irr::core::rect< irr::s32 > &rectangle, bool border, bool wordwrap);
void IrrLibGUI::AddStaticText(std::string message, const irr::core::rect< irr::s32 > &rectangle, bool border, bool wordwrap, int id, bool fillbackground);
};
#endif
Stable Version/1.2.2/IrrSphere.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include "IrrLib.h"
#include "IrrSphere.h"
#include <irrlicht.h>
#include <strings.h>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
void IrrSphere::SetSmgr(irr::scene::ISceneManager* smgr){
this->smgr = smgr;
}
void IrrSphere::SetDriver(irr::video::IVideoDriver* driver){
this->driver = driver;
}
int IrrSphere::CreateNewSphereNode(int x, int y, int z, std::string texture, bool light){
//TODO: Resize after 10, and add 10 more to the mix!
this->nodeNew[this->numNodes] = this->smgr->addSphereSceneNode();
this->nodeNew[this->numNodes]->setPosition(core::vector3df(x,y,z));
this->nodeNew[this->numNodes]->setMaterialTexture(0, this->driver->getTexture(texture.c_str()));
this->nodeNew[this->numNodes]->setMaterialFlag(video::EMF_LIGHTING, light);
this->numNodes++;
return this->numNodes--;
/*this->node = this->smgr->addSphereSceneNode();
this->node->setPosition(core::vector3df(x,y,z));
this->node->setMaterialTexture(0, this->driver->getTexture(texture.c_str()));
this->node->setMaterialFlag(video::EMF_LIGHTING, light);*/
}
irr::core::vector3df IrrSphere::GetSphereVector(int sphere){
return this->nodeNew[sphere]->getPosition();
}
void IrrSphere::SetSphereVector(int sphere, irr::core::vector3df v){
this->nodeNew[sphere]->setPosition(v);
}
IrrSphere::IrrSphere(){
this->numNodes = 0;
}
IrrSphere::~IrrSphere(){
for(int i = 0; i < numNodes; ++i)
delete this->nodeNew[i];
delete this->nodeNew;
}
Stable Version/1.2.2/IrrSphere.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRSPHERE_H
#define IRRSPHERE_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
//#include "IrrLib.h"
class IrrSphere
{
private:
irr::scene::ISceneNode* nodeNew[10];
int numNodes;
irr::scene::ISceneManager* smgr;
irr::video::IVideoDriver* driver;
public:
void IrrSphere::SetDriver(irr::video::IVideoDriver* driver);
void IrrSphere::SetSmgr(irr::scene::ISceneManager* smgr);
int IrrSphere::CreateNewSphereNode(int x, int y, int z, std::string texture, bool light); //this is going to take my advanced C++ skillz!
irr::core::vector3df IrrSphere::GetSphereVector(int sphere);
void IrrSphere::SetSphereVector(int sphere, irr::core::vector3df v);
IrrSphere::IrrSphere();
//IrrSphere::IrrSphere(IrrLib*);
IrrSphere::~IrrSphere();
};
#endif
Stable Version/1.2.2/IrrSprite.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <irrlicht.h>
#include <strings.h>
#include "IrrLib.h"
//Libraries we create go here
//#include "IrrSphere.h"
#include "IrrColor.h"
#include "IrrSprite.h"
//#include "Irr2D.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
IrrSprite::IrrSprite()
{
//do stuff
}
IrrSprite::~IrrSprite()
{
//delete stuff
}
void IrrSprite::SetDriver(irr::video::IVideoDriver* driver)
{
this->driver = driver;
}
void IrrSprite::SetSmgr(irr::scene::ISceneManager* smgr)
{
this->smgr = smgr;
}
Stable Version/1.2.2/IrrSprite.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRSPRITE_H
#define IRRSPRITE_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
//#include "IrrSphere.h"
#include "IrrColor.h"
//#include "Irr2D.h"
//#include "IrrSprite.h"
//Start class
class IrrSprite {
private:
irr::video::IVideoDriver* driver;
irr::scene::ISceneManager* smgr;
public:
IrrSprite::IrrSprite();
IrrSprite::~IrrSprite();
void IrrSprite::SetDriver(irr::video::IVideoDriver* driver);
void IrrSprite::SetSmgr(irr::scene::ISceneManager* smgr);
// I forgot a semicolon here....and it wasn't compling
//Thats 1 bad thing about OOP if there is an error you don't know where the @#$@# the problem is!
};
#endif
Stable Version/1.2.2/README
1
2
3
4
5
6
7
8
9
10
11
12
13
Irrlicht Library Wrapper
Created by Nathan Adams
Version 1.2
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
Please leave all files intact if you redistrubte this software.
How to use:
Add all the files to your Irrlicht project, you could compile it into a DLL if you wanted too, but for now just add all the files to your project.
Then inside your complier add the directory that you have the IrrLib files and use #include "IrrLib.h" to refrence it, and you are good to go!
Stable Version/1.2.3/CHANGES
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
Version 1.2
+ Added a Irr3DLib class that will control all 3D objects
+ Also Added a Irr2D class that works on the same concept.
+ IrrSphere is now owned by Irr3DLib
+ Updated the examples using the latest code
Version 1.2.2
+ Added IrrEventReciever to handle all input
- Still under work
+ Fixed some misc coding bugs
+ Added template class
+ Added sprite class
+ Added GUI class
Version 1.2.3
+ IrrEventReciver now works as advertised
+ Baseclass is now being used
+ A couple somewhat-useful functions
+ int_to_string
+ stringw_to_stdstring
+ stdstring_to_stringw
+ GUI elements
+ Static text is working
+ Under construction for a data type class
Stable Version/1.2.3/CREDITS
1
2
3
4
IrrLib
Created by
Nathan Adams
Denzel Morris
Stable Version/1.2.3/Irr2D.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
//#include "IrrLib.h"
//#include "IrrSphere.h" //You probably aren't going to be using 3D objects in a 2D environment!
#include <irrlicht.h>
#include <strings.h>
#include "Irr2D.h"
#include "IrrSprite.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
Irr2D::Irr2D(){
this->numTextures = 0;
//NA Should we set textures to new
}
Irr2D::~Irr2D(){
for(int i = 0; i < numTextures; ++i)
delete this->textures[i];
delete this->textures;
}
void Irr2D::SetSmgr(irr::scene::ISceneManager* smgr){
this->smgr = smgr;
Sprite.SetSmgr(smgr);
}
void Irr2D::SetDriver(irr::video::IVideoDriver* driver){
this->driver = driver;
Sprite.SetDriver(driver);
}
void Irr2D::LoadTexturemap(std::string file){
this->texturemap = driver->getTexture(file.c_str());
}
int Irr2D::LoadTexture(std::string file){
this->textures[this->numTextures] = driver->getTexture(file.c_str());
this->numTextures++;
return numTextures--;
}
Stable Version/1.2.3/Irr2D.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRR2D_H
#define IRR2D_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
//#include "IrrLib.h"
#include "IrrSprite.h"
class Irr2D {
private:
irr::scene::ISceneManager* smgr;
irr::video::IVideoDriver* driver;
irr::video::ITexture* texturemap;
int numTextures;
irr::video::ITexture* textures[10];
public:
//Irr2D::Irr2D();
IrrSprite Sprite;
Irr2D::Irr2D();
Irr2D::~Irr2D();
void Irr2D::SetDriver(irr::video::IVideoDriver* driver);
void Irr2D::SetSmgr(irr::scene::ISceneManager* smgr);
void Irr2D::LoadTexturemap(std::string file);
int Irr2D::LoadTexture(std::string file);
void Irr2D::DrawImage(int texture, const irr::core::position2d<irr::s32> & destPos);
void Irr2D::DrawImage(const irr::core::position2d<irr::s32> & destPos, const irr::core::rect<irr::s32> & sourceRect, const irr::core::rect<irr::s32> * clipRect, irr::video::SColor color, bool useAlphaChannelOfTexture);
void Irr2D::DrawLine(const irr::core::position2d<irr::s32> & start, const irr::core::position2d<irr::s32> & end, irr::video::SColor color);
};
#endif
Stable Version/1.2.3/Irr3D.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <strings.h>
//#include "IrrLib.h"
//Libraries we create go here
#include "IrrSphere.h"
//#include "IrrColor.h"
#include "Irr3D.h"
#include <irrlicht.h>
//#include "Irr2D.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
void Irr3D::SetDriver(irr::video::IVideoDriver* driver) //so much for copying and pasting code from the header file
{
this->driver = driver;
Sphere.SetDriver(driver);
}
void Irr3D::SetSmgr(irr::scene::ISceneManager* smgr)
{
this->smgr = smgr;
Sphere.SetSmgr(smgr);
}
Irr3D::Irr3D()
{
//do stuff here!
}
Irr3D::~Irr3D()
{
//delete stuff here!
}
Stable Version/1.2.3/Irr3D.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRR3D_H
#define IRR3D_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
#include "IrrSphere.h"
//#include "IrrColor.h"
//#include "Irr3D.h"
//#include "Irr2D.h" This is a 3D class not 2D
/* However due to Irrlciht's nature mixing 2D with 3D is possible */
//Start class
class Irr3D {
private:
irr::video::IVideoDriver* driver;
irr::scene::ISceneManager* smgr;
public:
IrrSphere Sphere;
Irr3D::Irr3D();
Irr3D::~Irr3D();
void Irr3D::SetDriver(irr::video::IVideoDriver* driver);
void Irr3D::SetSmgr(irr::scene::ISceneManager* smgr);
};
#endif
Stable Version/1.2.3/IrrColor.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <irrlicht.h>
#include <strings.h>
//#include "IrrLib.h"
#include "IrrColor.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
void IrrColor::test(){
//do nothing
}
SColor IrrColor::returnColor(std::string color){
int nColor = -1;
if (color == "red")
nColor = 1;
else if (color == "green")
nColor = 2;
else if (color == "blue")
nColor = 3;
else if (color == "dark green")
nColor = 4;
else if (color == "pink")
nColor = 5;
else if (color == "grey")
nColor = 6;
switch (nColor){
case 1:
return SColor(255, 255, 0, 0);
break;
case 2:
return SColor(255, 0, 255, 0);
break;
case 3:
return SColor(255, 0, 0, 255);
break;
case 4:
return SColor(255, 0, 50, 0);
break;
case 5:
return SColor(255, 255, 10, 255);
break;
case 6:
return SColor(255,200,200,200);
break;
default:
return SColor(255,200,200,200);
break;
}// TODO: Make this function modular
}
Stable Version/1.2.3/IrrColor.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRCOLOR_H
#define IRRCOLOR_H
#include <iostream>
#include <strings.h>
#include "irrlicht.h"
//#include "IrrLib.h"
class IrrColor {
private:
//who knows?
public:
void IrrColor::test();
irr::video::SColor IrrColor::returnColor(std::string color);
};
#endif
Stable Version/1.2.3/IrrEventReciever.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include "IrrEventReciever.h"
//#include "IrrLib.h"
#include <irrlicht.h>
#include <iostream>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
/*void IrrEventReciever::setIrrLib(IrrLib& IrrLib)
{
this.callingIrrLib = IrrLib;
}*/
bool IrrEventReciever::OnEvent(SEvent event)
{
if (event.EventType == irr::EET_KEY_INPUT_EVENT) {
if (!event.KeyInput.PressedDown)
this->keyStates[event.KeyInput.Key] = true;
//cout << "Key was hit: " << event.KeyInput.Key << endl;
else
//cout << "Key was not hit" << endl;
this->keyStates[event.KeyInput.Key] = false;
}
return false;
}
Stable Version/1.2.3/IrrEventReciever.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRREVENTRECIEVER_H
#define IRREVENTRECIEVER_H
//#include "IrrLib.h"
#include <irrlicht.h>
#include "IrrLibBase.h"
class IrrEventReciever : public irr::IEventReceiver, public IrrLibBase
{
//private:
//IrrLib callingIrrLib;
public:
bool keyStates[irr::KEY_KEY_CODES_COUNT];
//void setIrrLib(IrrLib& IrrLib)
virtual bool OnEvent(irr::SEvent event);
};
#endif
Stable Version/1.2.3/IrrLib.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <irrlicht.h>
#include <strings.h>
#include <sstream>
#include "IrrLib.h"
//Libraries we create go here
//#include "IrrSphere.h"
#include "IrrColor.h"
//#include "Irr2D.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
//TODO: Create own class for handling inputs!
/*IrrLib::IrrLib(MastEventReceiver & receiver){
this->device = createDevice(EDT_SOFTWARE, dimension2d<s32>(640, 480), 16, false, false, false, &receiver);
if (this->device == 0)
exit(1);
IrrLib::Init();
}*/
IrrLib::IrrLib(){
this->device = createDevice(EDT_SOFTWARE, dimension2d<s32>(640, 480), 16, false, false, false, &this->IrrEvent);
if (this->device == 0)
exit(1);
IrrLib::Init();
}
IrrLib::IrrLib(video::E_DRIVER_TYPE drivertype, core::dimension2d<s32> & res, u32 bits, bool fullscreen, bool stencilbuffer, bool vsync){
//MyEventReceiver receiver;
this->device = createDevice(drivertype, res, bits, fullscreen, stencilbuffer, vsync, &this->IrrEvent);
if (this->device == 0)
exit(1);
IrrLib::Init();
}
IrrLib::IrrLib(int nDrivertype, int width, int height, int bits, bool fullscreen, bool stencilbuffer, bool vsync){
//MyEventReceiver receiver;
video::E_DRIVER_TYPE drivertype;
switch (nDrivertype){
case 0: //TODO: finish this switch case
drivertype = EDT_NULL;
break;
case 1:
drivertype = EDT_SOFTWARE;
break;
case 2:
drivertype = EDT_BURNINGSVIDEO;
break;
case 3:
drivertype = EDT_OPENGL;
break;
case 4:
drivertype = EDT_DIRECT3D8;
//*Note: It seems as Microsoft has stoped supporting DX 8.1, so you can not compile it into Irrlicht engine anymore
//TODO: Find how to detect if DX is complied into Irrlicht
//TODO: Find how to detecht for linux
break;
case 5:
drivertype = EDT_DIRECT3D9;
break;
default:
drivertype = EDT_SOFTWARE;
break;
}
this->device = createDevice(drivertype, dimension2d<s32>(width, height), bits, fullscreen, stencilbuffer, vsync, &this->IrrEvent);
if (this->device == 0)
exit(1);
IrrLib::Init();
}
IrrLib::~IrrLib (){ //Our moms wont clean up after us!
//Although I'm sure Irrlicht does this for us already, its always a good idea to check!
/*if (this->device != NULL)
delete this->device;
if (this->driver != NULL)
delete this->driver;
if (this->smgr != NULL)
delete this->smgr;
if (this->mesh != NULL)
delete this->mesh;
if (this->node != NULL)
delete this->node;*/ //it seems Irrlicht picks up after us...
//however we created newNodes, now we need to delete it!
}
void IrrLib::Init(){
//this->numNodes = 0;
//this->nodeNew = new ISceneNode[10];
//this->env->addStaticText(L"Transparent Control:", rect<s32>(20,30,300,80), true);
this->env = this->device->getGUIEnvironment();
this->driver = this->device->getVideoDriver();
this->smgr = this->device->getSceneManager();
Irr3DLib.SetSmgr(this->smgr);
Irr3DLib.SetDriver(this->driver);
Irr2DLib.SetSmgr(this->smgr);
Irr2DLib.SetDriver(this->driver);
GUI.SetEnv(this->env);
IrrEvent.SetDevice(this->device);
}
void IrrLib::ReadArchive(std::string file){
this->device->getFileSystem()->addZipFileArchive(file.c_str());
}
void IrrLib::LoadQ3Level(std::string q3level){
this->mesh = this->smgr->getMesh(q3level.c_str());
this->node = 0;
if (this->mesh)
this->node = this->smgr->addOctTreeSceneNode(this->mesh->getMesh(0), 0, -1, 128);
}
void IrrLib::MapPos(int x, int y, int z){
if (this->node)
this->node->setPosition(core::vector3df(x, y, z));
}
void IrrLib::MapPos(){
if (this->node)
this->node->setPosition(core::vector3df(0, 0, 0));
}
void IrrLib::AddFPSCam(){
this->cam = this->smgr->addCameraSceneNodeFPS();
}
void IrrLib::AddFPSCam(f32 x, f32 y, f32 z)
{
this->cam = this->smgr->addCameraSceneNodeFPS();
this->cam->setPosition(irr::core::vector3df(x, y, z));
}
void IrrLib::VisibleCursor(bool tf){
if (tf == false)
this->device->getCursorControl()->setVisible(false);
else
this->device->getCursorControl()->setVisible(true);
}
int IrrLib::GetFPSCount(){
return this->driver->getFPS();
}
bool IrrLib::DeviceIsRunning(){
return this->device->run();
}
bool IrrLib::IsActiveWindow(){
return this->device->isWindowActive();
}
void IrrLib::BeginScene(){
this->driver->beginScene(true, true, video::SColor(0,200,200,200));
}
void IrrLib::BeginScene(irr::video::SColor color){
this->driver->beginScene(true, true, color);
}
void IrrLib::BeginScene(bool usebackBuffer, bool usezBuffer, irr::video::SColor color){
this->driver->beginScene(usebackBuffer, usezBuffer, color);
}
void IrrLib::DrawAll(){
this->smgr->drawAll();
this->env->drawAll();
//this->device->getGUIEnvironment()->drawAll();
}
void IrrLib::EndScene(){
this->driver->endScene();
}
void IrrLib::SetWindowCaption(stringw str){
this->device->setWindowCaption(str.c_str());
}
irr::core::stringw IrrLib::GetDriverName(){
return this->driver->getName();
}
void IrrLib::EndIrrlicht(){
this->device->drop();
}
void IrrLib::KeyPress(char key){
this->key = key;
}
char IrrLib::KeyPressed(){
return key;
}
irr::f32 IrrLib::getX(){
return this->smgr->getActiveCamera()->getPosition().X;
}
irr::f32 IrrLib::getY(){
return this->smgr->getActiveCamera()->getPosition().Y;
}
irr::f32 IrrLib::getZ(){
return this->smgr->getActiveCamera()->getPosition().Z;
}
//template <class T> std::string IrrLib::to_string (T t)
/*std::string IrrLib::int_to_string (int t)
{
std::stringstream ss;
ss << t;
return ss.str();
}*/
// This is in the base class now, every class that decends from that class has this ability.
Stable Version/1.2.3/IrrLib.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRLIB_H
#define IRRLIB_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
#include <irrlicht.h>
/* We have to include Irrlichts libs */
#include "Irr3D.h"
#include "IrrColor.h"
#include "IrrLibGUI.h"
#include "IrrEventReciever.h"
#include "Irr2D.h"
#include "IrrLibBase.h"
//Start class
class IrrLib: public IrrLibBase {
private:
/* Create an Irrlicht device as private because the class should handle
All irrlicht interaction */
irr::IrrlichtDevice *device;
// Tells Irrlicht what driver to use
//video::E_DRIVER_TYPE driverType;
/*
Get a pointer to the video driver and the SceneManager so that
we do not always have to write device->getVideoDriver() and
device->getSceneManager().
*/
irr::video::IVideoDriver* driver;
irr::scene::ISceneManager* smgr;
irr::gui::IGUIEnvironment* env;
/*
Get a pointer to the 'mesh' aka the level.
Note: This is for Quake3 levels, ie bsp maps.
*/
irr::scene::IAnimatedMesh* mesh;
irr::scene::ISceneNode* node;
irr::scene::ISceneNode * tempNode; //use this to store nodeNew's data so we can resize it
irr::scene::ICameraSceneNode * cam;
char key;
void IrrLib::Init();
/*friend class IrrColor;
friend class Irr2DLib;
friend class Sphere;*/
friend class IrrEventReciever;
public:
//IrrSphere Sphere; //This has to be public to be able to access the Sphere class
/* IrrSphere is now in Irr3D class */
//Prehaps put this into a IrrLib3D class?
Irr3D Irr3DLib;
IrrColor Color; //Color class...not much of a class but lets keep it OO
Irr2D Irr2DLib; //1/2 variable to be labeled like this due to variables not able to begin with a number
IrrLibGUI GUI;
IrrEventReciever IrrEvent;
IrrLib::IrrLib();
//IrrLib::IrrLib(MastEventReceiver & receiver);
IrrLib::IrrLib(irr::video::E_DRIVER_TYPE drivertype, irr::core::dimension2d<irr::s32> & res, irr::u32 bits, bool fullscreen, bool stencilbuffer, bool vsync);
IrrLib::IrrLib(int drivertype, int width, int height, int bits, bool fullscreen, bool stencilbuffer, bool vsync);
IrrLib::~IrrLib(); //Our moms wont clean up after us!
void IrrLib::ReadArchive(std::string file);
void IrrLib::LoadQ3Level(std::string q3level);
void IrrLib::MapPos(int x, int y, int z); //I think this moves the actual camera?
void IrrLib::MapPos();
void IrrLib::AddFPSCam();
void IrrLib::AddFPSCam(irr::f32 x, irr::f32 y, irr::f32 z);
void IrrLib::VisibleCursor(bool tf);
int IrrLib::GetFPSCount();
bool IrrLib::DeviceIsRunning();
bool IrrLib::IsActiveWindow();
void IrrLib::BeginScene();
void IrrLib::BeginScene(irr::video::SColor color);
void IrrLib::BeginScene(bool usebackBuffer, bool usezBuffer, irr::video::SColor color);
//TODO: Add one more for human readable colors and hex colors!
void IrrLib::DrawAll();
void IrrLib::EndScene();
void IrrLib::SetWindowCaption(irr::core::stringw str);
irr::core::stringw IrrLib::GetDriverName();
//TODO: Make function to turn stringw to string and visa versa
void IrrLib::EndIrrlicht(); //Renamed from KillIrrlicht to EndIrrlicht
//TODO: Add logging
void IrrLib::KeyPress(char key);
char IrrLib::KeyPressed();
irr::f32 getX();
irr::f32 getY();
irr::f32 getZ();
//template <class T> std::string to_string (T t);
};
#endif
Stable Version/1.2.3/IrrLibBase.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <irrlicht.h>
#include "IrrLibBase.h"
#include <strings.h>
#include <sstream>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
void IrrLibBase::SetDriver(IVideoDriver* driver) //can be overloaded
{
this->driver = driver;
}
void IrrLibBase::SetSmgr(ISceneManager* smgr)
{
this->smgr = smgr;
}
std::string IrrLibBase::int_to_string (int t)
{
std::stringstream ss;
ss << t;
return ss.str();
}
std::string IrrLibBase::stringw_to_stdstring(irr::core::stringw sw)
{
std::stringstream ss;
ss << sw.c_str();
return ss.str();
}
irr::core::stringw IrrLibBase::stdstring_to_stringw(std::string ss)
{
stringw tmpw(ss.c_str());
return tmpw;
}
void IrrLibBase::SetDevice(irr::IrrlichtDevice *device)
{
this->device = device;
}
Stable Version/1.2.3/IrrLibBase.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRLIBBASE_H
#define IRRLIBBASE_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
class IrrLibBase {
protected:
irr::video::IVideoDriver* driver;
irr::scene::ISceneManager* smgr;
irr::IrrlichtDevice *device;
public:
void IrrLibBase::SetDriver(irr::video::IVideoDriver* driver);
void IrrLibBase::SetSmgr(irr::scene::ISceneManager* smgr);
void SetDevice(irr::IrrlichtDevice *device);
std::string int_to_string (int t);
std::string stringw_to_stdstring(irr::core::stringw sw);
irr::core::stringw stdstring_to_stringw(std::string ss);
};
#endif
Stable Version/1.2.3/IrrLibData.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
/*
Purpose of this class is to handle abstract data
Such as:
Stacks
Queues
Dynamic memory(arrays)
Begininers probably wont use this class too much, its used mostly for the advanced - expert programmer.
Howerver, IrrLib and other classes will make use of this class.
*/
/*class Stack {
int cap;
int count;
request *the_stack;
public:
void InitStack(int stacksize);
void Push(request value);
request Top();
request Pop();
~Stack ();
int thecount();
private:
void Push(request *&the_stack, int& nCount, int& nCap, request& value);
//void R
};
class Queue {
int cap;
int count;
request *the_queue;
public:
void InitQueue(int queuesize);
request Pop();
request Front();
request Back();
~Queue();
int thecount();
void Push(request value);
private:
void Push(request *the_stack, int nCount, int nCap, request value);
};*/
Stable Version/1.2.3/IrrLibGUI.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <strings.h>
#include <irrlicht.h>
#include "IrrLibGUI.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
IrrLibGUI::IrrLibGUI()
{
//NA does it need to do anything at init?
this->nStaticText = 0;
//this->arrStaticText = new IGUIStaticText[10];
//this->env = this->device->getGUIEnvironment(); //NA yes we do!
}
IrrLibGUI::~IrrLibGUI()
{
//NA Do we have to delete anything?
}
void IrrLibGUI::SetEnv(IGUIEnvironment* env)
{
this->env = env;
}
void IrrLibGUI::Clear()
{
this->env->clear();
}
void IrrLibGUI::DrawAll()
{
this->env->drawAll();
}
void IrrLibGUI::AddToStaticArray(irr::gui::IGUIStaticText * addme)
{
arrStaticText[nStaticText] = addme;
this->nStaticText++;
}
void IrrLibGUI::AddStaticText()
{
//rect<s32>(20,30,300,80),
this->env->addStaticText(L"Powered by IrrLib.", rect<s32>(20,30,300,80), true);
}
int IrrLibGUI::AddStaticText(std::string message)
{
irr::gui::IGUIStaticText * addthis;
stringw tmpw(message.c_str());
addthis = this->env->addStaticText(tmpw.c_str(), rect<s32>(20,30,300,80), true);
AddToStaticArray(addthis);
}
int IrrLibGUI::AddStaticText(std::string message, int x1, int y1, int x2, int y2)
{
irr::gui::IGUIStaticText * addthis;
stringw tmpw(message.c_str());
addthis = this->env->addStaticText(tmpw.c_str(), rect<s32>(x1,y1,x2,y2), true);
AddToStaticArray(addthis);
}
int IrrLibGUI::AddStaticText(std::string message, int x1, int y1, int x2, int y2, bool border, bool wordwrap)
{
irr::gui::IGUIStaticText * addthis;
stringw tmpw(message.c_str());
addthis = this->env->addStaticText(tmpw.c_str(), rect<s32>(x1,y1,x2,y2), border, wordwrap);
AddToStaticArray(addthis);
}
int IrrLibGUI::AddStaticText(std::string message, int x1, int y1, int x2, int y2, bool border, bool wordwrap, int id, bool fillbackground)
{
irr::gui::IGUIStaticText * addthis;
stringw tmpw(message.c_str());
addthis = this->env->addStaticText(tmpw.c_str(), rect<s32>(x1,y1,x2,y2), border, wordwrap, 0, id, fillbackground);
AddToStaticArray(addthis);
}
int IrrLibGUI::AddStaticText(std::string message, const core::rect< s32 > &rectangle)
{
irr::gui::IGUIStaticText * addthis;
stringw tmpw(message.c_str());
addthis = this->env->addStaticText(tmpw.c_str(), rectangle);
AddToStaticArray(addthis);
}
int IrrLibGUI::AddStaticText(std::string message, const core::rect< s32 > &rectangle, bool border, bool wordwrap)
{
irr::gui::IGUIStaticText * addthis;
stringw tmpw(message.c_str());
addthis = this->env->addStaticText(tmpw.c_str(), rectangle, border, wordwrap);
AddToStaticArray(addthis);
}
int IrrLibGUI::AddStaticText(std::string message, const core::rect< s32 > &rectangle, bool border, bool wordwrap, int id, bool fillbackground)
{
irr::gui::IGUIStaticText * addthis;
stringw tmpw(message.c_str());
addthis = this->env->addStaticText(tmpw.c_str(), rectangle, border, wordwrap, 0, id, fillbackground);
AddToStaticArray(addthis);
}
void IrrLibGUI::ChangeStaticText(int nstatictext, std::string message)
{
stringw tmpw(message.c_str());
this->arrStaticText[this->nStaticText-1]->setText(tmpw.c_str());
}
void IrrLibGUI::ChangeFont(std::string fontfile)
{
IGUISkin* skin = this->env->getSkin();
IGUIFont* font = this->env->getFont(fontfile.c_str());
if (font)
skin->setFont(font);
}
Stable Version/1.2.3/IrrLibGUI.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRLIBGUI_H
#define IRRLIBGUI_H
#include <iostream>
#include <strings.h>
#include <irrlicht.h>
#include "IrrLibBase.h"
class IrrLibGUI: public IrrLibBase {
private:
irr::gui::IGUISkin* skin;
irr::gui::IGUIFont* font;
irr::gui::IGUIEnvironment* env;
//TODO: Create an array storing all messages
int nStaticText;
irr::gui::IGUIStaticText* arrStaticText[10];
void AddToStaticArray(irr::gui::IGUIStaticText * addme);
public:
IrrLibGUI();
~IrrLibGUI();
void SetEnv(irr::gui::IGUIEnvironment* env);
void Clear();
void DrawAll();
//irr::gui::IGUIStaticText* IrrLibGUI::AddStaticText(); //NA eh a default text adder why not?
/* This is bad coding, we do not want to return an irrlicht object, we want to return a standard datatype because this class handles the GUI elements, not the user. */
void AddStaticText(); //NA eh a default text adder why not?
int AddStaticText(std::string message);
int AddStaticText(std::string message, int x1, int y1, int x2, int y2);
int AddStaticText(std::string message, int x1, int y1, int x2, int y2, bool border, bool wordwrap);
int AddStaticText(std::string message, int x1, int y1, int x2, int y2, bool border, bool wordwrap, int id, bool fillbackground);
int AddStaticText(std::string message, const irr::core::rect< irr::s32 > &rectangle);
int AddStaticText(std::string message, const irr::core::rect< irr::s32 > &rectangle, bool border, bool wordwrap);
int AddStaticText(std::string message, const irr::core::rect< irr::s32 > &rectangle, bool border, bool wordwrap, int id, bool fillbackground);
void ChangeStaticText(int nstatictext, std::string message);
void ChangeFont(std::string fontfile);
};
#endif
Stable Version/1.2.3/IrrSphere.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include "IrrLib.h"
#include "IrrSphere.h"
#include <irrlicht.h>
#include <strings.h>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
void IrrSphere::SetSmgr(irr::scene::ISceneManager* smgr){
this->smgr = smgr;
}
void IrrSphere::SetDriver(irr::video::IVideoDriver* driver){
this->driver = driver;
}
int IrrSphere::CreateNewSphereNode(int x, int y, int z, std::string texture, bool light){
//TODO: Resize after 10, and add 10 more to the mix!
this->nodeNew[this->numNodes] = this->smgr->addSphereSceneNode();
this->nodeNew[this->numNodes]->setPosition(core::vector3df(x,y,z));
this->nodeNew[this->numNodes]->setMaterialTexture(0, this->driver->getTexture(texture.c_str()));
this->nodeNew[this->numNodes]->setMaterialFlag(video::EMF_LIGHTING, light);
this->numNodes++;
return this->numNodes--;
/*this->node = this->smgr->addSphereSceneNode();
this->node->setPosition(core::vector3df(x,y,z));
this->node->setMaterialTexture(0, this->driver->getTexture(texture.c_str()));
this->node->setMaterialFlag(video::EMF_LIGHTING, light);*/
}
irr::core::vector3df IrrSphere::GetSphereVector(int sphere){
return this->nodeNew[sphere]->getPosition();
}
void IrrSphere::SetSphereVector(int sphere, irr::core::vector3df v){
this->nodeNew[sphere]->setPosition(v);
}
IrrSphere::IrrSphere(){
this->numNodes = 0;
}
IrrSphere::~IrrSphere(){
for(int i = 0; i < numNodes; ++i)
delete this->nodeNew[i];
delete this->nodeNew;
}
Stable Version/1.2.3/IrrSphere.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRSPHERE_H
#define IRRSPHERE_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
//#include "IrrLib.h"
class IrrSphere
{
private:
irr::scene::ISceneNode* nodeNew[10];
int numNodes;
irr::scene::ISceneManager* smgr;
irr::video::IVideoDriver* driver;
public:
void IrrSphere::SetDriver(irr::video::IVideoDriver* driver);
void IrrSphere::SetSmgr(irr::scene::ISceneManager* smgr);
int IrrSphere::CreateNewSphereNode(int x, int y, int z, std::string texture, bool light); //this is going to take my advanced C++ skillz!
irr::core::vector3df IrrSphere::GetSphereVector(int sphere);
void IrrSphere::SetSphereVector(int sphere, irr::core::vector3df v);
IrrSphere::IrrSphere();
//IrrSphere::IrrSphere(IrrLib*);
IrrSphere::~IrrSphere();
};
#endif
Stable Version/1.2.3/IrrSprite.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <irrlicht.h>
#include <strings.h>
#include "IrrLib.h"
//Libraries we create go here
//#include "IrrSphere.h"
#include "IrrColor.h"
#include "IrrSprite.h"
//#include "Irr2D.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
IrrSprite::IrrSprite()
{
//do stuff
}
IrrSprite::~IrrSprite()
{
//delete stuff
}
void IrrSprite::SetDriver(irr::video::IVideoDriver* driver)
{
this->driver = driver;
}
void IrrSprite::SetSmgr(irr::scene::ISceneManager* smgr)
{
this->smgr = smgr;
}
Stable Version/1.2.3/IrrSprite.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRSPRITE_H
#define IRRSPRITE_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
//#include "IrrSphere.h"
#include "IrrColor.h"
//#include "Irr2D.h"
//#include "IrrSprite.h"
//Start class
class IrrSprite {
private:
irr::video::IVideoDriver* driver;
irr::scene::ISceneManager* smgr;
public:
IrrSprite::IrrSprite();
IrrSprite::~IrrSprite();
void IrrSprite::SetDriver(irr::video::IVideoDriver* driver);
void IrrSprite::SetSmgr(irr::scene::ISceneManager* smgr);
// I forgot a semicolon here....and it wasn't compling
//Thats 1 bad thing about OOP if there is an error you don't know where the @#$@# the problem is!
};
#endif
Stable Version/1.2.3/README
1
2
3
4
5
6
7
8
9
10
11
12
13
Irrlicht Library Wrapper
Created by Nathan Adams
Version 1.2.3
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
Please leave all files intact if you redistrubte this software.
How to use:
Add all the files to your Irrlicht project, you could compile it into a DLL if you wanted too, but for now just add all the files to your project.
Then inside your complier add the directory that you have the IrrLib files and use #include "IrrLib.h" to refrence it, and you are good to go!
Stable Version/1.2.4/CHANGES
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
Version 1.2
+ Added a Irr3DLib class that will control all 3D objects
+ Also Added a Irr2D class that works on the same concept.
+ IrrSphere is now owned by Irr3DLib
+ Updated the examples using the latest code
Version 1.2.2
+ Added IrrEventReciever to handle all input
- Still under work
+ Fixed some misc coding bugs
+ Added template class
+ Added sprite class
+ Added GUI class
Version 1.2.3
+ IrrEventReciver now works as advertised
+ Baseclass is now being used
+ A couple somewhat-useful functions
+ int_to_string
+ stringw_to_stdstring
+ stdstring_to_stringw
+ GUI elements
+ Static text is working
+ Under construction for a data type class
Version 1.2.4
+ Implmented color codes accessiable through the class
+ IrrLib.Color.RED (ect)
Stable Version/1.2.4/CREDITS
1
2
3
4
5
6
7
IrrLib
Created by
Nathan Adams
Denzel Morris
From #irrlicht
Acid
Stable Version/1.2.4/Irr2D.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
//#include "IrrLib.h"
//#include "IrrSphere.h" //You probably aren't going to be using 3D objects in a 2D environment!
#include <irrlicht.h>
#include <strings.h>
#include "Irr2D.h"
#include "IrrSprite.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
Irr2D::Irr2D(){
this->numTextures = 0;
//NA Should we set textures to new
}
Irr2D::~Irr2D(){
for(int i = 0; i < numTextures; ++i)
delete this->textures[i];
delete this->textures;
}
void Irr2D::SetSmgr(irr::scene::ISceneManager* smgr){
this->smgr = smgr;
Sprite.SetSmgr(smgr);
}
void Irr2D::SetDriver(irr::video::IVideoDriver* driver){
this->driver = driver;
Sprite.SetDriver(driver);
}
void Irr2D::LoadTexturemap(std::string file){
this->texturemap = driver->getTexture(file.c_str());
}
int Irr2D::LoadTexture(std::string file){
this->textures[this->numTextures] = driver->getTexture(file.c_str());
this->numTextures++;
return numTextures--;
}
Stable Version/1.2.4/Irr2D.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRR2D_H
#define IRR2D_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
//#include "IrrLib.h"
#include "IrrSprite.h"
class Irr2D {
private:
irr::scene::ISceneManager* smgr;
irr::video::IVideoDriver* driver;
irr::video::ITexture* texturemap;
int numTextures;
irr::video::ITexture* textures[10];
public:
//Irr2D::Irr2D();
IrrSprite Sprite;
Irr2D::Irr2D();
Irr2D::~Irr2D();
void Irr2D::SetDriver(irr::video::IVideoDriver* driver);
void Irr2D::SetSmgr(irr::scene::ISceneManager* smgr);
void Irr2D::LoadTexturemap(std::string file);
int Irr2D::LoadTexture(std::string file);
void Irr2D::DrawImage(int texture, const irr::core::position2d<irr::s32> & destPos);
void Irr2D::DrawImage(const irr::core::position2d<irr::s32> & destPos, const irr::core::rect<irr::s32> & sourceRect, const irr::core::rect<irr::s32> * clipRect, irr::video::SColor color, bool useAlphaChannelOfTexture);
void Irr2D::DrawLine(const irr::core::position2d<irr::s32> & start, const irr::core::position2d<irr::s32> & end, irr::video::SColor color);
};
#endif
Stable Version/1.2.4/Irr3D.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <strings.h>
//#include "IrrLib.h"
//Libraries we create go here
#include "IrrSphere.h"
//#include "IrrColor.h"
#include "Irr3D.h"
#include <irrlicht.h>
//#include "Irr2D.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
void Irr3D::SetDriver(irr::video::IVideoDriver* driver) //so much for copying and pasting code from the header file
{
this->driver = driver;
Sphere.SetDriver(driver);
}
void Irr3D::SetSmgr(irr::scene::ISceneManager* smgr)
{
this->smgr = smgr;
Sphere.SetSmgr(smgr);
}
Irr3D::Irr3D()
{
//do stuff here!
}
Irr3D::~Irr3D()
{
//delete stuff here!
}
Stable Version/1.2.4/Irr3D.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRR3D_H
#define IRR3D_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
#include "IrrSphere.h"
//#include "IrrColor.h"
//#include "Irr3D.h"
//#include "Irr2D.h" This is a 3D class not 2D
/* However due to Irrlciht's nature mixing 2D with 3D is possible */
//Start class
class Irr3D {
private:
irr::video::IVideoDriver* driver;
irr::scene::ISceneManager* smgr;
public:
IrrSphere Sphere;
Irr3D::Irr3D();
Irr3D::~Irr3D();
void Irr3D::SetDriver(irr::video::IVideoDriver* driver);
void Irr3D::SetSmgr(irr::scene::ISceneManager* smgr);
};
#endif
Stable Version/1.2.4/IrrColor.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <irrlicht.h>
#include <strings.h>
//#include "IrrLib.h"
#include "IrrColor.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
void IrrColor::Init(){
/*SColor * temp;
temp = new SColor(alpha, 255, 0, 0);
this->RED = temp;
delete temp;*/
this->RED = SColor(alpha, 255, 0, 0);
this->ORANGE = SColor(alpha, 255, 165, 0);
this->YELLOW = SColor(alpha, 255, 255, 0);
this->GREEN = SColor(alpha, 0, 255, 0);
this->BLUE = SColor(alpha, 0, 0, 255);
this->DARK_GREEN = SColor(alpha, 0, 100, 0);
this->PINK = SColor(alpha, 255, 192, 203);
this->GREY = SColor(alpha, 190, 190, 190);
}
IrrColor::~IrrColor(){
//delete this->RED;
}
IrrColor::IrrColor(){
this->alpha = 255;
Init();
}
IrrColor::IrrColor(irr::u32 alpha){
this->alpha = alpha;
Init();
}
int IrrColor::getAlpha(){
return this->alpha;
}
void IrrColor::setAlpha(int alpha){
this->alpha = alpha;
}
SColor IrrColor::returnColor(std::string color){
int nColor = -1;
if (color == "red")
nColor = 1;
else if (color == "green")
nColor = 2;
else if (color == "blue")
nColor = 3;
else if (color == "dark green")
nColor = 4;
else if (color == "pink")
nColor = 5;
else if (color == "grey")
nColor = 6;
switch (nColor){
case 1:
return SColor(255, 255, 0, 0);
break;
case 2:
return SColor(255, 0, 255, 0);
break;
case 3:
return SColor(255, 0, 0, 255);
break;
case 4:
return SColor(255, 0, 50, 0);
break;
case 5:
return SColor(255, 255, 10, 255);
break;
case 6:
return SColor(255,200,200,200);
break;
default:
return SColor(255,200,200,200);
break;
}// TODO: Make this function modular
}
Stable Version/1.2.4/IrrColor.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRCOLOR_H
#define IRRCOLOR_H
#include <iostream>
#include <strings.h>
#include "irrlicht.h"
//#include "IrrLib.h"
class IrrColor {
private:
irr::u32 alpha;
void Init();
//who knows?
public:
//irr::video::SColor(alpha, 255, 0, 0);
irr::video::SColor RED;
irr::video::SColor ORANGE;
irr::video::SColor YELLOW;
irr::video::SColor GREEN;
irr::video::SColor BLUE;
irr::video::SColor DARK_GREEN;
irr::video::SColor PINK;
irr::video::SColor GREY;
/*const ORANGE = irr::video::SColor(alpha, 255, 165, 0);
const YELLOW = irr::video::SColor(alpha, 255, 255, 0);
const GREEN = irr::video::SColor(alpha, 0, 255, 0);
const BLUE = irr::video::SColor(alpha, 0, 0, 255);
const DARK_GREEN = irr::video::SColor(alpha, 0, 100, 0);
const PINK = irr::video::SColor(alpha, 255, 192, 203);
const GREY = irr::video::Scolor(alpha, 190, 190, 190);*/
//void IrrColor::test();
IrrColor();
IrrColor(irr::u32 alpha);
~IrrColor();
int getAlpha();
void setAlpha(int alpha);
irr::video::SColor IrrColor::returnColor(std::string color);
};
#endif
Stable Version/1.2.4/IrrEventReciever.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include "IrrEventReciever.h"
//#include "IrrLib.h"
#include <irrlicht.h>
#include <iostream>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
/*void IrrEventReciever::setIrrLib(IrrLib& IrrLib)
{
this.callingIrrLib = IrrLib;
}*/
bool IrrEventReciever::OnEvent(SEvent event)
{
if (event.EventType == irr::EET_KEY_INPUT_EVENT) {
if (!event.KeyInput.PressedDown){
this->keyStates[event.KeyInput.Key] = false;
//cout << "Key was not hit " << this->keyStates[event.KeyInput.Key] << endl;
}
else{
this->keyStates[event.KeyInput.Key] = true;
//cout << "Key was hit: " << event.KeyInput.Key << " " << this->keyStates[event.KeyInput.Key] << endl;
}
}
return false;
}
Stable Version/1.2.4/IrrEventReciever.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRREVENTRECIEVER_H
#define IRREVENTRECIEVER_H
//#include "IrrLib.h"
#include <irrlicht.h>
#include "IrrLibBase.h"
class IrrEventReciever : public irr::IEventReceiver, public IrrLibBase
{
//private:
//IrrLib callingIrrLib;
public:
bool keyStates[irr::KEY_KEY_CODES_COUNT];
//void setIrrLib(IrrLib& IrrLib)
virtual bool OnEvent(irr::SEvent event);
};
#endif
Stable Version/1.2.4/IrrLib.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <irrlicht.h>
#include <strings.h>
#include <sstream>
#include <time.h>
#include "IrrLib.h"
//Libraries we create go here
//#include "IrrSphere.h"
#include "IrrColor.h"
//#include "Irr2D.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
//TODO: Create own class for handling inputs!
/*IrrLib::IrrLib(MastEventReceiver & receiver){
this->device = createDevice(EDT_SOFTWARE, dimension2d<s32>(640, 480), 16, false, false, false, &receiver);
if (this->device == 0)
exit(1);
IrrLib::Init();
}*/
IrrLib::IrrLib(){
this->device = createDevice(EDT_SOFTWARE, dimension2d<s32>(640, 480), 16, false, false, false, &this->IrrEvent);
if (this->device == 0)
exit(1);
IrrLib::Init();
}
IrrLib::IrrLib(video::E_DRIVER_TYPE drivertype, core::dimension2d<s32> & res, u32 bits, bool fullscreen, bool stencilbuffer, bool vsync){
//MyEventReceiver receiver;
this->device = createDevice(drivertype, res, bits, fullscreen, stencilbuffer, vsync, &this->IrrEvent);
if (this->device == 0)
exit(1);
IrrLib::Init();
}
IrrLib::IrrLib(int nDrivertype, int width, int height, int bits, bool fullscreen, bool stencilbuffer, bool vsync){
//MyEventReceiver receiver;
video::E_DRIVER_TYPE drivertype;
switch (nDrivertype){
case 0: //TODO: finish this switch case
drivertype = EDT_NULL;
break;
case 1:
drivertype = EDT_SOFTWARE;
break;
case 2:
drivertype = EDT_BURNINGSVIDEO;
break;
case 3:
drivertype = EDT_OPENGL;
break;
case 4:
drivertype = EDT_DIRECT3D8;
//*Note: It seems as Microsoft has stoped supporting DX 8.1, so you can not compile it into Irrlicht engine anymore
//TODO: Find how to detect if DX is complied into Irrlicht
//TODO: Find how to detecht for linux
break;
case 5:
drivertype = EDT_DIRECT3D9;
break;
default:
drivertype = EDT_SOFTWARE;
break;
}
this->device = createDevice(drivertype, dimension2d<s32>(width, height), bits, fullscreen, stencilbuffer, vsync, &this->IrrEvent);
if (this->device == 0)
exit(1);
IrrLib::Init();
}
IrrLib::~IrrLib (){ //Our moms wont clean up after us!
//Although I'm sure Irrlicht does this for us already, its always a good idea to check!
/*if (this->device != NULL)
delete this->device;
if (this->driver != NULL)
delete this->driver;
if (this->smgr != NULL)
delete this->smgr;
if (this->mesh != NULL)
delete this->mesh;
if (this->node != NULL)
delete this->node;*/ //it seems Irrlicht picks up after us...
//however we created newNodes, now we need to delete it!
}
void IrrLib::Init(){
//this->numNodes = 0;
//this->nodeNew = new ISceneNode[10];
//this->env->addStaticText(L"Transparent Control:", rect<s32>(20,30,300,80), true);
this->env = this->device->getGUIEnvironment();
this->driver = this->device->getVideoDriver();
this->smgr = this->device->getSceneManager();
Irr3DLib.SetSmgr(this->smgr);
Irr3DLib.SetDriver(this->driver);
Irr2DLib.SetSmgr(this->smgr);
Irr2DLib.SetDriver(this->driver);
GUI.SetEnv(this->env);
IrrEvent.SetDevice(this->device);
this->timer = this->device->getTimer();
tick = this->timer->getRealTime();
}
void IrrLib::ReadArchive(std::string file){
this->device->getFileSystem()->addZipFileArchive(file.c_str());
}
void IrrLib::LoadQ3Level(std::string q3level){
this->mesh = this->smgr->getMesh(q3level.c_str());
this->node = 0;
if (this->mesh)
this->node = this->smgr->addOctTreeSceneNode(this->mesh->getMesh(0), 0, -1, 128);
}
void IrrLib::MapPos(int x, int y, int z){
if (this->node)
this->node->setPosition(core::vector3df(x, y, z));
}
void IrrLib::MapPos(){
if (this->node)
this->node->setPosition(core::vector3df(0, 0, 0));
}
void IrrLib::AddFPSCam(){
this->cam = this->smgr->addCameraSceneNodeFPS();
}
void IrrLib::AddFPSCam(f32 x, f32 y, f32 z)
{
this->cam = this->smgr->addCameraSceneNodeFPS();
this->cam->setPosition(irr::core::vector3df(x, y, z));
}
void IrrLib::VisibleCursor(bool tf){
if (tf == false)
this->device->getCursorControl()->setVisible(false);
else
this->device->getCursorControl()->setVisible(true);
}
int IrrLib::GetFPSCount(){
return this->driver->getFPS();
}
bool IrrLib::DeviceIsRunning(){
return this->device->run();
}
bool IrrLib::IsActiveWindow(){
return this->device->isWindowActive();
}
void IrrLib::BeginScene(){
this->driver->beginScene(true, true, video::SColor(0,200,200,200));
}
void IrrLib::BeginScene(irr::video::SColor color){
this->driver->beginScene(true, true, color);
}
void IrrLib::BeginScene(bool usebackBuffer, bool usezBuffer, irr::video::SColor color){
this->driver->beginScene(usebackBuffer, usezBuffer, color);
}
void IrrLib::DrawAll(){
this->smgr->drawAll();
this->env->drawAll();
//this->device->getGUIEnvironment()->drawAll();
}
void IrrLib::EndScene(){
this->driver->endScene();
}
void IrrLib::SetWindowCaption(stringw str){
this->device->setWindowCaption(str.c_str());
}
irr::core::stringw IrrLib::GetDriverName(){
return this->driver->getName();
}
void IrrLib::EndIrrlicht(){
if(this->device != NULL){
this->device->drop();
this->device = NULL;
}
}
void IrrLib::KeyPress(char key){
this->key = key;
}
char IrrLib::KeyPressed(){
return key;
}
irr::f32 IrrLib::getX(){
return this->smgr->getActiveCamera()->getPosition().X;
}
irr::f32 IrrLib::getY(){
return this->smgr->getActiveCamera()->getPosition().Y;
}
irr::f32 IrrLib::getZ(){
return this->smgr->getActiveCamera()->getPosition().Z;
}
bool IrrLib::CheckGameLoop(){
u32 now;
now = this->timer->getRealTime();
if ((now - this->tick) >= 30){
//this->tick == time (NULL);
return true;
} else {
return false;
}
}
bool IrrLib::CheckGameLoop(u32 ms){
u32 now;
now = this->timer->getRealTime();
if ((now - this->tick) >= ms){
this->tick = now;
return true;
} else {
return false;
}
}
void IrrLib::Exit()
{
this->device->closeDevice();
}
//template <class T> std::string IrrLib::to_string (T t)
/*std::string IrrLib::int_to_string (int t)
{
std::stringstream ss;
ss << t;
return ss.str();
}*/
// This is in the base class now, every class that decends from that class has this ability.
Stable Version/1.2.4/IrrLib.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRLIB_H
#define IRRLIB_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
#include <irrlicht.h>
#include <time.h>
/* We have to include Irrlichts libs */
#include "Irr3D.h"
#include "IrrColor.h"
#include "IrrLibGUI.h"
#include "IrrEventReciever.h"
#include "Irr2D.h"
#include "IrrLibBase.h"
//Start class
class IrrLib: public IrrLibBase {
private:
/* Create an Irrlicht device as private because the class should handle
All irrlicht interaction */
irr::IrrlichtDevice *device;
// Tells Irrlicht what driver to use
//video::E_DRIVER_TYPE driverType;
/*
Get a pointer to the video driver and the SceneManager so that
we do not always have to write device->getVideoDriver() and
device->getSceneManager().
*/
irr::video::IVideoDriver* driver;
irr::scene::ISceneManager* smgr;
irr::gui::IGUIEnvironment* env;
/*
Get a pointer to the 'mesh' aka the level.
Note: This is for Quake3 levels, ie bsp maps.
*/
irr::scene::IAnimatedMesh* mesh;
irr::scene::ISceneNode* node;
irr::scene::ISceneNode * tempNode; //use this to store nodeNew's data so we can resize it
irr::scene::ICameraSceneNode * cam;
char key;
void IrrLib::Init();
/*friend class IrrColor;
friend class Irr2DLib;
friend class Sphere;*/
friend class IrrEventReciever;
irr::u32 tick;
irr::ITimer* timer;
public:
//IrrSphere Sphere; //This has to be public to be able to access the Sphere class
/* IrrSphere is now in Irr3D class */
//Prehaps put this into a IrrLib3D class?
Irr3D Irr3DLib;
IrrColor Color; //Color class...not much of a class but lets keep it OO
Irr2D Irr2DLib; //1/2 variable to be labeled like this due to variables not able to begin with a number
IrrLibGUI GUI;
IrrEventReciever IrrEvent;
IrrLib::IrrLib();
//IrrLib::IrrLib(MastEventReceiver & receiver);
IrrLib::IrrLib(irr::video::E_DRIVER_TYPE drivertype, irr::core::dimension2d<irr::s32> & res, irr::u32 bits, bool fullscreen, bool stencilbuffer, bool vsync);
IrrLib::IrrLib(int drivertype, int width, int height, int bits, bool fullscreen, bool stencilbuffer, bool vsync);
IrrLib::~IrrLib(); //Our moms wont clean up after us!
void IrrLib::ReadArchive(std::string file);
void IrrLib::LoadQ3Level(std::string q3level);
void IrrLib::MapPos(int x, int y, int z); //I think this moves the actual camera?
void IrrLib::MapPos();
void IrrLib::AddFPSCam();
void IrrLib::AddFPSCam(irr::f32 x, irr::f32 y, irr::f32 z);
void IrrLib::VisibleCursor(bool tf);
int IrrLib::GetFPSCount();
bool IrrLib::DeviceIsRunning();
bool IrrLib::IsActiveWindow();
void IrrLib::BeginScene();
void IrrLib::BeginScene(irr::video::SColor color);
//void IrrLib::BeginScene(irr::video::SColor * color);
void IrrLib::BeginScene(bool usebackBuffer, bool usezBuffer, irr::video::SColor color);
//TODO: Add one more for human readable colors and hex colors!
void IrrLib::DrawAll();
void IrrLib::EndScene();
void IrrLib::SetWindowCaption(irr::core::stringw str);
irr::core::stringw IrrLib::GetDriverName();
//TODO: Make function to turn stringw to string and visa versa
void IrrLib::EndIrrlicht(); //Renamed from KillIrrlicht to EndIrrlicht
//TODO: Add logging
void IrrLib::KeyPress(char key);
char IrrLib::KeyPressed();
irr::f32 getX();
irr::f32 getY();
irr::f32 getZ();
bool CheckGameLoop();
bool CheckGameLoop(irr::u32 ms);
void Exit();
//void EndGameLoop();
//template <class T> std::string to_string (T t);
};
#endif
Stable Version/1.2.4/IrrLibBase.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <irrlicht.h>
#include "IrrLibBase.h"
#include <strings.h>
#include <sstream>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
void IrrLibBase::SetDriver(IVideoDriver* driver) //can be overloaded
{
this->driver = driver;
}
void IrrLibBase::SetSmgr(ISceneManager* smgr)
{
this->smgr = smgr;
}
std::string IrrLibBase::int_to_string (int t)
{
std::stringstream ss;
ss << t;
return ss.str();
}
std::string IrrLibBase::stringw_to_stdstring(irr::core::stringw sw)
{
std::stringstream ss;
ss << sw.c_str();
return ss.str();
}
irr::core::stringw IrrLibBase::stdstring_to_stringw(std::string ss)
{
stringw tmpw(ss.c_str());
return tmpw;
}
void IrrLibBase::SetDevice(irr::IrrlichtDevice *device)
{
this->device = device;
}
Stable Version/1.2.4/IrrLibBase.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRLIBBASE_H
#define IRRLIBBASE_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
class IrrLibBase {
protected:
irr::video::IVideoDriver* driver;
irr::scene::ISceneManager* smgr;
irr::IrrlichtDevice *device;
public:
void IrrLibBase::SetDriver(irr::video::IVideoDriver* driver);
void IrrLibBase::SetSmgr(irr::scene::ISceneManager* smgr);
void SetDevice(irr::IrrlichtDevice *device);
std::string int_to_string (int t);
std::string stringw_to_stdstring(irr::core::stringw sw);
irr::core::stringw stdstring_to_stringw(std::string ss);
};
#endif
Stable Version/1.2.4/IrrLibData.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
/*
Purpose of this class is to handle abstract data
Such as:
Stacks
Queues
Dynamic memory(arrays)
Begininers probably wont use this class too much, its used mostly for the advanced - expert programmer.
Howerver, IrrLib and other classes will make use of this class.
*/
/*class Stack {
int cap;
int count;
request *the_stack;
public:
void InitStack(int stacksize);
void Push(request value);
request Top();
request Pop();
~Stack ();
int thecount();
private:
void Push(request *&the_stack, int& nCount, int& nCap, request& value);
//void R
};
class Queue {
int cap;
int count;
request *the_queue;
public:
void InitQueue(int queuesize);
request Pop();
request Front();
request Back();
~Queue();
int thecount();
void Push(request value);
private:
void Push(request *the_stack, int nCount, int nCap, request value);
};*/
Stable Version/1.2.4/IrrLibGUI.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <strings.h>
#include <irrlicht.h>
#include "IrrLibGUI.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
IrrLibGUI::IrrLibGUI()
{
//NA does it need to do anything at init?
this->nStaticText = 0;
//this->arrStaticText = new IGUIStaticText[10];
//this->env = this->device->getGUIEnvironment(); //NA yes we do!
}
IrrLibGUI::~IrrLibGUI()
{
//NA Do we have to delete anything?
}
void IrrLibGUI::SetEnv(IGUIEnvironment* env)
{
this->env = env;
}
void IrrLibGUI::Clear()
{
this->env->clear();
}
void IrrLibGUI::DrawAll()
{
this->env->drawAll();
}
void IrrLibGUI::AddToStaticArray(irr::gui::IGUIStaticText * addme)
{
arrStaticText[nStaticText] = addme;
this->nStaticText++;
}
void IrrLibGUI::AddStaticText()
{
//rect<s32>(20,30,300,80),
this->env->addStaticText(L"Powered by IrrLib.", rect<s32>(20,30,300,80), true);
}
int IrrLibGUI::AddStaticText(std::string message)
{
irr::gui::IGUIStaticText * addthis;
stringw tmpw(message.c_str());
addthis = this->env->addStaticText(tmpw.c_str(), rect<s32>(20,30,300,80), true);
AddToStaticArray(addthis);
}
int IrrLibGUI::AddStaticText(std::string message, int x1, int y1, int x2, int y2)
{
irr::gui::IGUIStaticText * addthis;
stringw tmpw(message.c_str());
addthis = this->env->addStaticText(tmpw.c_str(), rect<s32>(x1,y1,x2,y2), true);
AddToStaticArray(addthis);
}
int IrrLibGUI::AddStaticText(std::string message, int x1, int y1, int x2, int y2, bool border, bool wordwrap)
{
irr::gui::IGUIStaticText * addthis;
stringw tmpw(message.c_str());
addthis = this->env->addStaticText(tmpw.c_str(), rect<s32>(x1,y1,x2,y2), border, wordwrap);
AddToStaticArray(addthis);
}
int IrrLibGUI::AddStaticText(std::string message, int x1, int y1, int x2, int y2, bool border, bool wordwrap, int id, bool fillbackground)
{
irr::gui::IGUIStaticText * addthis;
stringw tmpw(message.c_str());
addthis = this->env->addStaticText(tmpw.c_str(), rect<s32>(x1,y1,x2,y2), border, wordwrap, 0, id, fillbackground);
AddToStaticArray(addthis);
}
int IrrLibGUI::AddStaticText(std::string message, const core::rect< s32 > &rectangle)
{
irr::gui::IGUIStaticText * addthis;
stringw tmpw(message.c_str());
addthis = this->env->addStaticText(tmpw.c_str(), rectangle);
AddToStaticArray(addthis);
}
int IrrLibGUI::AddStaticText(std::string message, const core::rect< s32 > &rectangle, bool border, bool wordwrap)
{
irr::gui::IGUIStaticText * addthis;
stringw tmpw(message.c_str());
addthis = this->env->addStaticText(tmpw.c_str(), rectangle, border, wordwrap);
AddToStaticArray(addthis);
}
int IrrLibGUI::AddStaticText(std::string message, const core::rect< s32 > &rectangle, bool border, bool wordwrap, int id, bool fillbackground)
{
irr::gui::IGUIStaticText * addthis;
stringw tmpw(message.c_str());
addthis = this->env->addStaticText(tmpw.c_str(), rectangle, border, wordwrap, 0, id, fillbackground);
AddToStaticArray(addthis);
}
void IrrLibGUI::ChangeStaticText(int nstatictext, std::string message)
{
stringw tmpw(message.c_str());
this->arrStaticText[this->nStaticText-1]->setText(tmpw.c_str());
}
void IrrLibGUI::ChangeFont(std::string fontfile)
{
IGUISkin* skin = this->env->getSkin();
IGUIFont* font = this->env->getFont(fontfile.c_str());
if (font)
skin->setFont(font);
}
Stable Version/1.2.4/IrrLibGUI.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRLIBGUI_H
#define IRRLIBGUI_H
#include <iostream>
#include <strings.h>
#include <irrlicht.h>
#include "IrrLibBase.h"
class IrrLibGUI: public IrrLibBase {
private:
irr::gui::IGUISkin* skin;
irr::gui::IGUIFont* font;
irr::gui::IGUIEnvironment* env;
//TODO: Create an array storing all messages
int nStaticText;
irr::gui::IGUIStaticText* arrStaticText[10];
void AddToStaticArray(irr::gui::IGUIStaticText * addme);
public:
IrrLibGUI();
~IrrLibGUI();
void SetEnv(irr::gui::IGUIEnvironment* env);
void Clear();
void DrawAll();
//irr::gui::IGUIStaticText* IrrLibGUI::AddStaticText(); //NA eh a default text adder why not?
/* This is bad coding, we do not want to return an irrlicht object, we want to return a standard datatype because this class handles the GUI elements, not the user. */
void AddStaticText(); //NA eh a default text adder why not?
int AddStaticText(std::string message);
int AddStaticText(std::string message, int x1, int y1, int x2, int y2);
int AddStaticText(std::string message, int x1, int y1, int x2, int y2, bool border, bool wordwrap);
int AddStaticText(std::string message, int x1, int y1, int x2, int y2, bool border, bool wordwrap, int id, bool fillbackground);
int AddStaticText(std::string message, const irr::core::rect< irr::s32 > &rectangle);
int AddStaticText(std::string message, const irr::core::rect< irr::s32 > &rectangle, bool border, bool wordwrap);
int AddStaticText(std::string message, const irr::core::rect< irr::s32 > &rectangle, bool border, bool wordwrap, int id, bool fillbackground);
void ChangeStaticText(int nstatictext, std::string message);
void ChangeFont(std::string fontfile);
};
#endif
Stable Version/1.2.4/IrrSphere.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include "IrrLib.h"
#include "IrrSphere.h"
#include <irrlicht.h>
#include <strings.h>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
void IrrSphere::SetSmgr(irr::scene::ISceneManager* smgr){
this->smgr = smgr;
}
void IrrSphere::SetDriver(irr::video::IVideoDriver* driver){
this->driver = driver;
}
int IrrSphere::CreateNewSphereNode(int x, int y, int z, std::string texture, bool light){
//TODO: Resize after 10, and add 10 more to the mix!
this->nodeNew[this->numNodes] = this->smgr->addSphereSceneNode();
this->nodeNew[this->numNodes]->setPosition(core::vector3df(x,y,z));
this->nodeNew[this->numNodes]->setMaterialTexture(0, this->driver->getTexture(texture.c_str()));
this->nodeNew[this->numNodes]->setMaterialFlag(video::EMF_LIGHTING, light);
this->numNodes++;
return this->numNodes--;
/*this->node = this->smgr->addSphereSceneNode();
this->node->setPosition(core::vector3df(x,y,z));
this->node->setMaterialTexture(0, this->driver->getTexture(texture.c_str()));
this->node->setMaterialFlag(video::EMF_LIGHTING, light);*/
}
irr::core::vector3df IrrSphere::GetSphereVector(int sphere){
return this->nodeNew[sphere]->getPosition();
}
void IrrSphere::SetSphereVector(int sphere, irr::core::vector3df v){
this->nodeNew[sphere]->setPosition(v);
}
IrrSphere::IrrSphere(){
this->numNodes = 0;
}
IrrSphere::~IrrSphere(){
for(int i = 0; i < numNodes; ++i)
delete this->nodeNew[i];
delete this->nodeNew;
}
Stable Version/1.2.4/IrrSphere.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRSPHERE_H
#define IRRSPHERE_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
//#include "IrrLib.h"
class IrrSphere
{
private:
irr::scene::ISceneNode* nodeNew[10];
int numNodes;
irr::scene::ISceneManager* smgr;
irr::video::IVideoDriver* driver;
public:
void IrrSphere::SetDriver(irr::video::IVideoDriver* driver);
void IrrSphere::SetSmgr(irr::scene::ISceneManager* smgr);
int IrrSphere::CreateNewSphereNode(int x, int y, int z, std::string texture, bool light); //this is going to take my advanced C++ skillz!
irr::core::vector3df IrrSphere::GetSphereVector(int sphere);
void IrrSphere::SetSphereVector(int sphere, irr::core::vector3df v);
IrrSphere::IrrSphere();
//IrrSphere::IrrSphere(IrrLib*);
IrrSphere::~IrrSphere();
};
#endif
Stable Version/1.2.4/IrrSprite.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <irrlicht.h>
#include <strings.h>
#include "IrrLib.h"
//Libraries we create go here
//#include "IrrSphere.h"
#include "IrrColor.h"
#include "IrrSprite.h"
//#include "Irr2D.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
IrrSprite::IrrSprite()
{
//do stuff
}
IrrSprite::~IrrSprite()
{
//delete stuff
}
void IrrSprite::SetDriver(irr::video::IVideoDriver* driver)
{
this->driver = driver;
}
void IrrSprite::SetSmgr(irr::scene::ISceneManager* smgr)
{
this->smgr = smgr;
}
Stable Version/1.2.4/IrrSprite.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRSPRITE_H
#define IRRSPRITE_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
//#include "IrrSphere.h"
#include "IrrColor.h"
//#include "Irr2D.h"
//#include "IrrSprite.h"
//Start class
class IrrSprite {
private:
irr::video::IVideoDriver* driver;
irr::scene::ISceneManager* smgr;
public:
IrrSprite::IrrSprite();
IrrSprite::~IrrSprite();
void IrrSprite::SetDriver(irr::video::IVideoDriver* driver);
void IrrSprite::SetSmgr(irr::scene::ISceneManager* smgr);
// I forgot a semicolon here....and it wasn't compling
//Thats 1 bad thing about OOP if there is an error you don't know where the @#$@# the problem is!
};
#endif
Stable Version/1.2.4/README
1
2
3
4
5
6
7
8
9
10
11
12
13
Irrlicht Library Wrapper
Created by Nathan Adams
Version 1.2.3
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
Please leave all files intact if you redistrubte this software.
How to use:
Add all the files to your Irrlicht project, you could compile it into a DLL if you wanted too, but for now just add all the files to your project.
Then inside your complier add the directory that you have the IrrLib files and use #include "IrrLib.h" to refrence it, and you are good to go!
Stable Version/1.2.5/CHANGES
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
Version 1.2
+ Added a Irr3DLib class that will control all 3D objects
+ Also Added a Irr2D class that works on the same concept.
+ IrrSphere is now owned by Irr3DLib
+ Updated the examples using the latest code
Version 1.2.2
+ Added IrrEventReciever to handle all input
- Still under work
+ Fixed some misc coding bugs
+ Added template class
+ Added sprite class
+ Added GUI class
Version 1.2.3
+ IrrEventReciver now works as advertised
+ Baseclass is now being used
+ A couple somewhat-useful functions
+ int_to_string
+ stringw_to_stdstring
+ stdstring_to_stringw
+ GUI elements
+ Static text is working
+ Under construction for a data type class
Version 1.2.4
+ Implmented color codes accessiable through the class
+ IrrLib.Color.RED (ect)
Version 1.2.5
+ Implmented mouse events
+ IrrLib.getMouseX();
+ IrrLib.getMouseY();
+ Using vectors instead of static arrays
+ Side note: Was going to use dynamic arrays, but C++ has vectors which are 10x better.
+ Added a default exit for when you hit esc
+ Use IrrLib.IrrEvent.SetEscExit(false) to turn that off for your software
+ Use IrrLib.IrrEvent.SetEscExit(true) to turn it back on
+ Every stable version will now include a windows DLL.
+ Possible Linux .so file in the future.
Stable Version/1.2.5/CREDITS
1
2
3
4
5
6
7
IrrLib
Created by
Nathan Adams
Denzel Morris
From #irrlicht
Acid
Stable Version/1.2.5/Irr2D.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
//#include "IrrLib.h"
//#include "IrrSphere.h" //You probably aren't going to be using 3D objects in a 2D environment!
#include <irrlicht.h>
#include <strings.h>
#include "Irr2D.h"
#include "IrrSprite.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
Irr2D::Irr2D(){
this->numTextures = 0;
//NA Should we set textures to new
}
Irr2D::~Irr2D(){
for(int i = 0; i < numTextures; ++i)
delete this->textures[i];
delete this->textures;
}
void Irr2D::SetSmgr(irr::scene::ISceneManager* smgr){
this->smgr = smgr;
Sprite.SetSmgr(smgr);
}
void Irr2D::SetDriver(irr::video::IVideoDriver* driver){
this->driver = driver;
Sprite.SetDriver(driver);
}
void Irr2D::LoadTexturemap(std::string file){
this->texturemap = driver->getTexture(file.c_str());
}
int Irr2D::LoadTexture(std::string file){
this->textures[this->numTextures] = driver->getTexture(file.c_str());
this->numTextures++;
return numTextures--;
}
Stable Version/1.2.5/Irr2D.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRR2D_H
#define IRR2D_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
//#include "IrrLib.h"
#include "IrrSprite.h"
class Irr2D {
private:
irr::scene::ISceneManager* smgr;
irr::video::IVideoDriver* driver;
irr::video::ITexture* texturemap;
int numTextures;
irr::video::ITexture* textures[10];
public:
//Irr2D::Irr2D();
IrrSprite Sprite;
Irr2D::Irr2D();
Irr2D::~Irr2D();
void Irr2D::SetDriver(irr::video::IVideoDriver* driver);
void Irr2D::SetSmgr(irr::scene::ISceneManager* smgr);
void Irr2D::LoadTexturemap(std::string file);
int Irr2D::LoadTexture(std::string file);
void Irr2D::DrawImage(int texture, const irr::core::position2d<irr::s32> & destPos);
void Irr2D::DrawImage(const irr::core::position2d<irr::s32> & destPos, const irr::core::rect<irr::s32> & sourceRect, const irr::core::rect<irr::s32> * clipRect, irr::video::SColor color, bool useAlphaChannelOfTexture);
void Irr2D::DrawLine(const irr::core::position2d<irr::s32> & start, const irr::core::position2d<irr::s32> & end, irr::video::SColor color);
};
#endif
Stable Version/1.2.5/Irr3D.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <strings.h>
//#include "IrrLib.h"
//Libraries we create go here
#include "IrrSphere.h"
//#include "IrrColor.h"
#include "Irr3D.h"
#include <irrlicht.h>
//#include "Irr2D.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
void Irr3D::SetDriver(irr::video::IVideoDriver* driver) //so much for copying and pasting code from the header file
{
this->driver = driver;
Sphere.SetDriver(driver);
}
void Irr3D::SetSmgr(irr::scene::ISceneManager* smgr)
{
this->smgr = smgr;
Sphere.SetSmgr(smgr);
}
Irr3D::Irr3D()
{
//do stuff here!
}
Irr3D::~Irr3D()
{
//delete stuff here!
}
Stable Version/1.2.5/Irr3D.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRR3D_H
#define IRR3D_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
#include "IrrSphere.h"
//#include "IrrColor.h"
//#include "Irr3D.h"
//#include "Irr2D.h" This is a 3D class not 2D
/* However due to Irrlciht's nature mixing 2D with 3D is possible */
//Start class
class Irr3D {
private:
irr::video::IVideoDriver* driver;
irr::scene::ISceneManager* smgr;
public:
IrrSphere Sphere;
Irr3D::Irr3D();
Irr3D::~Irr3D();
void Irr3D::SetDriver(irr::video::IVideoDriver* driver);
void Irr3D::SetSmgr(irr::scene::ISceneManager* smgr);
};
#endif
Stable Version/1.2.5/IrrColor.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <irrlicht.h>
#include <strings.h>
//#include "IrrLib.h"
#include "IrrColor.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
void IrrColor::Init(){
/*SColor * temp;
temp = new SColor(alpha, 255, 0, 0);
this->RED = temp;
delete temp;*/
this->RED = SColor(alpha, 255, 0, 0);
this->ORANGE = SColor(alpha, 255, 165, 0);
this->YELLOW = SColor(alpha, 255, 255, 0);
this->GREEN = SColor(alpha, 0, 255, 0);
this->BLUE = SColor(alpha, 0, 0, 255);
this->DARK_GREEN = SColor(alpha, 0, 100, 0);
this->PINK = SColor(alpha, 255, 192, 203);
this->GREY = SColor(alpha, 190, 190, 190);
}
IrrColor::~IrrColor(){
//delete this->RED;
}
IrrColor::IrrColor(){
this->alpha = 255;
Init();
}
IrrColor::IrrColor(irr::u32 alpha){
this->alpha = alpha;
Init();
}
int IrrColor::getAlpha(){
return this->alpha;
}
void IrrColor::setAlpha(int alpha){
this->alpha = alpha;
}
SColor IrrColor::returnColor(std::string color){
int nColor = -1;
if (color == "red")
nColor = 1;
else if (color == "green")
nColor = 2;
else if (color == "blue")
nColor = 3;
else if (color == "dark green")
nColor = 4;
else if (color == "pink")
nColor = 5;
else if (color == "grey")
nColor = 6;
switch (nColor){
case 1:
return SColor(255, 255, 0, 0);
break;
case 2:
return SColor(255, 0, 255, 0);
break;
case 3:
return SColor(255, 0, 0, 255);
break;
case 4:
return SColor(255, 0, 50, 0);
break;
case 5:
return SColor(255, 255, 10, 255);
break;
case 6:
return SColor(255,200,200,200);
break;
default:
return SColor(255,200,200,200);
break;
}// TODO: Make this function modular
}
Stable Version/1.2.5/IrrColor.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRCOLOR_H
#define IRRCOLOR_H
#include <iostream>
#include <strings.h>
#include "irrlicht.h"
//#include "IrrLib.h"
class IrrColor {
private:
irr::u32 alpha;
void Init();
//who knows?
public:
//irr::video::SColor(alpha, 255, 0, 0);
irr::video::SColor RED;
irr::video::SColor ORANGE;
irr::video::SColor YELLOW;
irr::video::SColor GREEN;
irr::video::SColor BLUE;
irr::video::SColor DARK_GREEN;
irr::video::SColor PINK;
irr::video::SColor GREY;
/*const ORANGE = irr::video::SColor(alpha, 255, 165, 0);
const YELLOW = irr::video::SColor(alpha, 255, 255, 0);
const GREEN = irr::video::SColor(alpha, 0, 255, 0);
const BLUE = irr::video::SColor(alpha, 0, 0, 255);
const DARK_GREEN = irr::video::SColor(alpha, 0, 100, 0);
const PINK = irr::video::SColor(alpha, 255, 192, 203);
const GREY = irr::video::Scolor(alpha, 190, 190, 190);*/
//void IrrColor::test();
IrrColor();
IrrColor(irr::u32 alpha);
~IrrColor();
int getAlpha();
void setAlpha(int alpha);
irr::video::SColor IrrColor::returnColor(std::string color);
};
#endif
Stable Version/1.2.5/IrrEventReciever.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include "IrrEventReciever.h"
//#include "IrrLib.h"
#include <irrlicht.h>
#include <iostream>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
/*void IrrEventReciever::setIrrLib(IrrLib& IrrLib)
{
this.callingIrrLib = IrrLib;
}*/
IrrEventReciever::IrrEventReciever()
{
this->escexit = true;
this->mouse.x = 0;
this->mouse.y = 0;
}
bool IrrEventReciever::OnEvent(SEvent event)
{
if (event.EventType == irr::EET_KEY_INPUT_EVENT) {
if (!event.KeyInput.PressedDown){
this->keyStates[event.KeyInput.Key] = false;
//cout << "Key was not hit " << this->keyStates[event.KeyInput.Key] << endl;
}
else{
if(event.KeyInput.Key == KEY_ESCAPE && escexit)
this->device->closeDevice();
this->keyStates[event.KeyInput.Key] = true;
//cout << "Key was hit: " << event.KeyInput.Key << " " << this->keyStates[event.KeyInput.Key] << endl;
}
}
if (event.EventType == EET_MOUSE_INPUT_EVENT){
if (event.MouseInput.Event == EMIE_MOUSE_MOVED){
this->mouse.x = event.MouseInput.X;
this->mouse.y = event.MouseInput.Y;
}
}
return false;
}
void IrrEventReciever::SetEscExit(bool onoff)
{
this->escexit = onoff;
}
int IrrEventReciever::getMouseX()
{
return this->mouse.x;
}
int IrrEventReciever::getMouseY()
{
return this->mouse.y;
}
Stable Version/1.2.5/IrrEventReciever.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRREVENTRECIEVER_H
#define IRREVENTRECIEVER_H
//#include "IrrLib.h"
#include <irrlicht.h>
#include "IrrLibBase.h"
struct _mouse {
int x;
int y;
};
class IrrEventReciever : public irr::IEventReceiver, public IrrLibBase
{
private:
//IrrLib callingIrrLib;
_mouse mouse;
bool escexit;
public:
IrrEventReciever();
int getMouseX();
int getMouseY();
bool keyStates[irr::KEY_KEY_CODES_COUNT];
//void setIrrLib(IrrLib& IrrLib)
virtual bool OnEvent(irr::SEvent event);
void SetEscExit(bool onoff);
};
#endif
Stable Version/1.2.5/IrrLib.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <irrlicht.h>
#include <strings.h>
#include <sstream>
#include <time.h>
#include "IrrLib.h"
//Libraries we create go here
//#include "IrrSphere.h"
#include "IrrColor.h"
//#include "Irr2D.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
//TODO: Create own class for handling inputs!
/*IrrLib::IrrLib(MastEventReceiver & receiver){
this->device = createDevice(EDT_SOFTWARE, dimension2d<s32>(640, 480), 16, false, false, false, &receiver);
if (this->device == 0)
exit(1);
IrrLib::Init();
}*/
IrrLib::IrrLib(){
this->device = createDevice(EDT_SOFTWARE, dimension2d<s32>(640, 480), 16, false, false, false, &this->IrrEvent);
if (this->device == 0)
exit(1);
IrrLib::Init();
}
IrrLib::IrrLib(video::E_DRIVER_TYPE drivertype, core::dimension2d<s32> & res, u32 bits, bool fullscreen, bool stencilbuffer, bool vsync){
//MyEventReceiver receiver;
this->device = createDevice(drivertype, res, bits, fullscreen, stencilbuffer, vsync, &this->IrrEvent);
if (this->device == 0)
exit(1);
IrrLib::Init();
}
IrrLib::IrrLib(int nDrivertype, int width, int height, int bits, bool fullscreen, bool stencilbuffer, bool vsync){
//MyEventReceiver receiver;
video::E_DRIVER_TYPE drivertype;
switch (nDrivertype){
case 0: //TODO: finish this switch case
drivertype = EDT_NULL;
break;
case 1:
drivertype = EDT_SOFTWARE;
break;
case 2:
drivertype = EDT_BURNINGSVIDEO;
break;
case 3:
drivertype = EDT_OPENGL;
break;
case 4:
drivertype = EDT_DIRECT3D8;
//*Note: It seems as Microsoft has stoped supporting DX 8.1, so you can not compile it into Irrlicht engine anymore
//TODO: Find how to detect if DX is complied into Irrlicht
//TODO: Find how to detecht for linux
break;
case 5:
drivertype = EDT_DIRECT3D9;
break;
default:
drivertype = EDT_SOFTWARE;
break;
}
this->device = createDevice(drivertype, dimension2d<s32>(width, height), bits, fullscreen, stencilbuffer, vsync, &this->IrrEvent);
if (this->device == 0)
exit(1);
IrrLib::Init();
}
IrrLib::~IrrLib (){ //Our moms wont clean up after us!
//Although I'm sure Irrlicht does this for us already, its always a good idea to check!
/*if (this->device != NULL)
delete this->device;
if (this->driver != NULL)
delete this->driver;
if (this->smgr != NULL)
delete this->smgr;
if (this->mesh != NULL)
delete this->mesh;
if (this->node != NULL)
delete this->node;*/ //it seems Irrlicht picks up after us...
//however we created newNodes, now we need to delete it!
}
void IrrLib::Init(){
//this->numNodes = 0;
//this->nodeNew = new ISceneNode[10];
//this->env->addStaticText(L"Transparent Control:", rect<s32>(20,30,300,80), true);
this->env = this->device->getGUIEnvironment();
this->driver = this->device->getVideoDriver();
this->smgr = this->device->getSceneManager();
Irr3DLib.SetSmgr(this->smgr);
Irr3DLib.SetDriver(this->driver);
Irr2DLib.SetSmgr(this->smgr);
Irr2DLib.SetDriver(this->driver);
GUI.SetEnv(this->env);
IrrEvent.SetDevice(this->device);
this->timer = this->device->getTimer();
tick = this->timer->getRealTime();
}
void IrrLib::ReadArchive(std::string file){
this->device->getFileSystem()->addZipFileArchive(file.c_str());
}
void IrrLib::LoadQ3Level(std::string q3level){
this->mesh = this->smgr->getMesh(q3level.c_str());
this->node = 0;
if (this->mesh)
this->node = this->smgr->addOctTreeSceneNode(this->mesh->getMesh(0), 0, -1, 128);
}
void IrrLib::MapPos(int x, int y, int z){
if (this->node)
this->node->setPosition(core::vector3df(x, y, z));
}
void IrrLib::MapPos(){
if (this->node)
this->node->setPosition(core::vector3df(0, 0, 0));
}
void IrrLib::AddFPSCam(){
this->cam = this->smgr->addCameraSceneNodeFPS();
}
void IrrLib::AddFPSCam(f32 x, f32 y, f32 z)
{
this->cam = this->smgr->addCameraSceneNodeFPS();
this->cam->setPosition(irr::core::vector3df(x, y, z));
}
void IrrLib::VisibleCursor(bool tf){
if (tf == false)
this->device->getCursorControl()->setVisible(false);
else
this->device->getCursorControl()->setVisible(true);
}
int IrrLib::GetFPSCount(){
return this->driver->getFPS();
}
bool IrrLib::DeviceIsRunning(){
return this->device->run();
}
bool IrrLib::IsActiveWindow(){
return this->device->isWindowActive();
}
void IrrLib::BeginScene(){
this->driver->beginScene(true, true, video::SColor(0,200,200,200));
}
void IrrLib::BeginScene(irr::video::SColor color){
this->driver->beginScene(true, true, color);
}
void IrrLib::BeginScene(bool usebackBuffer, bool usezBuffer, irr::video::SColor color){
this->driver->beginScene(usebackBuffer, usezBuffer, color);
}
void IrrLib::DrawAll(){
this->smgr->drawAll();
this->env->drawAll();
//this->device->getGUIEnvironment()->drawAll();
}
void IrrLib::EndScene(){
this->driver->endScene();
}
void IrrLib::SetWindowCaption(stringw str){
this->device->setWindowCaption(str.c_str());
}
irr::core::stringw IrrLib::GetDriverName(){
return this->driver->getName();
}
void IrrLib::EndIrrlicht(){
if(this->device != NULL){
this->device->drop();
this->device = NULL;
}
}
void IrrLib::KeyPress(char key){
this->key = key;
}
char IrrLib::KeyPressed(){
return key;
}
irr::f32 IrrLib::getX(){
return this->smgr->getActiveCamera()->getPosition().X;
}
irr::f32 IrrLib::getY(){
return this->smgr->getActiveCamera()->getPosition().Y;
}
irr::f32 IrrLib::getZ(){
return this->smgr->getActiveCamera()->getPosition().Z;
}
bool IrrLib::CheckGameLoop(){
u32 now;
now = this->timer->getRealTime();
if ((now - this->tick) >= 30){
//this->tick == time (NULL);
return true;
} else {
return false;
}
}
bool IrrLib::CheckGameLoop(u32 ms){
u32 now;
now = this->timer->getRealTime();
if ((now - this->tick) >= ms){
this->tick = now;
return true;
} else {
return false;
}
}
void IrrLib::Exit()
{
this->device->closeDevice();
}
//template <class T> std::string IrrLib::to_string (T t)
/*std::string IrrLib::int_to_string (int t)
{
std::stringstream ss;
ss << t;
return ss.str();
}*/
// This is in the base class now, every class that decends from that class has this ability.
Stable Version/1.2.5/IrrLib.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRLIB_H
#define IRRLIB_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
#include <irrlicht.h>
#include <time.h>
/* We have to include Irrlichts libs */
#include "Irr3D.h"
#include "IrrColor.h"
#include "IrrLibGUI.h"
#include "IrrEventReciever.h"
#include "Irr2D.h"
#include "IrrLibBase.h"
//Start class
class IrrLib: public IrrLibBase {
private:
/* Create an Irrlicht device as private because the class should handle
All irrlicht interaction */
irr::IrrlichtDevice *device;
// Tells Irrlicht what driver to use
//video::E_DRIVER_TYPE driverType;
/*
Get a pointer to the video driver and the SceneManager so that
we do not always have to write device->getVideoDriver() and
device->getSceneManager().
*/
irr::video::IVideoDriver* driver;
irr::scene::ISceneManager* smgr;
irr::gui::IGUIEnvironment* env;
/*
Get a pointer to the 'mesh' aka the level.
Note: This is for Quake3 levels, ie bsp maps.
*/
irr::scene::IAnimatedMesh* mesh;
irr::scene::ISceneNode* node;
irr::scene::ISceneNode * tempNode; //use this to store nodeNew's data so we can resize it
irr::scene::ICameraSceneNode * cam;
char key;
void IrrLib::Init();
/*friend class IrrColor;
friend class Irr2DLib;
friend class Sphere;*/
friend class IrrEventReciever;
irr::u32 tick;
irr::ITimer* timer;
public:
//IrrSphere Sphere; //This has to be public to be able to access the Sphere class
/* IrrSphere is now in Irr3D class */
//Prehaps put this into a IrrLib3D class?
Irr3D Irr3DLib;
IrrColor Color; //Color class...not much of a class but lets keep it OO
Irr2D Irr2DLib; //1/2 variable to be labeled like this due to variables not able to begin with a number
IrrLibGUI GUI;
IrrEventReciever IrrEvent;
IrrLib::IrrLib();
//IrrLib::IrrLib(MastEventReceiver & receiver);
IrrLib::IrrLib(irr::video::E_DRIVER_TYPE drivertype, irr::core::dimension2d<irr::s32> & res, irr::u32 bits, bool fullscreen, bool stencilbuffer, bool vsync);
IrrLib::IrrLib(int drivertype, int width, int height, int bits, bool fullscreen, bool stencilbuffer, bool vsync);
IrrLib::~IrrLib(); //Our moms wont clean up after us!
void IrrLib::ReadArchive(std::string file);
void IrrLib::LoadQ3Level(std::string q3level);
void IrrLib::MapPos(int x, int y, int z); //I think this moves the actual camera?
void IrrLib::MapPos();
void IrrLib::AddFPSCam();
void IrrLib::AddFPSCam(irr::f32 x, irr::f32 y, irr::f32 z);
void IrrLib::VisibleCursor(bool tf);
int IrrLib::GetFPSCount();
bool IrrLib::DeviceIsRunning();
bool IrrLib::IsActiveWindow();
void IrrLib::BeginScene();
void IrrLib::BeginScene(irr::video::SColor color);
//void IrrLib::BeginScene(irr::video::SColor * color);
void IrrLib::BeginScene(bool usebackBuffer, bool usezBuffer, irr::video::SColor color);
//TODO: Add one more for human readable colors and hex colors!
void IrrLib::DrawAll();
void IrrLib::EndScene();
void IrrLib::SetWindowCaption(irr::core::stringw str);
irr::core::stringw IrrLib::GetDriverName();
//TODO: Make function to turn stringw to string and visa versa
void IrrLib::EndIrrlicht(); //Renamed from KillIrrlicht to EndIrrlicht
//TODO: Add logging
void IrrLib::KeyPress(char key);
char IrrLib::KeyPressed();
irr::f32 getX();
irr::f32 getY();
irr::f32 getZ();
bool CheckGameLoop();
bool CheckGameLoop(irr::u32 ms);
void Exit();
//void EndGameLoop();
//template <class T> std::string to_string (T t);
};
#endif
Stable Version/1.2.5/IrrLibBase.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <irrlicht.h>
#include "IrrLibBase.h"
#include <strings.h>
#include <sstream>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
void IrrLibBase::SetDriver(IVideoDriver* driver) //can be overloaded
{
this->driver = driver;
}
void IrrLibBase::SetSmgr(ISceneManager* smgr)
{
this->smgr = smgr;
}
std::string IrrLibBase::int_to_string (int t)
{
std::stringstream ss;
ss << t;
return ss.str();
}
std::string IrrLibBase::stringw_to_stdstring(irr::core::stringw sw)
{
std::stringstream ss;
ss << sw.c_str();
return ss.str();
}
irr::core::stringw IrrLibBase::stdstring_to_stringw(std::string ss)
{
stringw tmpw(ss.c_str());
return tmpw;
}
void IrrLibBase::SetDevice(irr::IrrlichtDevice *device)
{
this->device = device;
}
void IrrLibBase::init()
{
}
Stable Version/1.2.5/IrrLibBase.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRLIBBASE_H
#define IRRLIBBASE_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
class IrrLibBase {
protected:
irr::video::IVideoDriver* driver;
irr::scene::ISceneManager* smgr;
irr::IrrlichtDevice *device;
public:
void IrrLibBase::SetDriver(irr::video::IVideoDriver* driver);
void IrrLibBase::SetSmgr(irr::scene::ISceneManager* smgr);
void SetDevice(irr::IrrlichtDevice *device);
std::string int_to_string (int t);
std::string stringw_to_stdstring(irr::core::stringw sw);
irr::core::stringw stdstring_to_stringw(std::string ss);
void init();
};
#endif
Stable Version/1.2.5/IrrLibData.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
/*
Purpose of this class is to handle abstract data
Such as:
Stacks
Queues
Dynamic memory(arrays)
Begininers probably wont use this class too much, its used mostly for the advanced - expert programmer.
Howerver, IrrLib and other classes will make use of this class.
*/
/*class Stack {
int cap;
int count;
request *the_stack;
public:
void InitStack(int stacksize);
void Push(request value);
request Top();
request Pop();
~Stack ();
int thecount();
private:
void Push(request *&the_stack, int& nCount, int& nCap, request& value);
//void R
};
class Queue {
int cap;
int count;
request *the_queue;
public:
void InitQueue(int queuesize);
request Pop();
request Front();
request Back();
~Queue();
int thecount();
void Push(request value);
private:
void Push(request *the_stack, int nCount, int nCap, request value);
};*/
Stable Version/1.2.5/IrrLibGUI.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <strings.h>
#include <irrlicht.h>
#include <vector>
#include "IrrLibGUI.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
IrrLibGUI::IrrLibGUI()
{
//NA does it need to do anything at init?
this->nStaticText = 0;
//this->arrStaticText = new IGUIStaticText[10];
//this->env = this->device->getGUIEnvironment(); //NA yes we do!
}
IrrLibGUI::~IrrLibGUI()
{
//NA Do we have to delete anything?
}
void IrrLibGUI::SetEnv(IGUIEnvironment* env)
{
this->env = env;
}
void IrrLibGUI::Clear()
{
this->env->clear();
}
void IrrLibGUI::DrawAll()
{
this->env->drawAll();
}
void IrrLibGUI::AddToStaticArray(irr::gui::IGUIStaticText * addme)
{
//arrStaticText[nStaticText] = addme;
arrStaticText.push_back(addme);
this->nStaticText++;
}
void IrrLibGUI::AddStaticText()
{
//rect<s32>(20,30,300,80),
this->env->addStaticText(L"Powered by IrrLib.", rect<s32>(20,30,300,80), true);
}
int IrrLibGUI::AddStaticText(std::string message)
{
irr::gui::IGUIStaticText * addthis;
stringw tmpw(message.c_str());
addthis = this->env->addStaticText(tmpw.c_str(), rect<s32>(20,30,300,80), true);
AddToStaticArray(addthis);
}
int IrrLibGUI::AddStaticText(std::string message, int x1, int y1, int x2, int y2)
{
irr::gui::IGUIStaticText * addthis;
stringw tmpw(message.c_str());
addthis = this->env->addStaticText(tmpw.c_str(), rect<s32>(x1,y1,x2,y2), true);
AddToStaticArray(addthis);
}
int IrrLibGUI::AddStaticText(std::string message, int x1, int y1, int x2, int y2, bool border, bool wordwrap)
{
irr::gui::IGUIStaticText * addthis;
stringw tmpw(message.c_str());
addthis = this->env->addStaticText(tmpw.c_str(), rect<s32>(x1,y1,x2,y2), border, wordwrap);
AddToStaticArray(addthis);
}
int IrrLibGUI::AddStaticText(std::string message, int x1, int y1, int x2, int y2, bool border, bool wordwrap, int id, bool fillbackground)
{
irr::gui::IGUIStaticText * addthis;
stringw tmpw(message.c_str());
addthis = this->env->addStaticText(tmpw.c_str(), rect<s32>(x1,y1,x2,y2), border, wordwrap, 0, id, fillbackground);
AddToStaticArray(addthis);
}
int IrrLibGUI::AddStaticText(std::string message, const core::rect< s32 > &rectangle)
{
irr::gui::IGUIStaticText * addthis;
stringw tmpw(message.c_str());
addthis = this->env->addStaticText(tmpw.c_str(), rectangle);
AddToStaticArray(addthis);
}
int IrrLibGUI::AddStaticText(std::string message, const core::rect< s32 > &rectangle, bool border, bool wordwrap)
{
irr::gui::IGUIStaticText * addthis;
stringw tmpw(message.c_str());
addthis = this->env->addStaticText(tmpw.c_str(), rectangle, border, wordwrap);
AddToStaticArray(addthis);
}
int IrrLibGUI::AddStaticText(std::string message, const core::rect< s32 > &rectangle, bool border, bool wordwrap, int id, bool fillbackground)
{
irr::gui::IGUIStaticText * addthis;
stringw tmpw(message.c_str());
addthis = this->env->addStaticText(tmpw.c_str(), rectangle, border, wordwrap, 0, id, fillbackground);
AddToStaticArray(addthis);
}
void IrrLibGUI::ChangeStaticText(int nstatictext, std::string message)
{
stringw tmpw(message.c_str());
this->arrStaticText[this->nStaticText-1]->setText(tmpw.c_str());
}
void IrrLibGUI::ChangeFont(std::string fontfile)
{
IGUISkin* skin = this->env->getSkin();
IGUIFont* font = this->env->getFont(fontfile.c_str());
if (font)
skin->setFont(font);
}
Stable Version/1.2.5/IrrLibGUI.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRLIBGUI_H
#define IRRLIBGUI_H
#include <iostream>
#include <strings.h>
#include <irrlicht.h>
#include "IrrLibBase.h"
class IrrLibGUI: public IrrLibBase {
private:
irr::gui::IGUISkin* skin;
irr::gui::IGUIFont* font;
irr::gui::IGUIEnvironment* env;
//TODO: Create an array storing all messages
int nStaticText;
//irr::gui::IGUIStaticText* arrStaticText[10];
std::vector<irr::gui::IGUIStaticText*> arrStaticText;
void AddToStaticArray(irr::gui::IGUIStaticText * addme);
public:
IrrLibGUI();
~IrrLibGUI();
void SetEnv(irr::gui::IGUIEnvironment* env);
void Clear();
void DrawAll();
//irr::gui::IGUIStaticText* IrrLibGUI::AddStaticText(); //NA eh a default text adder why not?
/* This is bad coding, we do not want to return an irrlicht object, we want to return a standard datatype because this class handles the GUI elements, not the user. */
void AddStaticText(); //NA eh a default text adder why not?
int AddStaticText(std::string message);
int AddStaticText(std::string message, int x1, int y1, int x2, int y2);
int AddStaticText(std::string message, int x1, int y1, int x2, int y2, bool border, bool wordwrap);
int AddStaticText(std::string message, int x1, int y1, int x2, int y2, bool border, bool wordwrap, int id, bool fillbackground);
int AddStaticText(std::string message, const irr::core::rect< irr::s32 > &rectangle);
int AddStaticText(std::string message, const irr::core::rect< irr::s32 > &rectangle, bool border, bool wordwrap);
int AddStaticText(std::string message, const irr::core::rect< irr::s32 > &rectangle, bool border, bool wordwrap, int id, bool fillbackground);
void ChangeStaticText(int nstatictext, std::string message);
void ChangeFont(std::string fontfile);
};
#endif
Stable Version/1.2.5/IrrSphere.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include "IrrLib.h"
#include "IrrSphere.h"
#include <irrlicht.h>
#include <strings.h>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
void IrrSphere::SetSmgr(irr::scene::ISceneManager* smgr){
this->smgr = smgr;
}
void IrrSphere::SetDriver(irr::video::IVideoDriver* driver){
this->driver = driver;
}
int IrrSphere::CreateNewSphereNode(int x, int y, int z, std::string texture, bool light){
//TODO: Resize after 10, and add 10 more to the mix!
//this->nodeNew[this->numNodes] = this->smgr->addSphereSceneNode();
sphereNodes.push_back(this->smgr->addSphereSceneNode());
this->sphereNodes[this->numNodes]->setPosition(core::vector3df(x,y,z));
this->sphereNodes[this->numNodes]->setMaterialTexture(0, this->driver->getTexture(texture.c_str()));
this->sphereNodes[this->numNodes]->setMaterialFlag(video::EMF_LIGHTING, light);
this->numNodes++;
return this->numNodes--;
/*this->node = this->smgr->addSphereSceneNode();
this->node->setPosition(core::vector3df(x,y,z));
this->node->setMaterialTexture(0, this->driver->getTexture(texture.c_str()));
this->node->setMaterialFlag(video::EMF_LIGHTING, light);*/
}
irr::core::vector3df IrrSphere::GetSphereVector(int sphere){
//We are converting to vectors, under construction NA
//return this->nodeNew[sphere]->getPosition();
return this->sphereNodes[sphere]->getPosition();
}
void IrrSphere::SetSphereVector(int sphere, irr::core::vector3df v){
this->sphereNodes[sphere]->setPosition(v);
}
IrrSphere::IrrSphere(){
this->numNodes = 0;
}
IrrSphere::~IrrSphere(){
/*for(int i = 0; i < numNodes; ++i)
delete this->nodeNew[i];
delete this->nodeNew;*/
//We are using vectors now, no more memory clowing business NA
}
Stable Version/1.2.5/IrrSphere.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRSPHERE_H
#define IRRSPHERE_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
#include <vector>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
//#include "IrrLib.h"
class IrrSphere
{
private:
//irr::scene::ISceneNode* nodeNew[10];
//irr::scene::ISceneNode* nodeNew[10];
std::vector<irr::scene::ISceneNode*> sphereNodes;
int numNodes;
irr::scene::ISceneManager* smgr;
irr::video::IVideoDriver* driver;
public:
void IrrSphere::SetDriver(irr::video::IVideoDriver* driver);
void IrrSphere::SetSmgr(irr::scene::ISceneManager* smgr);
int IrrSphere::CreateNewSphereNode(int x, int y, int z, std::string texture, bool light); //this is going to take my advanced C++ skillz!
irr::core::vector3df IrrSphere::GetSphereVector(int sphere);
void IrrSphere::SetSphereVector(int sphere, irr::core::vector3df v);
IrrSphere::IrrSphere();
//IrrSphere::IrrSphere(IrrLib*);
IrrSphere::~IrrSphere();
};
#endif
Stable Version/1.2.5/IrrSprite.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <irrlicht.h>
#include <strings.h>
#include "IrrLib.h"
//Libraries we create go here
//#include "IrrSphere.h"
#include "IrrColor.h"
#include "IrrSprite.h"
//#include "Irr2D.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
IrrSprite::IrrSprite()
{
//do stuff
}
IrrSprite::~IrrSprite()
{
//delete stuff
}
void IrrSprite::SetDriver(irr::video::IVideoDriver* driver)
{
this->driver = driver;
}
void IrrSprite::SetSmgr(irr::scene::ISceneManager* smgr)
{
this->smgr = smgr;
}
Stable Version/1.2.5/IrrSprite.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRSPRITE_H
#define IRRSPRITE_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
//#include "IrrSphere.h"
#include "IrrColor.h"
//#include "Irr2D.h"
//#include "IrrSprite.h"
//Start class
class IrrSprite {
private:
irr::video::IVideoDriver* driver;
irr::scene::ISceneManager* smgr;
public:
IrrSprite::IrrSprite();
IrrSprite::~IrrSprite();
void IrrSprite::SetDriver(irr::video::IVideoDriver* driver);
void IrrSprite::SetSmgr(irr::scene::ISceneManager* smgr);
// I forgot a semicolon here....and it wasn't compling
//Thats 1 bad thing about OOP if there is an error you don't know where the @#$@# the problem is!
};
#endif
Stable Version/1.2.5/README
1
2
3
4
5
6
7
8
9
10
11
12
13
Irrlicht Library Wrapper
Created by Nathan Adams
Version 1.2.3
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
Please leave all files intact if you redistrubte this software.
How to use:
Add all the files to your Irrlicht project, you could compile it into a DLL if you wanted too, but for now just add all the files to your project.
Then inside your complier add the directory that you have the IrrLib files and use #include "IrrLib.h" to refrence it, and you are good to go!
Stable Version/1.2.5/dll.cbp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<?xml version="1.0"?>
<!DOCTYPE CodeBlocks_project_file>
<CodeBlocks_project_file>
<FileVersion major="1" minor="1"/>
<Project>
<Option title="DLL Sample"/>
<Option makefile="Makefile"/>
<Option makefile_is_custom="0"/>
<Build>
<Target title="default">
<Option type="3"/>
<Option output="sample.dll"/>
<Option createStaticLib="1"/>
</Target>
</Build>
<Compiler>
<Add option="-DBUILD_DLL"/>
</Compiler>
</Project>
</CodeBlocks_project_file>
Stable Version/1.2.5/dll.layout
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<?xml version="1.0"?>
<!DOCTYPE CodeBlocks_layout_file>
<CodeBlocks_layout_file>
<File name="Irr2D.cpp" open="1" top="1">
<Cursor position="381" topLine="0"/>
</File>
<File name="IrrLib.cpp" open="0" top="0">
<Cursor position="1686" topLine="0"/>
</File>
<File name="IrrLib.h" open="0" top="0">
<Cursor position="2379" topLine="57"/>
</File>
<Expand folder="/Headers"/>
</CodeBlocks_layout_file>
Stable Version/1.2.6/CHANGES
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
Version 1.2
+ Added a Irr3DLib class that will control all 3D objects
+ Also Added a Irr2D class that works on the same concept.
+ IrrSphere is now owned by Irr3DLib
+ Updated the examples using the latest code
Version 1.2.2
+ Added IrrEventReciever to handle all input
- Still under work
+ Fixed some misc coding bugs
+ Added template class
+ Added sprite class
+ Added GUI class
Version 1.2.3
+ IrrEventReciver now works as advertised
+ Baseclass is now being used
+ A couple somewhat-useful functions
+ int_to_string
+ stringw_to_stdstring
+ stdstring_to_stringw
+ GUI elements
+ Static text is working
+ Under construction for a data type class
Version 1.2.4
+ Implmented color codes accessiable through the class
+ IrrLib.Color.RED (ect)
Version 1.2.5
+ Implmented mouse events
+ IrrLib.IrrEvent.getMouseX();
+ IrrLib.IrrEvent.getMouseY();
+ Using vectors instead of static arrays
+ Side note: Was going to use dynamic arrays, but C++ has vectors which are 10x better.
+ Added a default exit for when you hit esc
+ Use IrrLib.IrrEvent.SetEscExit(false) to turn that off for your software
+ Use IrrLib.IrrEvent.SetEscExit(true) to turn it back on
+ Every stable version will now include a windows DLL.
+ Possible Linux .so file in the future.
Version 1.2.6
+ Added a IrrEvent for buttons
+ IrrLib.IrrEvent.checkButtonState();
+ See example for use
+ Added an AddButton function
+ IrrLib.GUI.AddButton(..);
+ See example for use
+ Problems with making the DLL
+ reasearching
Stable Version/1.2.6/CREDITS
1
2
3
4
5
6
7
IrrLib
Created by
Nathan Adams
Denzel Morris
From #irrlicht
Acid
Stable Version/1.2.6/Irr2D.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
//#include "IrrLib.h"
//#include "IrrSphere.h" //You probably aren't going to be using 3D objects in a 2D environment!
#include <irrlicht.h>
#include <strings.h>
#include "Irr2D.h"
#include "IrrSprite.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
Irr2D::Irr2D(){
this->numTextures = 0;
//NA Should we set textures to new
}
Irr2D::~Irr2D(){
for(int i = 0; i < numTextures; ++i)
delete this->textures[i];
delete this->textures;
}
void Irr2D::SetSmgr(irr::scene::ISceneManager* smgr){
this->smgr = smgr;
Sprite.SetSmgr(smgr);
}
void Irr2D::SetDriver(irr::video::IVideoDriver* driver){
this->driver = driver;
Sprite.SetDriver(driver);
}
void Irr2D::LoadTexturemap(std::string file){
this->texturemap = driver->getTexture(file.c_str());
}
int Irr2D::LoadTexture(std::string file){
this->textures[this->numTextures] = driver->getTexture(file.c_str());
this->numTextures++;
return numTextures--;
}
Stable Version/1.2.6/Irr2D.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRR2D_H
#define IRR2D_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
//#include "IrrLib.h"
#include "IrrSprite.h"
class Irr2D {
private:
irr::scene::ISceneManager* smgr;
irr::video::IVideoDriver* driver;
irr::video::ITexture* texturemap;
int numTextures;
irr::video::ITexture* textures[10];
public:
//Irr2D::Irr2D();
IrrSprite Sprite;
Irr2D::Irr2D();
Irr2D::~Irr2D();
void Irr2D::SetDriver(irr::video::IVideoDriver* driver);
void Irr2D::SetSmgr(irr::scene::ISceneManager* smgr);
void Irr2D::LoadTexturemap(std::string file);
int Irr2D::LoadTexture(std::string file);
void Irr2D::DrawImage(int texture, const irr::core::position2d<irr::s32> & destPos);
void Irr2D::DrawImage(const irr::core::position2d<irr::s32> & destPos, const irr::core::rect<irr::s32> & sourceRect, const irr::core::rect<irr::s32> * clipRect, irr::video::SColor color, bool useAlphaChannelOfTexture);
void Irr2D::DrawLine(const irr::core::position2d<irr::s32> & start, const irr::core::position2d<irr::s32> & end, irr::video::SColor color);
};
#endif
Stable Version/1.2.6/Irr3D.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <strings.h>
//#include "IrrLib.h"
//Libraries we create go here
#include "IrrSphere.h"
//#include "IrrColor.h"
#include "Irr3D.h"
#include <irrlicht.h>
//#include "Irr2D.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
void Irr3D::SetDriver(irr::video::IVideoDriver* driver) //so much for copying and pasting code from the header file
{
this->driver = driver;
Sphere.SetDriver(driver);
}
void Irr3D::SetSmgr(irr::scene::ISceneManager* smgr)
{
this->smgr = smgr;
Sphere.SetSmgr(smgr);
}
Irr3D::Irr3D()
{
//do stuff here!
}
Irr3D::~Irr3D()
{
//delete stuff here!
}
Stable Version/1.2.6/Irr3D.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRR3D_H
#define IRR3D_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
#include "IrrSphere.h"
//#include "IrrColor.h"
//#include "Irr3D.h"
//#include "Irr2D.h" This is a 3D class not 2D
/* However due to Irrlciht's nature mixing 2D with 3D is possible */
//Start class
class Irr3D {
private:
irr::video::IVideoDriver* driver;
irr::scene::ISceneManager* smgr;
public:
IrrSphere Sphere;
Irr3D::Irr3D();
Irr3D::~Irr3D();
void Irr3D::SetDriver(irr::video::IVideoDriver* driver);
void Irr3D::SetSmgr(irr::scene::ISceneManager* smgr);
};
#endif
Stable Version/1.2.6/IrrColor.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <irrlicht.h>
#include <strings.h>
//#include "IrrLib.h"
#include "IrrColor.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
void IrrColor::Init(){
/*SColor * temp;
temp = new SColor(alpha, 255, 0, 0);
this->RED = temp;
delete temp;*/
this->RED = SColor(alpha, 255, 0, 0);
this->ORANGE = SColor(alpha, 255, 165, 0);
this->YELLOW = SColor(alpha, 255, 255, 0);
this->GREEN = SColor(alpha, 0, 255, 0);
this->BLUE = SColor(alpha, 0, 0, 255);
this->DARK_GREEN = SColor(alpha, 0, 100, 0);
this->PINK = SColor(alpha, 255, 192, 203);
this->GREY = SColor(alpha, 190, 190, 190);
}
IrrColor::~IrrColor(){
//delete this->RED;
}
IrrColor::IrrColor(){
this->alpha = 255;
Init();
}
IrrColor::IrrColor(irr::u32 alpha){
this->alpha = alpha;
Init();
}
int IrrColor::getAlpha(){
return this->alpha;
}
void IrrColor::setAlpha(int alpha){
this->alpha = alpha;
}
SColor IrrColor::returnColor(std::string color){
int nColor = -1;
if (color == "red")
nColor = 1;
else if (color == "green")
nColor = 2;
else if (color == "blue")
nColor = 3;
else if (color == "dark green")
nColor = 4;
else if (color == "pink")
nColor = 5;
else if (color == "grey")
nColor = 6;
switch (nColor){
case 1:
return SColor(255, 255, 0, 0);
break;
case 2:
return SColor(255, 0, 255, 0);
break;
case 3:
return SColor(255, 0, 0, 255);
break;
case 4:
return SColor(255, 0, 50, 0);
break;
case 5:
return SColor(255, 255, 10, 255);
break;
case 6:
return SColor(255,200,200,200);
break;
default:
return SColor(255,200,200,200);
break;
}// TODO: Make this function modular
}
Stable Version/1.2.6/IrrColor.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRCOLOR_H
#define IRRCOLOR_H
#include <iostream>
#include <strings.h>
#include "irrlicht.h"
//#include "IrrLib.h"
class IrrColor {
private:
irr::u32 alpha;
void Init();
//who knows?
public:
//irr::video::SColor(alpha, 255, 0, 0);
irr::video::SColor RED;
irr::video::SColor ORANGE;
irr::video::SColor YELLOW;
irr::video::SColor GREEN;
irr::video::SColor BLUE;
irr::video::SColor DARK_GREEN;
irr::video::SColor PINK;
irr::video::SColor GREY;
/*const ORANGE = irr::video::SColor(alpha, 255, 165, 0);
const YELLOW = irr::video::SColor(alpha, 255, 255, 0);
const GREEN = irr::video::SColor(alpha, 0, 255, 0);
const BLUE = irr::video::SColor(alpha, 0, 0, 255);
const DARK_GREEN = irr::video::SColor(alpha, 0, 100, 0);
const PINK = irr::video::SColor(alpha, 255, 192, 203);
const GREY = irr::video::Scolor(alpha, 190, 190, 190);*/
//void IrrColor::test();
IrrColor();
IrrColor(irr::u32 alpha);
~IrrColor();
int getAlpha();
void setAlpha(int alpha);
irr::video::SColor IrrColor::returnColor(std::string color);
};
#endif
Stable Version/1.2.6/IrrEventReciever.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include "IrrEventReciever.h"
//#include "IrrLib.h"
#include <irrlicht.h>
#include <iostream>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
/*void IrrEventReciever::setIrrLib(IrrLib& IrrLib)
{
this.callingIrrLib = IrrLib;
}*/
IrrEventReciever::IrrEventReciever()
{
this->escexit = true;
this->mouse.x = 0;
this->mouse.y = 0;
}
bool IrrEventReciever::OnEvent(SEvent event)
{
// A button was clicked
if (event.EventType == irr::EET_GUI_EVENT)
{
switch(event.GUIEvent.EventType){
case EGET_BUTTON_CLICKED:
s32 id = event.GUIEvent.Caller->getID();
//cout << id << endl;
buttonStates.push_back(id);
break;
default:
break;
}
}
/*if (event.EventType == irr::EGET_SCROLL_BAR_CHANGED)
{
}*/
if (event.EventType == irr::EET_KEY_INPUT_EVENT) {
if (!event.KeyInput.PressedDown){
this->keyStates[event.KeyInput.Key] = false;
//cout << "Key was not hit " << this->keyStates[event.KeyInput.Key] << endl;
}
else{
if(event.KeyInput.Key == KEY_ESCAPE && escexit)
this->device->closeDevice();
this->keyStates[event.KeyInput.Key] = true;
//cout << "Key was hit: " << event.KeyInput.Key << " " << this->keyStates[event.KeyInput.Key] << endl;
}
}
if (event.EventType == EET_MOUSE_INPUT_EVENT){
if (event.MouseInput.Event == EMIE_MOUSE_MOVED){
this->mouse.x = event.MouseInput.X;
this->mouse.y = event.MouseInput.Y;
}
}
return false;
}
void IrrEventReciever::SetEscExit(bool onoff)
{
this->escexit = onoff;
}
int IrrEventReciever::getMouseX()
{
return this->mouse.x;
}
int IrrEventReciever::getMouseY()
{
return this->mouse.y;
}
int IrrEventReciever::getButtonState()
{
if(!this->buttonStates.empty()){
int id;
id = buttonStates.back();
this->buttonStates.pop_back();
return id;
}
else
return -1;
}
int IrrEventReciever::getRevButtonState()
{
if(!this->buttonStates.empty()){
int id = buttonStates.front();
this->buttonStates.erase(buttonStates.begin());
return id;
}
else
return -1;
}
void IrrEventReciever::clearButtonState()
{
this->buttonStates.clear();
}
int IrrEventReciever::checkButtonState()
{
if(!this->buttonStates.empty())
return this->buttonStates.back();
else
return -1;
}
void IrrEventReciever::delLastButtonStat()
{
if(!this->buttonStates.empty())
this->buttonStates.pop_back();
}
bool IrrEventReciever::isButtonStateEmpty()
{
return this->buttonStates.empty();
}
Stable Version/1.2.6/IrrEventReciever.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRREVENTRECIEVER_H
#define IRREVENTRECIEVER_H
//#include "IrrLib.h"
#include <vector>
#include <irrlicht.h>
#include "IrrLibBase.h"
struct _mouse {
int x;
int y;
};
class IrrEventReciever : public irr::IEventReceiver, public IrrLibBase
{
private:
//IrrLib callingIrrLib;
_mouse mouse;
bool escexit;
std::vector<int> buttonStates;
public:
IrrEventReciever();
int getMouseX();
int getMouseY();
bool keyStates[irr::KEY_KEY_CODES_COUNT];
//void setIrrLib(IrrLib& IrrLib)
virtual bool OnEvent(irr::SEvent event);
void SetEscExit(bool onoff);
int getButtonState();
int getRevButtonState();
void clearButtonState();
int checkButtonState();
void delLastButtonStat();
bool isButtonStateEmpty(); //is there still stuff in the vector to be done? NA
};
#endif
Stable Version/1.2.6/IrrLib.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <irrlicht.h>
#include <strings.h>
#include <sstream>
#include <time.h>
#include "IrrLib.h"
//Libraries we create go here
//#include "IrrSphere.h"
#include "IrrColor.h"
//#include "Irr2D.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
//TODO: Create own class for handling inputs!
/*IrrLib::IrrLib(MastEventReceiver & receiver){
this->device = createDevice(EDT_SOFTWARE, dimension2d<s32>(640, 480), 16, false, false, false, &receiver);
if (this->device == 0)
exit(1);
IrrLib::Init();
}*/
IrrLib::IrrLib(){
this->device = createDevice(EDT_SOFTWARE, dimension2d<s32>(640, 480), 16, false, false, false, &this->IrrEvent);
if (this->device == 0)
exit(1);
IrrLib::Init();
}
IrrLib::IrrLib(video::E_DRIVER_TYPE drivertype, core::dimension2d<s32> & res, u32 bits, bool fullscreen, bool stencilbuffer, bool vsync){
//MyEventReceiver receiver;
this->device = createDevice(drivertype, res, bits, fullscreen, stencilbuffer, vsync, &this->IrrEvent);
if (this->device == 0)
exit(1);
IrrLib::Init();
}
IrrLib::IrrLib(int nDrivertype, int width, int height, int bits, bool fullscreen, bool stencilbuffer, bool vsync){
//MyEventReceiver receiver;
video::E_DRIVER_TYPE drivertype;
switch (nDrivertype){
case 0: //TODO: finish this switch case
drivertype = EDT_NULL;
break;
case 1:
drivertype = EDT_SOFTWARE;
break;
case 2:
drivertype = EDT_BURNINGSVIDEO;
break;
case 3:
drivertype = EDT_OPENGL;
break;
case 4:
drivertype = EDT_DIRECT3D8;
//*Note: It seems as Microsoft has stoped supporting DX 8.1, so you can not compile it into Irrlicht engine anymore
//TODO: Find how to detect if DX is complied into Irrlicht
//TODO: Find how to detecht for linux
break;
case 5:
drivertype = EDT_DIRECT3D9;
break;
default:
drivertype = EDT_SOFTWARE;
break;
}
this->device = createDevice(drivertype, dimension2d<s32>(width, height), bits, fullscreen, stencilbuffer, vsync, &this->IrrEvent);
if (this->device == 0)
exit(1);
IrrLib::Init();
}
IrrLib::~IrrLib (){ //Our moms wont clean up after us!
//Although I'm sure Irrlicht does this for us already, its always a good idea to check!
/*if (this->device != NULL)
delete this->device;
if (this->driver != NULL)
delete this->driver;
if (this->smgr != NULL)
delete this->smgr;
if (this->mesh != NULL)
delete this->mesh;
if (this->node != NULL)
delete this->node;*/ //it seems Irrlicht picks up after us...
//however we created newNodes, now we need to delete it!
}
void IrrLib::Init(){
//this->numNodes = 0;
//this->nodeNew = new ISceneNode[10];
//this->env->addStaticText(L"Transparent Control:", rect<s32>(20,30,300,80), true);
this->env = this->device->getGUIEnvironment();
this->driver = this->device->getVideoDriver();
this->smgr = this->device->getSceneManager();
Irr3DLib.SetSmgr(this->smgr);
Irr3DLib.SetDriver(this->driver);
Irr2DLib.SetSmgr(this->smgr);
Irr2DLib.SetDriver(this->driver);
GUI.SetEnv(this->env);
IrrEvent.SetDevice(this->device);
this->timer = this->device->getTimer();
tick = this->timer->getRealTime();
}
void IrrLib::ReadArchive(std::string file){
this->device->getFileSystem()->addZipFileArchive(file.c_str());
}
void IrrLib::LoadQ3Level(std::string q3level){
this->mesh = this->smgr->getMesh(q3level.c_str());
this->node = 0;
if (this->mesh)
this->node = this->smgr->addOctTreeSceneNode(this->mesh->getMesh(0), 0, -1, 128);
}
void IrrLib::MapPos(int x, int y, int z){
if (this->node)
this->node->setPosition(core::vector3df(x, y, z));
}
void IrrLib::MapPos(){
if (this->node)
this->node->setPosition(core::vector3df(0, 0, 0));
}
void IrrLib::AddFPSCam(){
this->cam = this->smgr->addCameraSceneNodeFPS();
}
void IrrLib::AddFPSCam(f32 x, f32 y, f32 z)
{
this->cam = this->smgr->addCameraSceneNodeFPS();
this->cam->setPosition(irr::core::vector3df(x, y, z));
}
void IrrLib::VisibleCursor(bool tf){
if (tf == false)
this->device->getCursorControl()->setVisible(false);
else
this->device->getCursorControl()->setVisible(true);
}
int IrrLib::GetFPSCount(){
return this->driver->getFPS();
}
bool IrrLib::DeviceIsRunning(){
return this->device->run();
}
bool IrrLib::IsActiveWindow(){
return this->device->isWindowActive();
}
void IrrLib::BeginScene(){
this->driver->beginScene(true, true, video::SColor(0,200,200,200));
}
void IrrLib::BeginScene(irr::video::SColor color){
this->driver->beginScene(true, true, color);
}
void IrrLib::BeginScene(bool usebackBuffer, bool usezBuffer, irr::video::SColor color){
this->driver->beginScene(usebackBuffer, usezBuffer, color);
}
void IrrLib::DrawAll(){
this->smgr->drawAll();
this->env->drawAll();
//this->device->getGUIEnvironment()->drawAll();
}
void IrrLib::EndScene(){
this->driver->endScene();
}
void IrrLib::SetWindowCaption(stringw str){
this->device->setWindowCaption(str.c_str());
}
irr::core::stringw IrrLib::GetDriverName(){
return this->driver->getName();
}
void IrrLib::EndIrrlicht(){
if(this->device != NULL){
this->device->drop();
this->device = NULL;
}
}
void IrrLib::KeyPress(char key){
this->key = key;
}
char IrrLib::KeyPressed(){
return key;
}
irr::f32 IrrLib::getX(){
return this->smgr->getActiveCamera()->getPosition().X;
}
irr::f32 IrrLib::getY(){
return this->smgr->getActiveCamera()->getPosition().Y;
}
irr::f32 IrrLib::getZ(){
return this->smgr->getActiveCamera()->getPosition().Z;
}
bool IrrLib::CheckGameLoop(){
u32 now;
now = this->timer->getRealTime();
if ((now - this->tick) >= 30){
//this->tick == time (NULL);
return true;
} else {
return false;
}
}
bool IrrLib::CheckGameLoop(u32 ms){
u32 now;
now = this->timer->getRealTime();
if ((now - this->tick) >= ms){
this->tick = now;
return true;
} else {
return false;
}
}
void IrrLib::Exit()
{
this->device->closeDevice();
}
//template <class T> std::string IrrLib::to_string (T t)
/*std::string IrrLib::int_to_string (int t)
{
std::stringstream ss;
ss << t;
return ss.str();
}*/
// This is in the base class now, every class that decends from that class has this ability.
Stable Version/1.2.6/IrrLib.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRLIB_H
#define IRRLIB_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
#include <irrlicht.h>
#include <time.h>
/* We have to include Irrlichts libs */
#include "Irr3D.h"
#include "IrrColor.h"
#include "IrrLibGUI.h"
#include "IrrEventReciever.h"
#include "Irr2D.h"
#include "IrrLibBase.h"
//Start class
class IrrLib: public IrrLibBase {
private:
/* Create an Irrlicht device as private because the class should handle
All irrlicht interaction */
irr::IrrlichtDevice *device;
// Tells Irrlicht what driver to use
//video::E_DRIVER_TYPE driverType;
/*
Get a pointer to the video driver and the SceneManager so that
we do not always have to write device->getVideoDriver() and
device->getSceneManager().
*/
irr::video::IVideoDriver* driver;
irr::scene::ISceneManager* smgr;
irr::gui::IGUIEnvironment* env;
/*
Get a pointer to the 'mesh' aka the level.
Note: This is for Quake3 levels, ie bsp maps.
*/
irr::scene::IAnimatedMesh* mesh;
irr::scene::ISceneNode* node;
irr::scene::ISceneNode * tempNode; //use this to store nodeNew's data so we can resize it
irr::scene::ICameraSceneNode * cam;
char key;
void IrrLib::Init();
/*friend class IrrColor;
friend class Irr2DLib;
friend class Sphere;*/
friend class IrrEventReciever;
irr::u32 tick;
irr::ITimer* timer;
public:
//IrrSphere Sphere; //This has to be public to be able to access the Sphere class
/* IrrSphere is now in Irr3D class */
//Prehaps put this into a IrrLib3D class?
Irr3D Irr3DLib;
IrrColor Color; //Color class...not much of a class but lets keep it OO
Irr2D Irr2DLib; //1/2 variable to be labeled like this due to variables not able to begin with a number
IrrLibGUI GUI;
IrrEventReciever IrrEvent;
IrrLib::IrrLib();
//IrrLib::IrrLib(MastEventReceiver & receiver);
IrrLib::IrrLib(irr::video::E_DRIVER_TYPE drivertype, irr::core::dimension2d<irr::s32> & res, irr::u32 bits, bool fullscreen, bool stencilbuffer, bool vsync);
IrrLib::IrrLib(int drivertype, int width, int height, int bits, bool fullscreen, bool stencilbuffer, bool vsync);
IrrLib::~IrrLib(); //Our moms wont clean up after us!
void IrrLib::ReadArchive(std::string file);
void IrrLib::LoadQ3Level(std::string q3level);
void IrrLib::MapPos(int x, int y, int z); //I think this moves the actual camera?
void IrrLib::MapPos();
void IrrLib::AddFPSCam();
void IrrLib::AddFPSCam(irr::f32 x, irr::f32 y, irr::f32 z);
void IrrLib::VisibleCursor(bool tf);
int IrrLib::GetFPSCount();
bool IrrLib::DeviceIsRunning();
bool IrrLib::IsActiveWindow();
void IrrLib::BeginScene();
void IrrLib::BeginScene(irr::video::SColor color);
//void IrrLib::BeginScene(irr::video::SColor * color);
void IrrLib::BeginScene(bool usebackBuffer, bool usezBuffer, irr::video::SColor color);
//TODO: Add one more for human readable colors and hex colors!
void IrrLib::DrawAll();
void IrrLib::EndScene();
void IrrLib::SetWindowCaption(irr::core::stringw str);
irr::core::stringw IrrLib::GetDriverName();
//TODO: Make function to turn stringw to string and visa versa
void IrrLib::EndIrrlicht(); //Renamed from KillIrrlicht to EndIrrlicht
//TODO: Add logging
void IrrLib::KeyPress(char key);
char IrrLib::KeyPressed();
irr::f32 getX();
irr::f32 getY();
irr::f32 getZ();
bool CheckGameLoop();
bool CheckGameLoop(irr::u32 ms);
void Exit();
//void EndGameLoop();
//template <class T> std::string to_string (T t);
};
#endif
Stable Version/1.2.6/IrrLibBase.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <irrlicht.h>
#include "IrrLibBase.h"
#include <strings.h>
#include <sstream>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
void IrrLibBase::SetDriver(IVideoDriver* driver) //can be overloaded
{
this->driver = driver;
}
void IrrLibBase::SetSmgr(ISceneManager* smgr)
{
this->smgr = smgr;
}
std::string IrrLibBase::int_to_string (int t)
{
std::stringstream ss;
ss << t;
return ss.str();
}
std::string IrrLibBase::stringw_to_stdstring(irr::core::stringw sw)
{
std::stringstream ss;
ss << sw.c_str();
return ss.str();
}
irr::core::stringw IrrLibBase::stdstring_to_stringw(std::string ss)
{
stringw tmpw(ss.c_str());
return tmpw;
}
void IrrLibBase::SetDevice(irr::IrrlichtDevice *device)
{
this->device = device;
}
void IrrLibBase::init()
{
}
Stable Version/1.2.6/IrrLibBase.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRLIBBASE_H
#define IRRLIBBASE_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
class IrrLibBase {
protected:
irr::video::IVideoDriver* driver;
irr::scene::ISceneManager* smgr;
irr::IrrlichtDevice *device;
public:
void IrrLibBase::SetDriver(irr::video::IVideoDriver* driver);
void IrrLibBase::SetSmgr(irr::scene::ISceneManager* smgr);
void SetDevice(irr::IrrlichtDevice *device);
std::string int_to_string (int t);
std::string stringw_to_stdstring(irr::core::stringw sw);
irr::core::stringw stdstring_to_stringw(std::string ss);
void init();
};
#endif
Stable Version/1.2.6/IrrLibData.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
/*
Purpose of this class is to handle abstract data
Such as:
Stacks
Queues
Dynamic memory(arrays)
Begininers probably wont use this class too much, its used mostly for the advanced - expert programmer.
Howerver, IrrLib and other classes will make use of this class.
*/
/*class Stack {
int cap;
int count;
request *the_stack;
public:
void InitStack(int stacksize);
void Push(request value);
request Top();
request Pop();
~Stack ();
int thecount();
private:
void Push(request *&the_stack, int& nCount, int& nCap, request& value);
//void R
};
class Queue {
int cap;
int count;
request *the_queue;
public:
void InitQueue(int queuesize);
request Pop();
request Front();
request Back();
~Queue();
int thecount();
void Push(request value);
private:
void Push(request *the_stack, int nCount, int nCap, request value);
};*/
Stable Version/1.2.6/IrrLibGUI.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <strings.h>
#include <irrlicht.h>
#include <vector>
#include "IrrLibGUI.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
IrrLibGUI::IrrLibGUI()
{
//NA does it need to do anything at init?
this->nStaticText = 0;
this->nButton = 0;
this->nButtonid = 100;
//this->arrStaticText = new IGUIStaticText[10];
//this->env = this->device->getGUIEnvironment(); //NA yes we do!
}
IrrLibGUI::~IrrLibGUI()
{
//NA Do we have to delete anything?
}
void IrrLibGUI::SetEnv(IGUIEnvironment* env)
{
this->env = env;
//env->addButton(rect<s32>(10,210,110,210 + 32), 0, 109, L"Quit", L"Exits Program");
}
int IrrLibGUI::addButton(const core::rect< s32 > & rectangle, IGUIElement *parent, s32 id, const wchar_t * text, const wchar_t * tooltiptext)
{
arrButton.push_back(this->env->addButton(rectangle, parent, id, text, tooltiptext));
++nButton;
++nButtonid;
return nButtonid - 1;
}
void IrrLibGUI::Clear()
{
this->env->clear();
}
void IrrLibGUI::DrawAll()
{
this->env->drawAll();
}
int IrrLibGUI::AddToStaticArray(irr::gui::IGUIStaticText * addme)
{
//arrStaticText[nStaticText] = addme;
arrStaticText.push_back(addme);
this->nStaticText++;
this->nButtonid++;
return this->nStaticText;
}
void IrrLibGUI::AddStaticText()
{
//rect<s32>(20,30,300,80),
this->env->addStaticText(L"Powered by IrrLib.", rect<s32>(20,30,300,80), true);
}
int IrrLibGUI::AddStaticText(std::string message)
{
irr::gui::IGUIStaticText * addthis;
stringw tmpw(message.c_str());
addthis = this->env->addStaticText(tmpw.c_str(), rect<s32>(20,30,300,80), true);
return AddToStaticArray(addthis);
}
int IrrLibGUI::AddStaticText(std::string message, int x1, int y1, int x2, int y2)
{
irr::gui::IGUIStaticText * addthis;
stringw tmpw(message.c_str());
addthis = this->env->addStaticText(tmpw.c_str(), rect<s32>(x1,y1,x2,y2), true);
return AddToStaticArray(addthis);
}
int IrrLibGUI::AddStaticText(std::string message, int x1, int y1, int x2, int y2, bool border, bool wordwrap)
{
irr::gui::IGUIStaticText * addthis;
stringw tmpw(message.c_str());
addthis = this->env->addStaticText(tmpw.c_str(), rect<s32>(x1,y1,x2,y2), border, wordwrap);
return AddToStaticArray(addthis);
}
int IrrLibGUI::AddStaticText(std::string message, int x1, int y1, int x2, int y2, bool border, bool wordwrap, int id, bool fillbackground)
{
irr::gui::IGUIStaticText * addthis;
stringw tmpw(message.c_str());
addthis = this->env->addStaticText(tmpw.c_str(), rect<s32>(x1,y1,x2,y2), border, wordwrap, 0, id, fillbackground);
return AddToStaticArray(addthis);
}
int IrrLibGUI::AddStaticText(std::string message, const core::rect< s32 > &rectangle)
{
irr::gui::IGUIStaticText * addthis;
stringw tmpw(message.c_str());
addthis = this->env->addStaticText(tmpw.c_str(), rectangle);
return AddToStaticArray(addthis);
}
int IrrLibGUI::AddStaticText(std::string message, const core::rect< s32 > &rectangle, bool border, bool wordwrap)
{
irr::gui::IGUIStaticText * addthis;
stringw tmpw(message.c_str());
addthis = this->env->addStaticText(tmpw.c_str(), rectangle, border, wordwrap);
return AddToStaticArray(addthis);
}
int IrrLibGUI::AddStaticText(std::string message, const core::rect< s32 > &rectangle, bool border, bool wordwrap, int id, bool fillbackground)
{
irr::gui::IGUIStaticText * addthis;
stringw tmpw(message.c_str());
addthis = this->env->addStaticText(tmpw.c_str(), rectangle, border, wordwrap, 0, id, fillbackground);
return AddToStaticArray(addthis);
}
void IrrLibGUI::ChangeStaticText(int nstatictext, std::string message)
{
stringw tmpw(message.c_str());
this->arrStaticText[this->nStaticText-1]->setText(tmpw.c_str());
}
void IrrLibGUI::ChangeFont(std::string fontfile)
{
IGUISkin* skin = this->env->getSkin();
IGUIFont* font = this->env->getFont(fontfile.c_str());
if (font)
skin->setFont(font);
}
int IrrLibGUI::AddButton(std::string text, int x1, int y1, int x2, int y2, std::string tooltiptext = "")
{
return addButton(rect<s32>(x1, y1, x2, y2), 0, nButtonid, stdstring_to_stringw(text).c_str(), stdstring_to_stringw(tooltiptext).c_str());
}
int IrrLibGUI::AddButton(std::string text, core::rect<s32> & rect, std::string tooltiptext = "")
{
return addButton(rect, 0, nButtonid, stdstring_to_stringw(text).c_str(), stdstring_to_stringw(tooltiptext).c_str());
}
Stable Version/1.2.6/IrrLibGUI.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRLIBGUI_H
#define IRRLIBGUI_H
#include <iostream>
#include <strings.h>
#include <irrlicht.h>
#include "IrrLibBase.h"
class IrrLibGUI: public IrrLibBase {
private:
irr::gui::IGUISkin* skin;
irr::gui::IGUIFont* font;
irr::gui::IGUIEnvironment* env;
//TODO: Create an array storing all messages
int nStaticText;
//irr::gui::IGUIStaticText* arrStaticText[10];
int nButton;
int nButtonid;
std::vector<irr::gui::IGUIStaticText*> arrStaticText;
std::vector<irr::gui::IGUIButton*> arrButton;
int AddToStaticArray(irr::gui::IGUIStaticText * addme);
int addButton(const irr::core::rect< irr::s32 > & rectangle, irr::gui::IGUIElement *parent = 0, irr::s32 id = 0, const wchar_t * text = 0, const wchar_t * tooltiptext = 0);
public:
IrrLibGUI();
~IrrLibGUI();
void SetEnv(irr::gui::IGUIEnvironment* env);
void Clear();
void DrawAll();
//irr::gui::IGUIStaticText* IrrLibGUI::AddStaticText(); //NA eh a default text adder why not?
/* This is bad coding, we do not want to return an irrlicht object, we want to return a standard datatype because this class handles the GUI elements, not the user. */
void AddStaticText(); //NA eh a default text adder why not?
int AddStaticText(std::string message);
int AddStaticText(std::string message, int x1, int y1, int x2, int y2);
int AddStaticText(std::string message, int x1, int y1, int x2, int y2, bool border, bool wordwrap);
int AddStaticText(std::string message, int x1, int y1, int x2, int y2, bool border, bool wordwrap, int id, bool fillbackground);
int AddStaticText(std::string message, const irr::core::rect< irr::s32 > &rectangle);
int AddStaticText(std::string message, const irr::core::rect< irr::s32 > &rectangle, bool border, bool wordwrap);
int AddStaticText(std::string message, const irr::core::rect< irr::s32 > &rectangle, bool border, bool wordwrap, int id, bool fillbackground);
int AddButton(std::string text, int x1, int y1, int x2, int y2, std::string tooltiptext);
int AddButton(std::string text, irr::core::rect<irr::s32> & rect, std::string tooltiptext);
void ChangeStaticText(int nstatictext, std::string message);
void ChangeFont(std::string fontfile);
};
#endif
Stable Version/1.2.6/IrrSphere.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include "IrrLib.h"
#include "IrrSphere.h"
#include <irrlicht.h>
#include <strings.h>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
void IrrSphere::SetSmgr(irr::scene::ISceneManager* smgr){
this->smgr = smgr;
}
void IrrSphere::SetDriver(irr::video::IVideoDriver* driver){
this->driver = driver;
}
int IrrSphere::CreateNewSphereNode(int x, int y, int z, std::string texture, bool light){
//TODO: Resize after 10, and add 10 more to the mix!
//this->nodeNew[this->numNodes] = this->smgr->addSphereSceneNode();
sphereNodes.push_back(this->smgr->addSphereSceneNode());
this->sphereNodes[this->numNodes]->setPosition(core::vector3df(x,y,z));
this->sphereNodes[this->numNodes]->setMaterialTexture(0, this->driver->getTexture(texture.c_str()));
this->sphereNodes[this->numNodes]->setMaterialFlag(video::EMF_LIGHTING, light);
this->numNodes++;
return this->numNodes--;
/*this->node = this->smgr->addSphereSceneNode();
this->node->setPosition(core::vector3df(x,y,z));
this->node->setMaterialTexture(0, this->driver->getTexture(texture.c_str()));
this->node->setMaterialFlag(video::EMF_LIGHTING, light);*/
}
irr::core::vector3df IrrSphere::GetSphereVector(int sphere){
//We are converting to vectors, under construction NA
//return this->nodeNew[sphere]->getPosition();
return this->sphereNodes[sphere]->getPosition();
}
void IrrSphere::SetSphereVector(int sphere, irr::core::vector3df v){
this->sphereNodes[sphere]->setPosition(v);
}
IrrSphere::IrrSphere(){
this->numNodes = 0;
}
IrrSphere::~IrrSphere(){
/*for(int i = 0; i < numNodes; ++i)
delete this->nodeNew[i];
delete this->nodeNew;*/
//We are using vectors now, no more memory clowing business NA
}
Stable Version/1.2.6/IrrSphere.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRSPHERE_H
#define IRRSPHERE_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
#include <vector>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
//#include "IrrLib.h"
class IrrSphere
{
private:
//irr::scene::ISceneNode* nodeNew[10];
//irr::scene::ISceneNode* nodeNew[10];
std::vector<irr::scene::ISceneNode*> sphereNodes;
int numNodes;
irr::scene::ISceneManager* smgr;
irr::video::IVideoDriver* driver;
public:
void IrrSphere::SetDriver(irr::video::IVideoDriver* driver);
void IrrSphere::SetSmgr(irr::scene::ISceneManager* smgr);
int IrrSphere::CreateNewSphereNode(int x, int y, int z, std::string texture, bool light); //this is going to take my advanced C++ skillz!
irr::core::vector3df IrrSphere::GetSphereVector(int sphere);
void IrrSphere::SetSphereVector(int sphere, irr::core::vector3df v);
IrrSphere::IrrSphere();
//IrrSphere::IrrSphere(IrrLib*);
IrrSphere::~IrrSphere();
};
#endif
Stable Version/1.2.6/IrrSprite.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <irrlicht.h>
#include <strings.h>
#include "IrrLib.h"
//Libraries we create go here
//#include "IrrSphere.h"
#include "IrrColor.h"
#include "IrrSprite.h"
//#include "Irr2D.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
IrrSprite::IrrSprite()
{
//do stuff
}
IrrSprite::~IrrSprite()
{
//delete stuff
}
void IrrSprite::SetDriver(irr::video::IVideoDriver* driver)
{
this->driver = driver;
}
void IrrSprite::SetSmgr(irr::scene::ISceneManager* smgr)
{
this->smgr = smgr;
}
Stable Version/1.2.6/IrrSprite.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRSPRITE_H
#define IRRSPRITE_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
//#include "IrrSphere.h"
#include "IrrColor.h"
//#include "Irr2D.h"
//#include "IrrSprite.h"
//Start class
class IrrSprite {
private:
irr::video::IVideoDriver* driver;
irr::scene::ISceneManager* smgr;
public:
IrrSprite::IrrSprite();
IrrSprite::~IrrSprite();
void IrrSprite::SetDriver(irr::video::IVideoDriver* driver);
void IrrSprite::SetSmgr(irr::scene::ISceneManager* smgr);
// I forgot a semicolon here....and it wasn't compling
//Thats 1 bad thing about OOP if there is an error you don't know where the @#$@# the problem is!
};
#endif
Stable Version/1.2.6/README
1
2
3
4
5
6
7
8
9
10
11
12
13
Irrlicht Library Wrapper
Created by Nathan Adams
Version 1.2.6
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
Please leave all files intact if you redistrubte this software.
How to use:
Add all the files to your Irrlicht project, you could compile it into a DLL if you wanted too, but for now just add all the files to your project.
Then inside your complier add the directory that you have the IrrLib files and use #include "IrrLib.h" to refrence it, and you are good to go!
Stable Version/1.2.7/CHANGES
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
Version 1.2
+ Added a Irr3DLib class that will control all 3D objects
+ Also Added a Irr2D class that works on the same concept.
+ IrrSphere is now owned by Irr3DLib
+ Updated the examples using the latest code
Version 1.2.2
+ Added IrrEventReciever to handle all input
- Still under work
+ Fixed some misc coding bugs
+ Added template class
+ Added sprite class
+ Added GUI class
Version 1.2.3
+ IrrEventReciver now works as advertised
+ Baseclass is now being used
+ A couple somewhat-useful functions
+ int_to_string
+ stringw_to_stdstring
+ stdstring_to_stringw
+ GUI elements
+ Static text is working
+ Under construction for a data type class
Version 1.2.4
+ Implmented color codes accessiable through the class
+ IrrLib.Color.RED (ect)
Version 1.2.5
+ Implmented mouse events
+ IrrLib.IrrEvent.getMouseX();
+ IrrLib.IrrEvent.getMouseY();
+ Using vectors instead of static arrays
+ Side note: Was going to use dynamic arrays, but C++ has vectors which are 10x better.
+ Added a default exit for when you hit esc
+ Use IrrLib.IrrEvent.SetEscExit(false) to turn that off for your software
+ Use IrrLib.IrrEvent.SetEscExit(true) to turn it back on
+ Every stable version will now include a windows DLL.
+ Possible Linux .so file in the future.
Version 1.2.6
+ Added a IrrEvent for buttons
+ IrrLib.IrrEvent.checkButtonState();
+ See example for use
+ Added an AddButton function
+ IrrLib.GUI.AddButton(..);
+ See example for use
+ Problems with making the DLL
+ reasearching
Version 1.2.7
+ Fixed DLL Problem
+ Added an enum example to example 1
+ Added more examples
+ Added example 9
+ Added left click handling (see example 9)
+ Added AddLines function to Irr2D
+ DrawLines function in Irr2D will draw the lines you add
Stable Version/1.2.7/CREDITS
1
2
3
4
5
6
7
IrrLib
Created by
Nathan Adams
Denzel Morris
From #irrlicht
Acid
Stable Version/1.2.7/Irr2D.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
//#include "IrrLib.h"
//#include "IrrSphere.h" //You probably aren't going to be using 3D objects in a 2D environment!
#include <irrlicht.h>
#include <strings.h>
#include "Irr2D.h"
#include "IrrSprite.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
Irr2D::Irr2D(){
this->numTextures = 0;
this->numLines = 0;
//NA Should we set textures to new
}
Irr2D::~Irr2D(){
/*for(int i = 0; i < numTextures; ++i)
delete this->textures[i];
delete this->textures;*/
//No more dynamic memory business yay! NA
}
void Irr2D::SetSmgr(irr::scene::ISceneManager* smgr){
this->smgr = smgr;
Sprite.SetSmgr(smgr);
}
void Irr2D::SetDriver(irr::video::IVideoDriver* driver){
this->driver = driver;
Sprite.SetDriver(driver);
}
void Irr2D::LoadTexturemap(std::string file){
this->texturemap = driver->getTexture(file.c_str());
}
int Irr2D::LoadTexture(std::string file){
//this->textures[this->numTextures] = driver->getTexture(file.c_str());
textures.push_back(driver->getTexture(file.c_str()));
this->numTextures++;
return numTextures--;
}
void Irr2D::DrawLine(irr::core::position2d<irr::s32>& start, irr::core::position2d<irr::s32>& end, irr::video::SColor& color)
{
this->driver->draw2DLine(start, end, color);
}
void Irr2D::AddLines(irr::core::position2d<irr::s32>& start, irr::core::position2d<irr::s32>& end, irr::video::SColor& color)
{
this->start.push_back(start);
this->end.push_back(end);
this->color.push_back(color);
this->numLines++;
}
void Irr2D::DrawLines()
{
for(int i = 0; i < numLines; ++i)
this->driver->draw2DLine(this->start[i], this->end[i], this->color[i]);
}
Stable Version/1.2.7/Irr2D.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRR2D_H
#define IRR2D_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
#include <vector>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
//#include "IrrLib.h"
#include "IrrSprite.h"
class Irr2D {
private:
irr::scene::ISceneManager* smgr;
irr::video::IVideoDriver* driver;
irr::video::ITexture* texturemap;
int numTextures;
//irr::video::ITexture* textures[10];
std::vector<irr::video::ITexture*> textures;
std::vector<irr::core::position2d<irr::s32> > start;
std::vector<irr::core::position2d<irr::s32> > end;
std::vector<irr::video::SColor> color;
int numLines;
public:
//Irr2D::Irr2D();
IrrSprite Sprite;
Irr2D::Irr2D();
Irr2D::~Irr2D();
void Irr2D::SetDriver(irr::video::IVideoDriver* driver);
void Irr2D::SetSmgr(irr::scene::ISceneManager* smgr);
void Irr2D::LoadTexturemap(std::string file);
int Irr2D::LoadTexture(std::string file);
void Irr2D::DrawImage(int texture, const irr::core::position2d<irr::s32> & destPos);
void Irr2D::DrawImage(const irr::core::position2d<irr::s32> & destPos, const irr::core::rect<irr::s32> & sourceRect, const irr::core::rect<irr::s32> * clipRect, irr::video::SColor color, bool useAlphaChannelOfTexture);
void Irr2D::DrawLine(irr::core::position2d<irr::s32>& start, irr::core::position2d<irr::s32>& end, irr::video::SColor& color);
void Irr2D::DrawLines();
void Irr2D::AddLines(irr::core::position2d<irr::s32>& start, irr::core::position2d<irr::s32>& end, irr::video::SColor& color);
};
#endif
Stable Version/1.2.7/Irr3D.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <strings.h>
//#include "IrrLib.h"
//Libraries we create go here
#include "IrrSphere.h"
//#include "IrrColor.h"
#include "Irr3D.h"
#include <irrlicht.h>
//#include "Irr2D.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
void Irr3D::SetDriver(irr::video::IVideoDriver* driver) //so much for copying and pasting code from the header file
{
this->driver = driver;
Sphere.SetDriver(driver);
}
void Irr3D::SetSmgr(irr::scene::ISceneManager* smgr)
{
this->smgr = smgr;
Sphere.SetSmgr(smgr);
}
Irr3D::Irr3D()
{
//do stuff here!
}
Irr3D::~Irr3D()
{
//delete stuff here!
}
Stable Version/1.2.7/Irr3D.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRR3D_H
#define IRR3D_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
#include "IrrSphere.h"
//#include "IrrColor.h"
//#include "Irr3D.h"
//#include "Irr2D.h" This is a 3D class not 2D
/* However due to Irrlciht's nature mixing 2D with 3D is possible */
//Start class
class Irr3D {
private:
irr::video::IVideoDriver* driver;
irr::scene::ISceneManager* smgr;
public:
IrrSphere Sphere;
Irr3D::Irr3D();
Irr3D::~Irr3D();
void Irr3D::SetDriver(irr::video::IVideoDriver* driver);
void Irr3D::SetSmgr(irr::scene::ISceneManager* smgr);
};
#endif
Stable Version/1.2.7/IrrColor.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <irrlicht.h>
#include <strings.h>
//#include "IrrLib.h"
#include "IrrColor.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
void IrrColor::Init(){
/*SColor * temp;
temp = new SColor(alpha, 255, 0, 0);
this->RED = temp;
delete temp;*/
this->RED = SColor(alpha, 255, 0, 0);
this->ORANGE = SColor(alpha, 255, 165, 0);
this->YELLOW = SColor(alpha, 255, 255, 0);
this->GREEN = SColor(alpha, 0, 255, 0);
this->BLUE = SColor(alpha, 0, 0, 255);
this->DARK_GREEN = SColor(alpha, 0, 100, 0);
this->PINK = SColor(alpha, 255, 192, 203);
this->GREY = SColor(alpha, 190, 190, 190);
}
IrrColor::~IrrColor(){
//delete this->RED;
}
IrrColor::IrrColor(){
this->alpha = 255;
Init();
}
IrrColor::IrrColor(irr::u32 alpha){
this->alpha = alpha;
Init();
}
int IrrColor::getAlpha(){
return this->alpha;
}
void IrrColor::setAlpha(int alpha){
this->alpha = alpha;
}
SColor IrrColor::returnColor(std::string color){
int nColor = -1;
if (color == "red")
nColor = 1;
else if (color == "green")
nColor = 2;
else if (color == "blue")
nColor = 3;
else if (color == "dark green")
nColor = 4;
else if (color == "pink")
nColor = 5;
else if (color == "grey")
nColor = 6;
switch (nColor){
case 1:
return SColor(255, 255, 0, 0);
break;
case 2:
return SColor(255, 0, 255, 0);
break;
case 3:
return SColor(255, 0, 0, 255);
break;
case 4:
return SColor(255, 0, 50, 0);
break;
case 5:
return SColor(255, 255, 10, 255);
break;
case 6:
return SColor(255,200,200,200);
break;
default:
return SColor(255,200,200,200);
break;
}// TODO: Make this function modular
}
Stable Version/1.2.7/IrrColor.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRCOLOR_H
#define IRRCOLOR_H
#include <iostream>
#include <strings.h>
#include "irrlicht.h"
//#include "IrrLib.h"
class IrrColor {
private:
irr::u32 alpha;
void Init();
//who knows?
public:
//irr::video::SColor(alpha, 255, 0, 0);
irr::video::SColor RED;
irr::video::SColor ORANGE;
irr::video::SColor YELLOW;
irr::video::SColor GREEN;
irr::video::SColor BLUE;
irr::video::SColor DARK_GREEN;
irr::video::SColor PINK;
irr::video::SColor GREY;
/*const ORANGE = irr::video::SColor(alpha, 255, 165, 0);
const YELLOW = irr::video::SColor(alpha, 255, 255, 0);
const GREEN = irr::video::SColor(alpha, 0, 255, 0);
const BLUE = irr::video::SColor(alpha, 0, 0, 255);
const DARK_GREEN = irr::video::SColor(alpha, 0, 100, 0);
const PINK = irr::video::SColor(alpha, 255, 192, 203);
const GREY = irr::video::Scolor(alpha, 190, 190, 190);*/
//void IrrColor::test();
IrrColor();
IrrColor(irr::u32 alpha);
~IrrColor();
int getAlpha();
void setAlpha(int alpha);
irr::video::SColor IrrColor::returnColor(std::string color);
};
#endif
Stable Version/1.2.7/IrrEventReciever.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include "IrrEventReciever.h"
//#include "IrrLib.h"
#include <irrlicht.h>
#include <iostream>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
/*void IrrEventReciever::setIrrLib(IrrLib& IrrLib)
{
this.callingIrrLib = IrrLib;
}*/
IrrEventReciever::IrrEventReciever()
{
this->escexit = true;
this->mouse.x = 0;
this->mouse.y = 0;
}
bool IrrEventReciever::OnEvent(SEvent event)
{
// A button was clicked
if (event.EventType == irr::EET_GUI_EVENT)
{
switch(event.GUIEvent.EventType){
case EGET_BUTTON_CLICKED:
s32 id = event.GUIEvent.Caller->getID();
//cout << id << endl;
buttonStates.push_back(id);
break;
default:
break;
}
}
/*if (event.EventType == irr::EGET_SCROLL_BAR_CHANGED)
{
}*/
if (event.EventType == irr::EET_KEY_INPUT_EVENT) {
if (!event.KeyInput.PressedDown){
this->keyStates[event.KeyInput.Key] = false;
//cout << "Key was not hit " << this->keyStates[event.KeyInput.Key] << endl;
}
else{
if(event.KeyInput.Key == KEY_ESCAPE && escexit)
this->device->closeDevice();
this->keyStates[event.KeyInput.Key] = true;
//cout << "Key was hit: " << event.KeyInput.Key << " " << this->keyStates[event.KeyInput.Key] << endl;
}
}
if (event.EventType == EET_MOUSE_INPUT_EVENT){
if (event.MouseInput.Event == EMIE_MOUSE_MOVED){
this->mouse.x = event.MouseInput.X;
this->mouse.y = event.MouseInput.Y;
}
if (event.MouseInput.Event == EMIE_LMOUSE_PRESSED_DOWN)
this->mouseStates[0] = true;
if (event.MouseInput.Event == EMIE_LMOUSE_LEFT_UP)
this->mouseStates[0] = false;
}
return false;
}
void IrrEventReciever::SetEscExit(bool onoff)
{
this->escexit = onoff;
}
int IrrEventReciever::getMouseX()
{
return this->mouse.x;
}
int IrrEventReciever::getMouseY()
{
return this->mouse.y;
}
int IrrEventReciever::getButtonState()
{
if(!this->buttonStates.empty()){
int id;
id = buttonStates.back();
this->buttonStates.pop_back();
return id;
}
else
return -1;
}
int IrrEventReciever::getRevButtonState()
{
if(!this->buttonStates.empty()){
int id = buttonStates.front();
this->buttonStates.erase(buttonStates.begin());
return id;
}
else
return -1;
}
void IrrEventReciever::clearButtonState()
{
this->buttonStates.clear();
}
int IrrEventReciever::checkButtonState()
{
if(!this->buttonStates.empty())
return this->buttonStates.back();
else
return -1;
}
void IrrEventReciever::delLastButtonStat()
{
if(!this->buttonStates.empty())
this->buttonStates.pop_back();
}
bool IrrEventReciever::isButtonStateEmpty()
{
return this->buttonStates.empty();
}
Stable Version/1.2.7/IrrEventReciever.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRREVENTRECIEVER_H
#define IRREVENTRECIEVER_H
//#include "IrrLib.h"
#include <vector>
#include <irrlicht.h>
#include "IrrLibBase.h"
struct _mouse {
int x;
int y;
};
class IrrEventReciever : public irr::IEventReceiver, public IrrLibBase
{
private:
//IrrLib callingIrrLib;
_mouse mouse;
bool escexit;
std::vector<int> buttonStates;
public:
bool mouseStates[1];
IrrEventReciever();
int getMouseX();
int getMouseY();
bool keyStates[irr::KEY_KEY_CODES_COUNT];
//void setIrrLib(IrrLib& IrrLib)
virtual bool OnEvent(irr::SEvent event);
void SetEscExit(bool onoff);
int getButtonState();
int getRevButtonState();
void clearButtonState();
int checkButtonState();
void delLastButtonStat();
bool isButtonStateEmpty(); //is there still stuff in the vector to be done? NA
};
#endif
Stable Version/1.2.7/IrrLib.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <irrlicht.h>
#include <strings.h>
#include <sstream>
#include <time.h>
#include "IrrLib.h"
//Libraries we create go here
//#include "IrrSphere.h"
#include "IrrColor.h"
//#include "Irr2D.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
//TODO: Create own class for handling inputs!
/*IrrLib::IrrLib(MastEventReceiver & receiver){
this->device = createDevice(EDT_SOFTWARE, dimension2d<s32>(640, 480), 16, false, false, false, &receiver);
if (this->device == 0)
exit(1);
IrrLib::Init();
}*/
IrrLib::IrrLib(){
this->device = createDevice(EDT_SOFTWARE, dimension2d<s32>(640, 480), 16, false, false, false, &this->IrrEvent);
if (this->device == 0)
exit(1);
IrrLib::Init();
}
IrrLib::IrrLib(video::E_DRIVER_TYPE drivertype, core::dimension2d<s32> & res, u32 bits, bool fullscreen, bool stencilbuffer, bool vsync){
//MyEventReceiver receiver;
this->device = createDevice(drivertype, res, bits, fullscreen, stencilbuffer, vsync, &this->IrrEvent);
if (this->device == 0)
exit(1);
IrrLib::Init();
}
IrrLib::IrrLib(int nDrivertype, int width, int height, int bits, bool fullscreen, bool stencilbuffer, bool vsync){
//MyEventReceiver receiver;
video::E_DRIVER_TYPE drivertype;
switch (nDrivertype){
case 0: //TODO: finish this switch case
drivertype = EDT_NULL;
break;
case 1:
drivertype = EDT_SOFTWARE;
break;
case 2:
drivertype = EDT_BURNINGSVIDEO;
break;
case 3:
drivertype = EDT_OPENGL;
break;
case 4:
drivertype = EDT_DIRECT3D8;
//*Note: It seems as Microsoft has stoped supporting DX 8.1, so you can not compile it into Irrlicht engine anymore
//TODO: Find how to detect if DX is complied into Irrlicht
//TODO: Find how to detecht for linux
break;
case 5:
drivertype = EDT_DIRECT3D9;
break;
default:
drivertype = EDT_SOFTWARE;
break;
}
this->device = createDevice(drivertype, dimension2d<s32>(width, height), bits, fullscreen, stencilbuffer, vsync, &this->IrrEvent);
if (this->device == 0)
exit(1);
IrrLib::Init();
}
IrrLib::~IrrLib (){ //Our moms wont clean up after us!
//Although I'm sure Irrlicht does this for us already, its always a good idea to check!
/*if (this->device != NULL)
delete this->device;
if (this->driver != NULL)
delete this->driver;
if (this->smgr != NULL)
delete this->smgr;
if (this->mesh != NULL)
delete this->mesh;
if (this->node != NULL)
delete this->node;*/ //it seems Irrlicht picks up after us...
//however we created newNodes, now we need to delete it!
}
void IrrLib::Init(){
//this->numNodes = 0;
//this->nodeNew = new ISceneNode[10];
//this->env->addStaticText(L"Transparent Control:", rect<s32>(20,30,300,80), true);
this->env = this->device->getGUIEnvironment();
this->driver = this->device->getVideoDriver();
this->smgr = this->device->getSceneManager();
Irr3DLib.SetSmgr(this->smgr);
Irr3DLib.SetDriver(this->driver);
Irr2DLib.SetSmgr(this->smgr);
Irr2DLib.SetDriver(this->driver);
GUI.SetEnv(this->env);
IrrEvent.SetDevice(this->device);
this->timer = this->device->getTimer();
tick = this->timer->getRealTime();
}
void IrrLib::ReadArchive(std::string file){
this->device->getFileSystem()->addZipFileArchive(file.c_str());
}
void IrrLib::LoadQ3Level(std::string q3level){
this->mesh = this->smgr->getMesh(q3level.c_str());
this->node = 0;
if (this->mesh)
this->node = this->smgr->addOctTreeSceneNode(this->mesh->getMesh(0), 0, -1, 128);
}
void IrrLib::MapPos(int x, int y, int z){
if (this->node)
this->node->setPosition(core::vector3df(x, y, z));
}
void IrrLib::MapPos(){
if (this->node)
this->node->setPosition(core::vector3df(0, 0, 0));
}
void IrrLib::AddFPSCam(){
this->cam = this->smgr->addCameraSceneNodeFPS();
}
void IrrLib::AddFPSCam(f32 x, f32 y, f32 z)
{
this->cam = this->smgr->addCameraSceneNodeFPS();
this->cam->setPosition(irr::core::vector3df(x, y, z));
}
void IrrLib::VisibleCursor(bool tf){
if (tf == false)
this->device->getCursorControl()->setVisible(false);
else
this->device->getCursorControl()->setVisible(true);
}
int IrrLib::GetFPSCount(){
return this->driver->getFPS();
}
bool IrrLib::DeviceIsRunning(){
return this->device->run();
}
bool IrrLib::IsActiveWindow(){
return this->device->isWindowActive();
}
void IrrLib::BeginScene(){
this->driver->beginScene(true, true, video::SColor(0,200,200,200));
}
void IrrLib::BeginScene(irr::video::SColor color){
this->driver->beginScene(true, true, color);
}
void IrrLib::BeginScene(bool usebackBuffer, bool usezBuffer, irr::video::SColor color){
this->driver->beginScene(usebackBuffer, usezBuffer, color);
}
void IrrLib::DrawAll(){
//position2d<int> start(50, 50);
//position2d<int> end(100,100);
// SColor whitecolor(255,255,255,255);
//driver->draw2DLine(start, end, whitecolor);
this->smgr->drawAll();
this->env->drawAll();
//this->device->getGUIEnvironment()->drawAll();
}
void IrrLib::EndScene(){
this->driver->endScene();
}
void IrrLib::SetWindowCaption(stringw str){
this->device->setWindowCaption(str.c_str());
}
irr::core::stringw IrrLib::GetDriverName(){
return this->driver->getName();
}
void IrrLib::EndIrrlicht(){
if(this->device != NULL){
this->device->drop();
this->device = NULL;
}
}
void IrrLib::KeyPress(char key){
this->key = key;
}
char IrrLib::KeyPressed(){
return key;
}
irr::f32 IrrLib::getX(){
return this->smgr->getActiveCamera()->getPosition().X;
}
irr::f32 IrrLib::getY(){
return this->smgr->getActiveCamera()->getPosition().Y;
}
irr::f32 IrrLib::getZ(){
return this->smgr->getActiveCamera()->getPosition().Z;
}
bool IrrLib::CheckGameLoop(){
u32 now;
now = this->timer->getRealTime();
if ((now - this->tick) >= 30){
//this->tick == time (NULL);
return true;
} else {
return false;
}
}
bool IrrLib::CheckGameLoop(u32 ms){
u32 now;
now = this->timer->getRealTime();
if ((now - this->tick) >= ms){
this->tick = now;
return true;
} else {
return false;
}
}
void IrrLib::Exit()
{
this->device->closeDevice();
}
dimension2d<s32> IrrLib::GetScreenSize()
{
return this->driver->getScreenSize();
/*pixels returnres;
returnres.width = screenres.Width;
returnres.height = screenres.Height;
return returnres;*/
}
//template <class T> std::string IrrLib::to_string (T t)
/*std::string IrrLib::int_to_string (int t)
{
std::stringstream ss;
ss << t;
return ss.str();
}*/
// This is in the base class now, every class that decends from that class has this ability.
Stable Version/1.2.7/IrrLib.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRLIB_H
#define IRRLIB_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
#include <irrlicht.h>
#include <time.h>
/* We have to include Irrlichts libs */
#include "Irr3D.h"
#include "IrrColor.h"
#include "IrrLibGUI.h"
#include "IrrEventReciever.h"
#include "Irr2D.h"
#include "IrrLibBase.h"
//Start class
class IrrLib: public IrrLibBase {
private:
/* Create an Irrlicht device as private because the class should handle
All irrlicht interaction */
irr::IrrlichtDevice *device;
// Tells Irrlicht what driver to use
//video::E_DRIVER_TYPE driverType;
/*
Get a pointer to the video driver and the SceneManager so that
we do not always have to write device->getVideoDriver() and
device->getSceneManager().
*/
irr::video::IVideoDriver* driver;
irr::scene::ISceneManager* smgr;
irr::gui::IGUIEnvironment* env;
/*
Get a pointer to the 'mesh' aka the level.
Note: This is for Quake3 levels, ie bsp maps.
*/
irr::scene::IAnimatedMesh* mesh;
irr::scene::ISceneNode* node;
irr::scene::ISceneNode * tempNode; //use this to store nodeNew's data so we can resize it
irr::scene::ICameraSceneNode * cam;
char key;
void IrrLib::Init();
/*friend class IrrColor;
friend class Irr2DLib;
friend class Sphere;*/
friend class IrrEventReciever;
irr::u32 tick;
irr::ITimer* timer;
public:
//IrrSphere Sphere; //This has to be public to be able to access the Sphere class
/* IrrSphere is now in Irr3D class */
//Prehaps put this into a IrrLib3D class?
Irr3D Irr3DLib;
IrrColor Color; //Color class...not much of a class but lets keep it OO
Irr2D Irr2DLib; //1/2 variable to be labeled like this due to variables not able to begin with a number
IrrLibGUI GUI;
IrrEventReciever IrrEvent;
IrrLib::IrrLib();
//IrrLib::IrrLib(MastEventReceiver & receiver);
IrrLib::IrrLib(irr::video::E_DRIVER_TYPE drivertype, irr::core::dimension2d<irr::s32> & res, irr::u32 bits, bool fullscreen, bool stencilbuffer, bool vsync);
IrrLib::IrrLib(int drivertype, int width, int height, int bits, bool fullscreen, bool stencilbuffer, bool vsync);
IrrLib::~IrrLib(); //Our moms wont clean up after us!
void IrrLib::ReadArchive(std::string file);
void IrrLib::LoadQ3Level(std::string q3level);
void IrrLib::MapPos(int x, int y, int z); //I think this moves the actual camera?
void IrrLib::MapPos();
void IrrLib::AddFPSCam();
void IrrLib::AddFPSCam(irr::f32 x, irr::f32 y, irr::f32 z);
void IrrLib::VisibleCursor(bool tf);
int IrrLib::GetFPSCount();
bool IrrLib::DeviceIsRunning();
bool IrrLib::IsActiveWindow();
void IrrLib::BeginScene();
void IrrLib::BeginScene(irr::video::SColor color);
//void IrrLib::BeginScene(irr::video::SColor * color);
void IrrLib::BeginScene(bool usebackBuffer, bool usezBuffer, irr::video::SColor color);
//TODO: Add one more for human readable colors and hex colors!
void IrrLib::DrawAll();
void IrrLib::EndScene();
void IrrLib::SetWindowCaption(irr::core::stringw str);
irr::core::stringw IrrLib::GetDriverName();
//TODO: Make function to turn stringw to string and visa versa
void IrrLib::EndIrrlicht(); //Renamed from KillIrrlicht to EndIrrlicht
//TODO: Add logging
void IrrLib::KeyPress(char key);
char IrrLib::KeyPressed();
irr::f32 getX();
irr::f32 getY();
irr::f32 getZ();
bool CheckGameLoop();
bool CheckGameLoop(irr::u32 ms);
void Exit();
irr::core::dimension2d<irr::s32> GetScreenSize();
//void EndGameLoop();
//template <class T> std::string to_string (T t);
};
#endif
Stable Version/1.2.7/IrrLibBase.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <irrlicht.h>
#include "IrrLibBase.h"
#include <strings.h>
#include <sstream>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
void IrrLibBase::SetDriver(IVideoDriver* driver) //can be overloaded
{
this->driver = driver;
}
void IrrLibBase::SetSmgr(ISceneManager* smgr)
{
this->smgr = smgr;
}
std::string IrrLibBase::int_to_string (int t)
{
std::stringstream ss;
ss << t;
return ss.str();
}
std::string IrrLibBase::stringw_to_stdstring(irr::core::stringw sw)
{
std::stringstream ss;
ss << sw.c_str();
return ss.str();
}
irr::core::stringw IrrLibBase::stdstring_to_stringw(std::string ss)
{
stringw tmpw(ss.c_str());
return tmpw;
}
void IrrLibBase::SetDevice(irr::IrrlichtDevice *device)
{
this->device = device;
}
void IrrLibBase::init()
{
}
Stable Version/1.2.7/IrrLibBase.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRLIBBASE_H
#define IRRLIBBASE_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
class IrrLibBase {
protected:
irr::video::IVideoDriver* driver;
irr::scene::ISceneManager* smgr;
irr::IrrlichtDevice *device;
public:
struct pixels {
int width;
int height;
}; //possible future use in 2D objects when specifying the properties of an object draw
void IrrLibBase::SetDriver(irr::video::IVideoDriver* driver);
void IrrLibBase::SetSmgr(irr::scene::ISceneManager* smgr);
void SetDevice(irr::IrrlichtDevice *device);
std::string int_to_string (int t);
std::string stringw_to_stdstring(irr::core::stringw sw);
irr::core::stringw stdstring_to_stringw(std::string ss);
void init();
};
#endif
Stable Version/1.2.7/IrrLibGUI.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <strings.h>
#include <irrlicht.h>
#include <vector>
#include "IrrLibGUI.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
IrrLibGUI::IrrLibGUI()
{
//NA does it need to do anything at init?
this->nStaticText = 0;
this->nButton = 0;
this->nButtonid = 100;
//this->arrStaticText = new IGUIStaticText[10];
//this->env = this->device->getGUIEnvironment(); //NA yes we do!
}
IrrLibGUI::~IrrLibGUI()
{
//NA Do we have to delete anything?
}
void IrrLibGUI::SetEnv(IGUIEnvironment* env)
{
this->env = env;
//env->addButton(rect<s32>(10,210,110,210 + 32), 0, 109, L"Quit", L"Exits Program");
}
int IrrLibGUI::addButton(const core::rect< s32 > & rectangle, IGUIElement *parent, s32 id, const wchar_t * text, const wchar_t * tooltiptext)
{
arrButton.push_back(this->env->addButton(rectangle, parent, id, text, tooltiptext));
++nButton;
++nButtonid;
return nButtonid - 1;
}
void IrrLibGUI::Clear()
{
this->env->clear();
}
void IrrLibGUI::DrawAll()
{
this->env->drawAll();
}
int IrrLibGUI::AddToStaticArray(irr::gui::IGUIStaticText * addme)
{
//arrStaticText[nStaticText] = addme;
arrStaticText.push_back(addme);
this->nStaticText++;
this->nButtonid++;
return this->nStaticText;
}
void IrrLibGUI::AddStaticText()
{
//rect<s32>(20,30,300,80),
this->env->addStaticText(L"Powered by IrrLib.", rect<s32>(20,30,300,80), true);
}
int IrrLibGUI::AddStaticText(std::string message)
{
irr::gui::IGUIStaticText * addthis;
stringw tmpw(message.c_str());
addthis = this->env->addStaticText(tmpw.c_str(), rect<s32>(20,30,300,80), true);
return AddToStaticArray(addthis);
}
int IrrLibGUI::AddStaticText(std::string message, int x1, int y1, int x2, int y2)
{
irr::gui::IGUIStaticText * addthis;
stringw tmpw(message.c_str());
addthis = this->env->addStaticText(tmpw.c_str(), rect<s32>(x1,y1,x2,y2), true);
return AddToStaticArray(addthis);
}
int IrrLibGUI::AddStaticText(std::string message, int x1, int y1, int x2, int y2, bool border, bool wordwrap)
{
irr::gui::IGUIStaticText * addthis;
stringw tmpw(message.c_str());
addthis = this->env->addStaticText(tmpw.c_str(), rect<s32>(x1,y1,x2,y2), border, wordwrap);
return AddToStaticArray(addthis);
}
int IrrLibGUI::AddStaticText(std::string message, int x1, int y1, int x2, int y2, bool border, bool wordwrap, int id, bool fillbackground)
{
irr::gui::IGUIStaticText * addthis;
stringw tmpw(message.c_str());
addthis = this->env->addStaticText(tmpw.c_str(), rect<s32>(x1,y1,x2,y2), border, wordwrap, 0, id, fillbackground);
return AddToStaticArray(addthis);
}
int IrrLibGUI::AddStaticText(std::string message, const core::rect< s32 > &rectangle)
{
irr::gui::IGUIStaticText * addthis;
stringw tmpw(message.c_str());
addthis = this->env->addStaticText(tmpw.c_str(), rectangle);
return AddToStaticArray(addthis);
}
int IrrLibGUI::AddStaticText(std::string message, const core::rect< s32 > &rectangle, bool border, bool wordwrap)
{
irr::gui::IGUIStaticText * addthis;
stringw tmpw(message.c_str());
addthis = this->env->addStaticText(tmpw.c_str(), rectangle, border, wordwrap);
return AddToStaticArray(addthis);
}
int IrrLibGUI::AddStaticText(std::string message, const core::rect< s32 > &rectangle, bool border, bool wordwrap, int id, bool fillbackground)
{
irr::gui::IGUIStaticText * addthis;
stringw tmpw(message.c_str());
addthis = this->env->addStaticText(tmpw.c_str(), rectangle, border, wordwrap, 0, id, fillbackground);
return AddToStaticArray(addthis);
}
void IrrLibGUI::ChangeStaticText(int nstatictext, std::string message)
{
stringw tmpw(message.c_str());
this->arrStaticText[this->nStaticText-1]->setText(tmpw.c_str());
}
void IrrLibGUI::ChangeFont(std::string fontfile)
{
IGUISkin* skin = this->env->getSkin();
IGUIFont* font = this->env->getFont(fontfile.c_str());
if (font)
skin->setFont(font);
}
int IrrLibGUI::AddButton(std::string text, int x1, int y1, int x2, int y2, std::string tooltiptext = "")
{
return addButton(rect<s32>(x1, y1, x2, y2), 0, nButtonid, stdstring_to_stringw(text).c_str(), stdstring_to_stringw(tooltiptext).c_str());
}
int IrrLibGUI::AddButton(std::string text, core::rect<s32> & rect, std::string tooltiptext = "")
{
return addButton(rect, 0, nButtonid, stdstring_to_stringw(text).c_str(), stdstring_to_stringw(tooltiptext).c_str());
}
Stable Version/1.2.7/IrrLibGUI.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRLIBGUI_H
#define IRRLIBGUI_H
#include <iostream>
#include <strings.h>
#include <irrlicht.h>
#include "IrrLibBase.h"
class IrrLibGUI: public IrrLibBase {
private:
irr::gui::IGUISkin* skin;
irr::gui::IGUIFont* font;
irr::gui::IGUIEnvironment* env;
//TODO: Create an array storing all messages
int nStaticText;
//irr::gui::IGUIStaticText* arrStaticText[10];
int nButton;
int nButtonid;
std::vector<irr::gui::IGUIStaticText*> arrStaticText;
std::vector<irr::gui::IGUIButton*> arrButton;
int AddToStaticArray(irr::gui::IGUIStaticText * addme);
int addButton(const irr::core::rect< irr::s32 > & rectangle, irr::gui::IGUIElement *parent = 0, irr::s32 id = 0, const wchar_t * text = 0, const wchar_t * tooltiptext = 0);
public:
IrrLibGUI();
~IrrLibGUI();
void SetEnv(irr::gui::IGUIEnvironment* env);
void Clear();
void DrawAll();
//irr::gui::IGUIStaticText* IrrLibGUI::AddStaticText(); //NA eh a default text adder why not?
/* This is bad coding, we do not want to return an irrlicht object, we want to return a standard datatype because this class handles the GUI elements, not the user. */
void AddStaticText(); //NA eh a default text adder why not?
int AddStaticText(std::string message);
int AddStaticText(std::string message, int x1, int y1, int x2, int y2);
int AddStaticText(std::string message, int x1, int y1, int x2, int y2, bool border, bool wordwrap);
int AddStaticText(std::string message, int x1, int y1, int x2, int y2, bool border, bool wordwrap, int id, bool fillbackground);
int AddStaticText(std::string message, const irr::core::rect< irr::s32 > &rectangle);
int AddStaticText(std::string message, const irr::core::rect< irr::s32 > &rectangle, bool border, bool wordwrap);
int AddStaticText(std::string message, const irr::core::rect< irr::s32 > &rectangle, bool border, bool wordwrap, int id, bool fillbackground);
int AddButton(std::string text, int x1, int y1, int x2, int y2, std::string tooltiptext);
int AddButton(std::string text, irr::core::rect<irr::s32> & rect, std::string tooltiptext);
void ChangeStaticText(int nstatictext, std::string message);
void ChangeFont(std::string fontfile);
};
#endif
Stable Version/1.2.7/IrrSphere.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include "IrrLib.h"
#include "IrrSphere.h"
#include <irrlicht.h>
#include <strings.h>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
void IrrSphere::SetSmgr(irr::scene::ISceneManager* smgr){
this->smgr = smgr;
}
void IrrSphere::SetDriver(irr::video::IVideoDriver* driver){
this->driver = driver;
}
int IrrSphere::CreateNewSphereNode(int x, int y, int z, std::string texture, bool light){
//TODO: Resize after 10, and add 10 more to the mix!
//this->nodeNew[this->numNodes] = this->smgr->addSphereSceneNode();
sphereNodes.push_back(this->smgr->addSphereSceneNode());
this->sphereNodes[this->numNodes]->setPosition(core::vector3df(x,y,z));
this->sphereNodes[this->numNodes]->setMaterialTexture(0, this->driver->getTexture(texture.c_str()));
this->sphereNodes[this->numNodes]->setMaterialFlag(video::EMF_LIGHTING, light);
this->numNodes++;
return this->numNodes--;
/*this->node = this->smgr->addSphereSceneNode();
this->node->setPosition(core::vector3df(x,y,z));
this->node->setMaterialTexture(0, this->driver->getTexture(texture.c_str()));
this->node->setMaterialFlag(video::EMF_LIGHTING, light);*/
}
irr::core::vector3df IrrSphere::GetSphereVector(int sphere){
//We are converting to vectors, under construction NA
//return this->nodeNew[sphere]->getPosition();
return this->sphereNodes[sphere]->getPosition();
}
void IrrSphere::SetSphereVector(int sphere, irr::core::vector3df v){
this->sphereNodes[sphere]->setPosition(v);
}
IrrSphere::IrrSphere(){
this->numNodes = 0;
}
IrrSphere::~IrrSphere(){
/*for(int i = 0; i < numNodes; ++i)
delete this->nodeNew[i];
delete this->nodeNew;*/
//We are using vectors now, no more memory clowing business NA
}
Stable Version/1.2.7/IrrSphere.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRSPHERE_H
#define IRRSPHERE_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
#include <vector>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
//#include "IrrLib.h"
class IrrSphere
{
private:
//irr::scene::ISceneNode* nodeNew[10];
//irr::scene::ISceneNode* nodeNew[10];
std::vector<irr::scene::ISceneNode*> sphereNodes;
int numNodes;
irr::scene::ISceneManager* smgr;
irr::video::IVideoDriver* driver;
public:
void IrrSphere::SetDriver(irr::video::IVideoDriver* driver);
void IrrSphere::SetSmgr(irr::scene::ISceneManager* smgr);
int IrrSphere::CreateNewSphereNode(int x, int y, int z, std::string texture, bool light); //this is going to take my advanced C++ skillz!
irr::core::vector3df IrrSphere::GetSphereVector(int sphere);
void IrrSphere::SetSphereVector(int sphere, irr::core::vector3df v);
IrrSphere::IrrSphere();
//IrrSphere::IrrSphere(IrrLib*);
IrrSphere::~IrrSphere();
};
#endif
Stable Version/1.2.7/IrrSprite.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <irrlicht.h>
#include <strings.h>
#include "IrrLib.h"
//Libraries we create go here
//#include "IrrSphere.h"
#include "IrrColor.h"
#include "IrrSprite.h"
//#include "Irr2D.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
IrrSprite::IrrSprite()
{
//do stuff
}
IrrSprite::~IrrSprite()
{
//delete stuff
}
void IrrSprite::SetDriver(irr::video::IVideoDriver* driver)
{
this->driver = driver;
}
void IrrSprite::SetSmgr(irr::scene::ISceneManager* smgr)
{
this->smgr = smgr;
}
Stable Version/1.2.7/IrrSprite.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRSPRITE_H
#define IRRSPRITE_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
//#include "IrrSphere.h"
#include "IrrColor.h"
//#include "Irr2D.h"
//#include "IrrSprite.h"
//Start class
class IrrSprite {
private:
irr::video::IVideoDriver* driver;
irr::scene::ISceneManager* smgr;
public:
IrrSprite::IrrSprite();
IrrSprite::~IrrSprite();
void IrrSprite::SetDriver(irr::video::IVideoDriver* driver);
void IrrSprite::SetSmgr(irr::scene::ISceneManager* smgr);
// I forgot a semicolon here....and it wasn't compling
//Thats 1 bad thing about OOP if there is an error you don't know where the @#$@# the problem is!
};
#endif
Stable Version/1.2.7/README
1
2
3
4
5
6
7
8
9
10
11
12
13
Irrlicht Library Wrapper
Created by Nathan Adams
Version 1.2.7
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
Please leave all files intact if you redistrubte this software.
How to use:
Add all the files to your Irrlicht project, you could compile it into a DLL if you wanted too, but for now just add all the files to your project.
Then inside your complier add the directory that you have the IrrLib files and use #include "IrrLib.h" to refrence it, and you are good to go!
Stable Version/1.2.9/CHANGES
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
Version 1.2
+ Added a Irr3DLib class that will control all 3D objects
+ Also Added a Irr2D class that works on the same concept.
+ IrrSphere is now owned by Irr3DLib
+ Updated the examples using the latest code
Version 1.2.2
+ Added IrrEventReciever to handle all input
- Still under work
+ Fixed some misc coding bugs
+ Added template class
+ Added sprite class
+ Added GUI class
Version 1.2.3
+ IrrEventReciver now works as advertised
+ Baseclass is now being used
+ A couple somewhat-useful functions
+ int_to_string
+ stringw_to_stdstring
+ stdstring_to_stringw
+ GUI elements
+ Static text is working
+ Under construction for a data type class
Version 1.2.4
+ Implmented color codes accessiable through the class
+ IrrLib.Color.RED (ect)
Version 1.2.5
+ Implmented mouse events
+ IrrLib.IrrEvent.getMouseX();
+ IrrLib.IrrEvent.getMouseY();
+ Using vectors instead of static arrays
+ Side note: Was going to use dynamic arrays, but C++ has vectors which are 10x better.
+ Added a default exit for when you hit esc
+ Use IrrLib.IrrEvent.SetEscExit(false) to turn that off for your software
+ Use IrrLib.IrrEvent.SetEscExit(true) to turn it back on
+ Every stable version will now include a windows DLL.
+ Possible Linux .so file in the future.
Version 1.2.6
+ Added a IrrEvent for buttons
+ IrrLib.IrrEvent.checkButtonState();
+ See example for use
+ Added an AddButton function
+ IrrLib.GUI.AddButton(..);
+ See example for use
+ Problems with making the DLL
+ reasearching
Version 1.2.7
+ Fixed DLL Problem
+ Added an enum example to example 1
+ Added more examples
+ Added example 9
+ Added left click handling (see example 9)
+ Added AddLines function to Irr2D
+ DrawLines function in Irr2D will draw the lines you add
Version 1.2.9
+ Added Listbox GUI object
+ Added a new datatype IrrObj
+ Contains 2 ints, 1 for object id and 1 for event id
+ Added a IrrData.h file
Stable Version/1.2.9/CREDITS
1
2
3
4
5
6
7
8
IrrLib
Created by
Nathan Adams
Denzel Morris
From #irrlicht
Acid
wacom
Stable Version/1.2.9/Irr2D.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
//#include "IrrLib.h"
//#include "IrrSphere.h" //You probably aren't going to be using 3D objects in a 2D environment!
#include <irrlicht.h>
#include <strings.h>
#include "Irr2D.h"
#include "IrrSprite.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
Irr2D::Irr2D(){
this->numTextures = 0;
this->numLines = 0;
//NA Should we set textures to new
}
Irr2D::~Irr2D(){
/*for(int i = 0; i < numTextures; ++i)
delete this->textures[i];
delete this->textures;*/
//No more dynamic memory business yay! NA
}
void Irr2D::SetSmgr(irr::scene::ISceneManager* smgr){
this->smgr = smgr;
Sprite.SetSmgr(smgr);
}
void Irr2D::SetDriver(irr::video::IVideoDriver* driver){
this->driver = driver;
Sprite.SetDriver(driver);
}
void Irr2D::LoadTexturemap(std::string file){
this->texturemap = driver->getTexture(file.c_str());
}
int Irr2D::LoadTexture(std::string file){
//this->textures[this->numTextures] = driver->getTexture(file.c_str());
textures.push_back(driver->getTexture(file.c_str()));
this->numTextures++;
return numTextures--;
}
void Irr2D::DrawLine(irr::core::position2d<irr::s32>& start, irr::core::position2d<irr::s32>& end, irr::video::SColor& color)
{
this->driver->draw2DLine(start, end, color);
}
void Irr2D::AddLines(irr::core::position2d<irr::s32>& start, irr::core::position2d<irr::s32>& end, irr::video::SColor& color)
{
this->start.push_back(start);
this->end.push_back(end);
this->color.push_back(color);
this->numLines++;
}
void Irr2D::DrawLines()
{
for(int i = 0; i < numLines; ++i)
this->driver->draw2DLine(this->start[i], this->end[i], this->color[i]);
}
Stable Version/1.2.9/Irr2D.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRR2D_H
#define IRR2D_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
#include <vector>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
//#include "IrrLib.h"
#include "IrrSprite.h"
class Irr2D {
private:
irr::scene::ISceneManager* smgr;
irr::video::IVideoDriver* driver;
irr::video::ITexture* texturemap;
int numTextures;
//irr::video::ITexture* textures[10];
std::vector<irr::video::ITexture*> textures;
std::vector<irr::core::position2d<irr::s32> > start;
std::vector<irr::core::position2d<irr::s32> > end;
std::vector<irr::video::SColor> color;
int numLines;
public:
//Irr2D::Irr2D();
IrrSprite Sprite;
Irr2D::Irr2D();
Irr2D::~Irr2D();
void Irr2D::SetDriver(irr::video::IVideoDriver* driver);
void Irr2D::SetSmgr(irr::scene::ISceneManager* smgr);
void Irr2D::LoadTexturemap(std::string file);
int Irr2D::LoadTexture(std::string file);
void Irr2D::DrawImage(int texture, const irr::core::position2d<irr::s32> & destPos);
void Irr2D::DrawImage(const irr::core::position2d<irr::s32> & destPos, const irr::core::rect<irr::s32> & sourceRect, const irr::core::rect<irr::s32> * clipRect, irr::video::SColor color, bool useAlphaChannelOfTexture);
void Irr2D::DrawLine(irr::core::position2d<irr::s32>& start, irr::core::position2d<irr::s32>& end, irr::video::SColor& color);
void Irr2D::DrawLines();
void Irr2D::AddLines(irr::core::position2d<irr::s32>& start, irr::core::position2d<irr::s32>& end, irr::video::SColor& color);
};
#endif
Stable Version/1.2.9/Irr3D.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <strings.h>
//#include "IrrLib.h"
//Libraries we create go here
#include "IrrSphere.h"
//#include "IrrColor.h"
#include "Irr3D.h"
#include <irrlicht.h>
//#include "Irr2D.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
void Irr3D::SetDriver(irr::video::IVideoDriver* driver) //so much for copying and pasting code from the header file
{
this->driver = driver;
Sphere.SetDriver(driver);
}
void Irr3D::SetSmgr(irr::scene::ISceneManager* smgr)
{
this->smgr = smgr;
Sphere.SetSmgr(smgr);
}
Irr3D::Irr3D()
{
//do stuff here!
}
Irr3D::~Irr3D()
{
//delete stuff here!
}
Stable Version/1.2.9/Irr3D.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRR3D_H
#define IRR3D_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
#include "IrrSphere.h"
//#include "IrrColor.h"
//#include "Irr3D.h"
//#include "Irr2D.h" This is a 3D class not 2D
/* However due to Irrlciht's nature mixing 2D with 3D is possible */
//Start class
class Irr3D {
private:
irr::video::IVideoDriver* driver;
irr::scene::ISceneManager* smgr;
public:
IrrSphere Sphere;
Irr3D::Irr3D();
Irr3D::~Irr3D();
void Irr3D::SetDriver(irr::video::IVideoDriver* driver);
void Irr3D::SetSmgr(irr::scene::ISceneManager* smgr);
};
#endif
Stable Version/1.2.9/IrrColor.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <irrlicht.h>
#include <strings.h>
//#include "IrrLib.h"
#include "IrrColor.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
void IrrColor::Init(){
/*SColor * temp;
temp = new SColor(alpha, 255, 0, 0);
this->RED = temp;
delete temp;*/
this->RED = SColor(alpha, 255, 0, 0);
this->ORANGE = SColor(alpha, 255, 165, 0);
this->YELLOW = SColor(alpha, 255, 255, 0);
this->GREEN = SColor(alpha, 0, 255, 0);
this->BLUE = SColor(alpha, 0, 0, 255);
this->DARK_GREEN = SColor(alpha, 0, 100, 0);
this->PINK = SColor(alpha, 255, 192, 203);
this->GREY = SColor(alpha, 190, 190, 190);
this->WHITE = SColor(alpha, 0, 0, 0);
this->BLACK = SColor(alpha, 0, 0, 0);
}
IrrColor::~IrrColor(){
//delete this->RED;
}
IrrColor::IrrColor(){
this->alpha = 255;
Init();
}
IrrColor::IrrColor(irr::u32 alpha){
this->alpha = alpha;
Init();
}
int IrrColor::getAlpha(){
return this->alpha;
}
void IrrColor::setAlpha(int alpha){
this->alpha = alpha;
}
SColor IrrColor::returnColor(std::string color){
int nColor = -1;
if (color == "red")
nColor = 1;
else if (color == "green")
nColor = 2;
else if (color == "blue")
nColor = 3;
else if (color == "dark green")
nColor = 4;
else if (color == "pink")
nColor = 5;
else if (color == "grey")
nColor = 6;
switch (nColor){
case 1:
return SColor(255, 255, 0, 0);
break;
case 2:
return SColor(255, 0, 255, 0);
break;
case 3:
return SColor(255, 0, 0, 255);
break;
case 4:
return SColor(255, 0, 50, 0);
break;
case 5:
return SColor(255, 255, 10, 255);
break;
case 6:
return SColor(255,200,200,200);
break;
default:
return SColor(255,200,200,200);
break;
}// TODO: Make this function modular
}
Stable Version/1.2.9/IrrColor.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRCOLOR_H
#define IRRCOLOR_H
#include <iostream>
#include <strings.h>
#include "irrlicht.h"
//#include "IrrLib.h"
class IrrColor {
private:
irr::u32 alpha;
void Init();
//who knows?
public:
//irr::video::SColor(alpha, 255, 0, 0);
irr::video::SColor RED;
irr::video::SColor ORANGE;
irr::video::SColor YELLOW;
irr::video::SColor GREEN;
irr::video::SColor BLUE;
irr::video::SColor DARK_GREEN;
irr::video::SColor PINK;
irr::video::SColor GREY;
irr::video::SColor WHITE;
irr::video::SColor BLACK;
/*const ORANGE = irr::video::SColor(alpha, 255, 165, 0);
const YELLOW = irr::video::SColor(alpha, 255, 255, 0);
const GREEN = irr::video::SColor(alpha, 0, 255, 0);
const BLUE = irr::video::SColor(alpha, 0, 0, 255);
const DARK_GREEN = irr::video::SColor(alpha, 0, 100, 0);
const PINK = irr::video::SColor(alpha, 255, 192, 203);
const GREY = irr::video::Scolor(alpha, 190, 190, 190);*/
//void IrrColor::test();
IrrColor();
IrrColor(irr::u32 alpha);
~IrrColor();
int getAlpha();
void setAlpha(int alpha);
irr::video::SColor IrrColor::returnColor(std::string color);
};
#endif
Stable Version/1.2.9/IrrData.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#ifndef IRRDATA_H
#define IRRDATA_H
struct pixels {
int width;
int height;
}; //possible future use in 2D objects when specifying the properties of an object draw
struct IrrObj {
int eventid;
int objectid;
};
struct _mouse {
int x;
int y;
};
#endif
Stable Version/1.2.9/IrrEventReciever.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include "IrrEventReciever.h"
//#include "IrrLib.h"
#include <irrlicht.h>
#include <iostream>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
/*void IrrEventReciever::setIrrLib(IrrLib& IrrLib)
{
this.callingIrrLib = IrrLib;
}*/
IrrEventReciever::IrrEventReciever()
{
this->escexit = true;
this->mouse.x = 0;
this->mouse.y = 0;
}
bool IrrEventReciever::OnEvent(SEvent event)
{
// A button was clicked
if (event.EventType == irr::EET_GUI_EVENT)
{
s32 id = event.GUIEvent.Caller->getID();
switch(event.GUIEvent.EventType){
case EGET_BUTTON_CLICKED:
//cout << id << endl;
buttonStates.push_back(id);
break;
case EGET_LISTBOX_CHANGED:
//s32 id = event.GUIEvent.Caller->getID();
listStates.push_back(id);
break;
case EGET_LISTBOX_SELECTED_AGAIN:
listStates.push_back(id);
break;
default:
break;
}
}
/*if (event.EventType == irr::EGET_SCROLL_BAR_CHANGED)
{
}*/
if (event.EventType == irr::EET_KEY_INPUT_EVENT) {
if (!event.KeyInput.PressedDown){
this->keyStates[event.KeyInput.Key] = false;
//cout << "Key was not hit " << this->keyStates[event.KeyInput.Key] << endl;
}
else{
if(event.KeyInput.Key == KEY_ESCAPE && escexit)
this->device->closeDevice();
this->keyStates[event.KeyInput.Key] = true;
//cout << "Key was hit: " << event.KeyInput.Key << " " << this->keyStates[event.KeyInput.Key] << endl;
}
}
if (event.EventType == EET_MOUSE_INPUT_EVENT){
if (event.MouseInput.Event == EMIE_MOUSE_MOVED){
this->mouse.x = event.MouseInput.X;
this->mouse.y = event.MouseInput.Y;
}
if (event.MouseInput.Event == EMIE_LMOUSE_PRESSED_DOWN)
this->mouseStates[0] = true;
if (event.MouseInput.Event == EMIE_LMOUSE_LEFT_UP)
this->mouseStates[0] = false;
}
return false;
}
void IrrEventReciever::SetEscExit(bool onoff)
{
this->escexit = onoff;
}
int IrrEventReciever::getMouseX()
{
return this->mouse.x;
}
int IrrEventReciever::getMouseY()
{
return this->mouse.y;
}
int IrrEventReciever::getButtonState()
{
if(!this->buttonStates.empty()){
int id;
id = buttonStates.back();
this->buttonStates.pop_back();
return id;
}
else
return -1;
}
int IrrEventReciever::getRevButtonState()
{
if(!this->buttonStates.empty()){
int id = buttonStates.front();
this->buttonStates.erase(buttonStates.begin());
return id;
}
else
return -1;
}
void IrrEventReciever::clearButtonState()
{
this->buttonStates.clear();
}
int IrrEventReciever::checkButtonState()
{
if(!this->buttonStates.empty())
return this->buttonStates.back();
else
return -1;
}
void IrrEventReciever::delLastButtonStat()
{
if(!this->buttonStates.empty())
this->buttonStates.pop_back();
}
bool IrrEventReciever::isButtonStateEmpty()
{
return this->buttonStates.empty();
}
int IrrEventReciever::checkListState()
{
if(!this->listStates.empty())
return this->listStates.back();
else
return -1;
}
void IrrEventReciever::delLastListStat()
{
if(!this->listStates.empty())
this->listStates.pop_back();
}
Stable Version/1.2.9/IrrEventReciever.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRREVENTRECIEVER_H
#define IRREVENTRECIEVER_H
//#include "IrrLib.h"
#include <vector>
#include <irrlicht.h>
#include "IrrLibBase.h"
#include "IrrData.h"
#include <stdlib.h>
class IrrEventReciever : public irr::IEventReceiver, public IrrLibBase
{
private:
//IrrLib callingIrrLib;
_mouse mouse;
bool escexit;
std::vector<int> buttonStates;
std::vector<int> listStates;
public:
bool mouseStates[1];
IrrEventReciever();
int getMouseX();
int getMouseY();
bool keyStates[irr::KEY_KEY_CODES_COUNT];
//void setIrrLib(IrrLib& IrrLib)
virtual bool OnEvent(irr::SEvent event);
void SetEscExit(bool onoff);
int getButtonState();
int getRevButtonState();
void clearButtonState();
int checkButtonState();
void delLastButtonStat();
bool isButtonStateEmpty(); //is there still stuff in the vector to be done? NA
int checkListState();
void delLastListStat();
};
#endif
Stable Version/1.2.9/IrrLib.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <irrlicht.h>
#include <strings.h>
#include <sstream>
#include <time.h>
#include "IrrLib.h"
//Libraries we create go here
//#include "IrrSphere.h"
#include "IrrColor.h"
//#include "Irr2D.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
//TODO: Create own class for handling inputs!
/*IrrLib::IrrLib(MastEventReceiver & receiver){
this->device = createDevice(EDT_SOFTWARE, dimension2d<s32>(640, 480), 16, false, false, false, &receiver);
if (this->device == 0)
exit(1);
IrrLib::Init();
}*/
IrrLib::IrrLib(){
this->device = createDevice(EDT_SOFTWARE, dimension2d<s32>(640, 480), 16, false, false, false, &this->IrrEvent);
if (this->device == 0)
exit(1);
IrrLib::Init();
}
IrrLib::IrrLib(video::E_DRIVER_TYPE drivertype, core::dimension2d<s32> & res, u32 bits, bool fullscreen, bool stencilbuffer, bool vsync){
//MyEventReceiver receiver;
this->device = createDevice(drivertype, res, bits, fullscreen, stencilbuffer, vsync, &this->IrrEvent);
if (this->device == 0)
exit(1);
IrrLib::Init();
}
IrrLib::IrrLib(int nDrivertype, int width, int height, int bits, bool fullscreen, bool stencilbuffer, bool vsync){
//MyEventReceiver receiver;
video::E_DRIVER_TYPE drivertype;
switch (nDrivertype){
case 0: //TODO: finish this switch case
drivertype = EDT_NULL;
break;
case 1:
drivertype = EDT_SOFTWARE;
break;
case 2:
drivertype = EDT_BURNINGSVIDEO;
break;
case 3:
drivertype = EDT_OPENGL;
break;
case 4:
drivertype = EDT_DIRECT3D8;
//*Note: It seems as Microsoft has stoped supporting DX 8.1, so you can not compile it into Irrlicht engine anymore
//TODO: Find how to detect if DX is complied into Irrlicht
//TODO: Find how to detecht for linux
break;
case 5:
drivertype = EDT_DIRECT3D9;
break;
default:
drivertype = EDT_SOFTWARE;
break;
}
this->device = createDevice(drivertype, dimension2d<s32>(width, height), bits, fullscreen, stencilbuffer, vsync, &this->IrrEvent);
if (this->device == 0)
exit(1);
IrrLib::Init();
}
IrrLib::~IrrLib (){ //Our moms wont clean up after us!
//Although I'm sure Irrlicht does this for us already, its always a good idea to check!
/*if (this->device != NULL)
delete this->device;
if (this->driver != NULL)
delete this->driver;
if (this->smgr != NULL)
delete this->smgr;
if (this->mesh != NULL)
delete this->mesh;
if (this->node != NULL)
delete this->node;*/ //it seems Irrlicht picks up after us...
//however we created newNodes, now we need to delete it!
}
void IrrLib::Init(){
//this->numNodes = 0;
//this->nodeNew = new ISceneNode[10];
//this->env->addStaticText(L"Transparent Control:", rect<s32>(20,30,300,80), true);
this->env = this->device->getGUIEnvironment();
this->driver = this->device->getVideoDriver();
this->smgr = this->device->getSceneManager();
Irr3DLib.SetSmgr(this->smgr);
Irr3DLib.SetDriver(this->driver);
Irr2DLib.SetSmgr(this->smgr);
Irr2DLib.SetDriver(this->driver);
GUI.SetEnv(this->env);
IrrEvent.SetDevice(this->device);
this->timer = this->device->getTimer();
tick = this->timer->getRealTime();
}
void IrrLib::ReadArchive(std::string file){
this->device->getFileSystem()->addZipFileArchive(file.c_str());
}
void IrrLib::LoadQ3Level(std::string q3level){
this->mesh = this->smgr->getMesh(q3level.c_str());
this->node = 0;
if (this->mesh)
this->node = this->smgr->addOctTreeSceneNode(this->mesh->getMesh(0), 0, -1, 128);
}
void IrrLib::MapPos(int x, int y, int z){
if (this->node)
this->node->setPosition(core::vector3df(x, y, z));
}
void IrrLib::MapPos(){
if (this->node)
this->node->setPosition(core::vector3df(0, 0, 0));
}
void IrrLib::AddFPSCam(){
this->cam = this->smgr->addCameraSceneNodeFPS();
}
void IrrLib::AddFPSCam(f32 x, f32 y, f32 z)
{
this->cam = this->smgr->addCameraSceneNodeFPS();
this->cam->setPosition(irr::core::vector3df(x, y, z));
}
void IrrLib::VisibleCursor(bool tf){
if (tf == false)
this->device->getCursorControl()->setVisible(false);
else
this->device->getCursorControl()->setVisible(true);
}
int IrrLib::GetFPSCount(){
return this->driver->getFPS();
}
bool IrrLib::DeviceIsRunning(){
return this->device->run();
}
bool IrrLib::IsActiveWindow(){
return this->device->isWindowActive();
}
void IrrLib::BeginScene(){
this->driver->beginScene(true, true, video::SColor(0,200,200,200));
}
void IrrLib::BeginScene(irr::video::SColor color){
this->driver->beginScene(true, true, color);
}
void IrrLib::BeginScene(bool usebackBuffer, bool usezBuffer, irr::video::SColor color){
this->driver->beginScene(usebackBuffer, usezBuffer, color);
}
void IrrLib::DrawAll(){
//position2d<int> start(50, 50);
//position2d<int> end(100,100);
// SColor whitecolor(255,255,255,255);
//driver->draw2DLine(start, end, whitecolor);
this->smgr->drawAll();
this->env->drawAll();
//this->device->getGUIEnvironment()->drawAll();
}
void IrrLib::EndScene(){
this->driver->endScene();
}
void IrrLib::SetWindowCaption(stringw str){
this->device->setWindowCaption(str.c_str());
}
irr::core::stringw IrrLib::GetDriverName(){
return this->driver->getName();
}
void IrrLib::EndIrrlicht(){
if(this->device != NULL){
this->device->drop();
this->device = NULL;
}
}
void IrrLib::KeyPress(char key){
this->key = key;
}
char IrrLib::KeyPressed(){
return key;
}
irr::f32 IrrLib::getX(){
return this->smgr->getActiveCamera()->getPosition().X;
}
irr::f32 IrrLib::getY(){
return this->smgr->getActiveCamera()->getPosition().Y;
}
irr::f32 IrrLib::getZ(){
return this->smgr->getActiveCamera()->getPosition().Z;
}
bool IrrLib::CheckGameLoop(){
u32 now;
now = this->timer->getRealTime();
if ((now - this->tick) >= 30){
//this->tick == time (NULL);
return true;
} else {
return false;
}
}
bool IrrLib::CheckGameLoop(u32 ms){
u32 now;
now = this->timer->getRealTime();
if ((now - this->tick) >= ms){
this->tick = now;
return true;
} else {
return false;
}
}
void IrrLib::Exit()
{
this->device->closeDevice();
}
PixelSize IrrLib::GetScreenSize()
{
return this->driver->getScreenSize();
/*pixels returnres;
returnres.width = screenres.Width;
returnres.height = screenres.Height;
return returnres;*/
}
//template <class T> std::string IrrLib::to_string (T t)
/*std::string IrrLib::int_to_string (int t)
{
std::stringstream ss;
ss << t;
return ss.str();
}*/
// This is in the base class now, every class that decends from that class has this ability.
Stable Version/1.2.9/IrrLib.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRLIB_H
#define IRRLIB_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
#include <irrlicht.h>
#include <time.h>
/* We have to include Irrlichts libs */
#include "Irr3D.h"
#include "IrrColor.h"
#include "IrrLibGUI.h"
#include "IrrEventReciever.h"
#include "Irr2D.h"
#include "IrrLibBase.h"
#include "IrrData.h"
typedef irr::core::dimension2d<irr::s32> PixelSize;
/*struct IrrObj {
int eventid;
int objectid;
};*/
//Start class
class IrrLib: public IrrLibBase {
private:
/* Create an Irrlicht device as private because the class should handle
All irrlicht interaction */
irr::IrrlichtDevice *device;
// Tells Irrlicht what driver to use
//video::E_DRIVER_TYPE driverType;
/*
Get a pointer to the video driver and the SceneManager so that
we do not always have to write device->getVideoDriver() and
device->getSceneManager().
*/
irr::video::IVideoDriver* driver;
irr::scene::ISceneManager* smgr;
irr::gui::IGUIEnvironment* env;
/*
Get a pointer to the 'mesh' aka the level.
Note: This is for Quake3 levels, ie bsp maps.
*/
irr::scene::IAnimatedMesh* mesh;
irr::scene::ISceneNode* node;
irr::scene::ISceneNode * tempNode; //use this to store nodeNew's data so we can resize it
irr::scene::ICameraSceneNode * cam;
char key;
void IrrLib::Init();
/*friend class IrrColor;
friend class Irr2DLib;
friend class Sphere;*/
friend class IrrEventReciever;
irr::u32 tick;
irr::ITimer* timer;
public:
//IrrSphere Sphere; //This has to be public to be able to access the Sphere class
/* IrrSphere is now in Irr3D class */
//Prehaps put this into a IrrLib3D class?
Irr3D Irr3DLib;
IrrColor Color; //Color class...not much of a class but lets keep it OO
Irr2D Irr2DLib; //1/2 variable to be labeled like this due to variables not able to begin with a number
IrrLibGUI GUI;
IrrEventReciever IrrEvent;
IrrLib::IrrLib();
//IrrLib::IrrLib(MastEventReceiver & receiver);
IrrLib::IrrLib(irr::video::E_DRIVER_TYPE drivertype, irr::core::dimension2d<irr::s32> & res, irr::u32 bits, bool fullscreen, bool stencilbuffer, bool vsync);
IrrLib::IrrLib(int drivertype, int width, int height, int bits, bool fullscreen, bool stencilbuffer, bool vsync);
IrrLib::~IrrLib(); //Our moms wont clean up after us!
void IrrLib::ReadArchive(std::string file);
void IrrLib::LoadQ3Level(std::string q3level);
void IrrLib::MapPos(int x, int y, int z); //I think this moves the actual camera?
void IrrLib::MapPos();
void IrrLib::AddFPSCam();
void IrrLib::AddFPSCam(irr::f32 x, irr::f32 y, irr::f32 z);
void IrrLib::VisibleCursor(bool tf);
int IrrLib::GetFPSCount();
bool IrrLib::DeviceIsRunning();
bool IrrLib::IsActiveWindow();
void IrrLib::BeginScene();
void IrrLib::BeginScene(irr::video::SColor color);
//void IrrLib::BeginScene(irr::video::SColor * color);
void IrrLib::BeginScene(bool usebackBuffer, bool usezBuffer, irr::video::SColor color);
//TODO: Add one more for human readable colors and hex colors!
void IrrLib::DrawAll();
void IrrLib::EndScene();
void IrrLib::SetWindowCaption(irr::core::stringw str);
irr::core::stringw IrrLib::GetDriverName();
//TODO: Make function to turn stringw to string and visa versa
void IrrLib::EndIrrlicht(); //Renamed from KillIrrlicht to EndIrrlicht
//TODO: Add logging
void IrrLib::KeyPress(char key);
char IrrLib::KeyPressed();
irr::f32 getX();
irr::f32 getY();
irr::f32 getZ();
bool CheckGameLoop();
bool CheckGameLoop(irr::u32 ms);
void Exit();
PixelSize GetScreenSize();
//void EndGameLoop();
//template <class T> std::string to_string (T t);
};
#endif
Stable Version/1.2.9/IrrLibBase.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <irrlicht.h>
#include "IrrLibBase.h"
#include <strings.h>
#include <sstream>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
/*
* Code from http://articles.techrepublic.com.com/5100-22-5079969.html#
*
struct str_stream
{
std::stringstream & underlying_stream() const
{ return m_streamOut; }
operator std::string() const
{
return m_streamOut.str();
}
private:
mutable std::stringstream m_streamOut;
};
template< class type>
inline const str_stream & operator<< ( const str_stream & out, const type & value)
{
out.underlying_stream() << value;
return out;
}
template<class type> std::string to_string( const type & value)
{
std::ostringstream streamOut;
streamOut << value;
return streamOut.str();
}
* End code copy
*/
void IrrLibBase::SetDriver(IVideoDriver* driver) //can be overloaded
{
this->driver = driver;
}
void IrrLibBase::SetSmgr(ISceneManager* smgr)
{
this->smgr = smgr;
}
std::string IrrLibBase::wchar_to_stdstring (const wchar_t* wc)
{
//cout << "Starting conversion";
//wcstombs(tmp, in, 255);
char c[255];
for(int t = 0; wc[t] != '\0'; t++)
c[t] = (char)wc[t];
/*for(int t = 0; c[t] != '\0'; t++)
wc[t] = c[t];*/
std::stringstream ss;
ss << c;
//cout << "Conversion OK";
return ss.str();
}
std::string IrrLibBase::int_to_string (int t)
{
std::stringstream ss;
ss << t;
return ss.str();
}
std::string IrrLibBase::stringw_to_stdstring(irr::core::stringw sw)
{
std::stringstream ss;
ss << sw.c_str();
return ss.str();
}
irr::core::stringw IrrLibBase::stdstring_to_stringw(std::string ss)
{
stringw tmpw(ss.c_str());
return tmpw;
}
void IrrLibBase::SetDevice(irr::IrrlichtDevice *device)
{
this->device = device;
}
void IrrLibBase::init()
{
}
Stable Version/1.2.9/IrrLibBase.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRLIBBASE_H
#define IRRLIBBASE_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
class IrrLibBase {
protected:
irr::video::IVideoDriver* driver;
irr::scene::ISceneManager* smgr;
irr::IrrlichtDevice *device;
public:
//template<class type> std::string to_string( const type & value);
irr::core::dimension2d<irr::s32> irrpixels;
void IrrLibBase::SetDriver(irr::video::IVideoDriver* driver);
void IrrLibBase::SetSmgr(irr::scene::ISceneManager* smgr);
void SetDevice(irr::IrrlichtDevice *device);
std::string int_to_string (int t);
std::string stringw_to_stdstring(irr::core::stringw sw);
irr::core::stringw stdstring_to_stringw(std::string ss);
std::string wchar_to_stdstring (const wchar_t* wc);
void init();
};
#endif
Stable Version/1.2.9/IrrLibGUI.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <strings.h>
#include <irrlicht.h>
#include <vector>
#include <sstream>
#include "IrrLib.h"
#include "IrrData.h"
#include "IrrLibGUI.h"
#include "IrrLibBase.h"
#include <stdlib.h>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
template<class type> std::string to_string( const type & value)
{
std::ostringstream streamOut;
streamOut << value;
return streamOut.str();
}
IrrLibGUI::IrrLibGUI()
{
//NA does it need to do anything at init?
this->nStaticText = 0;
this->nButton = 0;
this->nButtonid = 100;
this->nListBoxid = 200;
this->nListBox = 0;
//this->nListBoxid = 300;
//this->arrStaticText = new IGUIStaticText[10];
//this->env = this->device->getGUIEnvironment(); //NA yes we do!
}
IrrLibGUI::~IrrLibGUI()
{
//NA Do we have to delete anything?
}
void IrrLibGUI::SetEnv(IGUIEnvironment* env)
{
this->env = env;
//env->addButton(rect<s32>(10,210,110,210 + 32), 0, 109, L"Quit", L"Exits Program");
}
int IrrLibGUI::addButton(const core::rect< s32 > & rectangle, IGUIElement *parent, s32 id, const wchar_t * text, const wchar_t * tooltiptext)
{
arrButton.push_back(this->env->addButton(rectangle, parent, id, text, tooltiptext));
++nButton;
++nButtonid;
return nButtonid - 1;
}
IrrObj IrrLibGUI::addListBox(const irr::core::rect< irr::s32 > &rectangle, IGUIElement * parent)
{
irr::gui::IGUIListBox* tmp = this->env->addListBox(rectangle, parent, nListBoxid);
arrListBox.push_back(tmp);
//we introduce a new datatype; IrroObj
IrrObj ret;
ret.eventid = nListBoxid;
ret.objectid = nListBox;
++nListBox;
++nListBoxid;
return ret;
}
IrrObj IrrLibGUI::AddListBox(int x1, int y1, int x2, int y2, IGUIElement * parent)
{
return addListBox(rect<s32>(x1, y1, x2, y2), parent);
}
IrrObj IrrLibGUI::AddListBox(const irr::core::rect< irr::s32 > &rectangle, IGUIElement * parent)
{
return addListBox(rectangle, parent);
}
void IrrLibGUI::AddStringToListBox(int nLbox, std::string text)
{
this->arrListBox[nLbox]->addItem(stdstring_to_stringw(text).c_str());
//this->arrListBox[0]->addItem(L"TEST");
}
std::string IrrLibGUI::getSelectListString(int lstbox)
{
//stringc tmp = this->arrListBox[lstbox]->getListItem(this->arrListBox[lstbox]->getSelected());
s32 selected = this->arrListBox[lstbox]->getSelected();
//const wchar_t* tmp = this->arrListBox[lstbox]->getListItem(selected);
//irr::core::stringw tmp;
char out[255];
//tmp = this->arrListBox[lstbox]->getText();
irr::core::stringc tmp(arrListBox[lstbox]->getListItem(arrListBox[lstbox]->getSelected()));
//cout << tmp.c_str() << endl;
//wcstombs(out, tmp, tmp.length());
//cout << tmp[0] << endl;
// std::stringstream ss;
//for (int i = 0; i < tmp.size(); ++i)
//ss << tmp.c_str();
std::string ret = tmp.c_str();
return ret;
}
void IrrLibGUI::Clear()
{
this->env->clear();
}
void IrrLibGUI::DrawAll()
{
this->env->drawAll();
}
int IrrLibGUI::AddToStaticArray(irr::gui::IGUIStaticText * addme)
{
//arrStaticText[nStaticText] = addme;
arrStaticText.push_back(addme);
this->nStaticText++;
this->nButtonid++;
return this->nStaticText;
}
void IrrLibGUI::AddStaticText()
{
//rect<s32>(20,30,300,80),
this->env->addStaticText(L"Powered by IrrLib.", rect<s32>(20,30,300,80), true);
}
int IrrLibGUI::AddStaticText(std::string message)
{
irr::gui::IGUIStaticText * addthis;
stringw tmpw(message.c_str());
addthis = this->env->addStaticText(tmpw.c_str(), rect<s32>(20,30,300,80), true);
return AddToStaticArray(addthis);
}
int IrrLibGUI::AddStaticText(std::string message, int x1, int y1, int x2, int y2)
{
irr::gui::IGUIStaticText * addthis;
stringw tmpw(message.c_str());
addthis = this->env->addStaticText(tmpw.c_str(), rect<s32>(x1,y1,x2,y2), true);
return AddToStaticArray(addthis);
}
int IrrLibGUI::AddStaticText(std::string message, int x1, int y1, int x2, int y2, bool border, bool wordwrap)
{
irr::gui::IGUIStaticText * addthis;
stringw tmpw(message.c_str());
addthis = this->env->addStaticText(tmpw.c_str(), rect<s32>(x1,y1,x2,y2), border, wordwrap);
return AddToStaticArray(addthis);
}
int IrrLibGUI::AddStaticText(std::string message, int x1, int y1, int x2, int y2, bool border, bool wordwrap, int id, bool fillbackground)
{
irr::gui::IGUIStaticText * addthis;
stringw tmpw(message.c_str());
addthis = this->env->addStaticText(tmpw.c_str(), rect<s32>(x1,y1,x2,y2), border, wordwrap, 0, id, fillbackground);
return AddToStaticArray(addthis);
}
int IrrLibGUI::AddStaticText(std::string message, const core::rect< s32 > &rectangle)
{
irr::gui::IGUIStaticText * addthis;
stringw tmpw(message.c_str());
addthis = this->env->addStaticText(tmpw.c_str(), rectangle);
return AddToStaticArray(addthis);
}
int IrrLibGUI::AddStaticText(std::string message, const core::rect< s32 > &rectangle, bool border, bool wordwrap)
{
irr::gui::IGUIStaticText * addthis;
stringw tmpw(message.c_str());
addthis = this->env->addStaticText(tmpw.c_str(), rectangle, border, wordwrap);
return AddToStaticArray(addthis);
}
int IrrLibGUI::AddStaticText(std::string message, const core::rect< s32 > &rectangle, bool border, bool wordwrap, int id, bool fillbackground)
{
irr::gui::IGUIStaticText * addthis;
stringw tmpw(message.c_str());
addthis = this->env->addStaticText(tmpw.c_str(), rectangle, border, wordwrap, 0, id, fillbackground);
return AddToStaticArray(addthis);
}
void IrrLibGUI::ChangeStaticText(int nstatictext, std::string message)
{
stringw tmpw(message.c_str());
this->arrStaticText[this->nStaticText-1]->setText(tmpw.c_str());
}
void IrrLibGUI::ChangeFont(std::string fontfile)
{
IGUISkin* skin = this->env->getSkin();
IGUIFont* font = this->env->getFont(fontfile.c_str());
if (font)
skin->setFont(font);
}
int IrrLibGUI::AddButton(std::string text, int x1, int y1, int x2, int y2, std::string tooltiptext = "")
{
return addButton(rect<s32>(x1, y1, x2, y2), 0, nButtonid, stdstring_to_stringw(text).c_str(), stdstring_to_stringw(tooltiptext).c_str());
}
int IrrLibGUI::AddButton(std::string text, core::rect<s32> & rect, std::string tooltiptext = "")
{
return addButton(rect, 0, nButtonid, stdstring_to_stringw(text).c_str(), stdstring_to_stringw(tooltiptext).c_str());
}
Stable Version/1.2.9/IrrLibGUI.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRLIBGUI_H
#define IRRLIBGUI_H
#include <iostream>
#include <strings.h>
#include <irrlicht.h>
#include "IrrLib.h"
#include "IrrData.h"
#include "IrrLibBase.h"
class IrrLibGUI: public IrrLibBase {
private:
irr::gui::IGUISkin* skin;
irr::gui::IGUIFont* font;
irr::gui::IGUIEnvironment* env;
//TODO: Create an array storing all messages
int nStaticText;
//irr::gui::IGUIStaticText* arrStaticText[10];
int nButton;
int nButtonid;
int nListBox;
int nListBoxid;
std::vector<irr::gui::IGUIStaticText*> arrStaticText;
std::vector<irr::gui::IGUIButton*> arrButton;
std::vector<irr::gui::IGUIListBox*> arrListBox;
int AddToStaticArray(irr::gui::IGUIStaticText * addme);
int addButton(const irr::core::rect< irr::s32 > & rectangle, irr::gui::IGUIElement *parent = 0, irr::s32 id = 0, const wchar_t * text = 0, const wchar_t * tooltiptext = 0); //TODO: Clean this up!
IrrObj addListBox(const irr::core::rect< irr::s32 > &rectangle, irr::gui::IGUIElement * parent);
public:
IrrLibGUI();
~IrrLibGUI();
void SetEnv(irr::gui::IGUIEnvironment* env);
void Clear();
void DrawAll();
//irr::gui::IGUIStaticText* IrrLibGUI::AddStaticText(); //NA eh a default text adder why not?
/* This is bad coding, we do not want to return an irrlicht object, we want to return a standard datatype because this class handles the GUI elements, not the user. */
void AddStaticText(); //NA eh a default text adder why not?
int AddStaticText(std::string message);
int AddStaticText(std::string message, int x1, int y1, int x2, int y2);
int AddStaticText(std::string message, int x1, int y1, int x2, int y2, bool border, bool wordwrap);
int AddStaticText(std::string message, int x1, int y1, int x2, int y2, bool border, bool wordwrap, int id, bool fillbackground);
int AddStaticText(std::string message, const irr::core::rect< irr::s32 > &rectangle);
int AddStaticText(std::string message, const irr::core::rect< irr::s32 > &rectangle, bool border, bool wordwrap);
int AddStaticText(std::string message, const irr::core::rect< irr::s32 > &rectangle, bool border, bool wordwrap, int id, bool fillbackground);
int AddButton(std::string text, int x1, int y1, int x2, int y2, std::string tooltiptext);
int AddButton(std::string text, irr::core::rect<irr::s32> & rect, std::string tooltiptext); //TODO: Add move functions
IrrObj AddListBox(int x1, int y1, int x2, int y2, irr::gui::IGUIElement * parent = 0);
IrrObj AddListBox(const irr::core::rect< irr::s32 > &rectangle, irr::gui::IGUIElement * parent = 0);
void AddStringToListBox(int nLbox, std::string text);
void ChangeStaticText(int nstatictext, std::string message);
void ChangeFont(std::string fontfile);
std::string getSelectListString(int lstbox);
};
#endif
Stable Version/1.2.9/IrrSphere.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include "IrrLib.h"
#include "IrrSphere.h"
#include <irrlicht.h>
#include <strings.h>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
void IrrSphere::SetSmgr(irr::scene::ISceneManager* smgr){
this->smgr = smgr;
}
void IrrSphere::SetDriver(irr::video::IVideoDriver* driver){
this->driver = driver;
}
int IrrSphere::CreateNewSphereNode(int x, int y, int z, std::string texture, bool light){
//TODO: Resize after 10, and add 10 more to the mix!
//this->nodeNew[this->numNodes] = this->smgr->addSphereSceneNode();
//this->sphereNodes[this->numNodes]->setPosition(core::vector3df(x,y,z));
//this->sphereNodes[this->numNodes]->setMaterialTexture(0, this->driver->getTexture(texture.c_str()));
//this->sphereNodes[this->numNodes]->setMaterialFlag(video::EMF_LIGHTING, light);
nodeNew = this->smgr->addSphereSceneNode();
nodeNew->setPosition(core::vector3df(x,y,z));
nodeNew->setMaterialTexture(0, this->driver->getTexture(texture.c_str()));
nodeNew->setMaterialFlag(video::EMF_LIGHTING, light);
sphereNodes.push_back(nodeNew);
this->numNodes++;
return this->numNodes--;
/*this->node = this->smgr->addSphereSceneNode();
this->node->setPosition(core::vector3df(x,y,z));
this->node->setMaterialTexture(0, this->driver->getTexture(texture.c_str()));
this->node->setMaterialFlag(video::EMF_LIGHTING, light);*/
}
irr::core::vector3df IrrSphere::GetSphereVector(int sphere){
//We are converting to vectors, under construction NA
//return this->nodeNew[sphere]->getPosition();
return this->sphereNodes[sphere]->getPosition();
}
void IrrSphere::SetSphereVector(int sphere, irr::core::vector3df v){
this->sphereNodes[sphere]->setPosition(v);
}
IrrSphere::IrrSphere(){
this->numNodes = 0;
}
IrrSphere::~IrrSphere(){
/*for(int i = 0; i < numNodes; ++i)
delete this->nodeNew[i];
delete this->nodeNew;*/
//We are using vectors now, no more memory clowing business NA
}
Stable Version/1.2.9/IrrSphere.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRSPHERE_H
#define IRRSPHERE_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
#include <vector>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
//#include "IrrLib.h"
class IrrSphere
{
private:
//irr::scene::ISceneNode* nodeNew[10];
irr::scene::ISceneNode* nodeNew;
std::vector<irr::scene::ISceneNode*> sphereNodes;
int numNodes;
irr::scene::ISceneManager* smgr;
irr::video::IVideoDriver* driver;
public:
void IrrSphere::SetDriver(irr::video::IVideoDriver* driver);
void IrrSphere::SetSmgr(irr::scene::ISceneManager* smgr);
int IrrSphere::CreateNewSphereNode(int x, int y, int z, std::string texture, bool light); //this is going to take my advanced C++ skillz!
irr::core::vector3df IrrSphere::GetSphereVector(int sphere);
void IrrSphere::SetSphereVector(int sphere, irr::core::vector3df v);
IrrSphere::IrrSphere();
//IrrSphere::IrrSphere(IrrLib*);
IrrSphere::~IrrSphere();
};
#endif
Stable Version/1.2.9/IrrSprite.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <irrlicht.h>
#include <strings.h>
#include "IrrLib.h"
//Libraries we create go here
//#include "IrrSphere.h"
#include "IrrColor.h"
#include "IrrSprite.h"
//#include "Irr2D.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
IrrSprite::IrrSprite()
{
//do stuff
}
IrrSprite::~IrrSprite()
{
//delete stuff
}
void IrrSprite::SetDriver(irr::video::IVideoDriver* driver)
{
this->driver = driver;
}
void IrrSprite::SetSmgr(irr::scene::ISceneManager* smgr)
{
this->smgr = smgr;
}
Stable Version/1.2.9/IrrSprite.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRSPRITE_H
#define IRRSPRITE_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
//#include "IrrSphere.h"
#include "IrrColor.h"
//#include "Irr2D.h"
//#include "IrrSprite.h"
//Start class
class IrrSprite {
private:
irr::video::IVideoDriver* driver;
irr::scene::ISceneManager* smgr;
public:
IrrSprite::IrrSprite();
IrrSprite::~IrrSprite();
void IrrSprite::SetDriver(irr::video::IVideoDriver* driver);
void IrrSprite::SetSmgr(irr::scene::ISceneManager* smgr);
// I forgot a semicolon here....and it wasn't compling
//Thats 1 bad thing about OOP if there is an error you don't know where the @#$@# the problem is!
};
#endif
Stable Version/1.2.9/README
1
2
3
4
5
6
7
8
9
10
11
12
13
Irrlicht Library Wrapper
Created by Nathan Adams
Version 1.2.9
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
Please leave all files intact if you redistrubte this software.
How to use:
Add all the files to your Irrlicht project, you could compile it into a DLL if you wanted too, but for now just add all the files to your project.
Then inside your complier add the directory that you have the IrrLib files and use #include "IrrLib.h" to refrence it, and you are good to go!
Stable Version/1.3.3/CHANGES
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
Version 1.2
+ Added a Irr3DLib class that will control all 3D objects
+ Also Added a Irr2D class that works on the same concept.
+ IrrSphere is now owned by Irr3DLib
+ Updated the examples using the latest code
Version 1.2.2
+ Added IrrEventReciever to handle all input
- Still under work
+ Fixed some misc coding bugs
+ Added template class
+ Added sprite class
+ Added GUI class
Version 1.2.3
+ IrrEventReciver now works as advertised
+ Baseclass is now being used
+ A couple somewhat-useful functions
+ int_to_string
+ stringw_to_stdstring
+ stdstring_to_stringw
+ GUI elements
+ Static text is working
+ Under construction for a data type class
Version 1.2.4
+ Implmented color codes accessiable through the class
+ IrrLib.Color.RED (ect)
Version 1.2.5
+ Implmented mouse events
+ IrrLib.IrrEvent.getMouseX();
+ IrrLib.IrrEvent.getMouseY();
+ Using vectors instead of static arrays
+ Side note: Was going to use dynamic arrays, but C++ has vectors which are 10x better.
+ Added a default exit for when you hit esc
+ Use IrrLib.IrrEvent.SetEscExit(false) to turn that off for your software
+ Use IrrLib.IrrEvent.SetEscExit(true) to turn it back on
+ Every stable version will now include a windows DLL.
+ Possible Linux .so file in the future.
Version 1.2.6
+ Added a IrrEvent for buttons
+ IrrLib.IrrEvent.checkButtonState();
+ See example for use
+ Added an AddButton function
+ IrrLib.GUI.AddButton(..);
+ See example for use
+ Problems with making the DLL
+ reasearching
Version 1.2.7
+ Fixed DLL Problem
+ Added an enum example to example 1
+ Added more examples
+ Added example 9
+ Added left click handling (see example 9)
+ Added AddLines function to Irr2D
+ DrawLines function in Irr2D will draw the lines you add
Version 1.2.9
+ Added Listbox GUI object
+ Added a new datatype IrrObj
+ Contains 2 ints, 1 for object id and 1 for event id
+ Added a IrrData.h file
Version 1.3.0
+ Changed String class use to Irrlicht's type Strings
Version 1.3.1
+ Added support for newest Irrlict version
Version 1.3.2/1.3.3
+ Added Newton Physics engine
- Deleted Irr2D::Collision as this will be now handled by the physics engine
+ Added a few functions for Collision
+ Added a new object Irr3DObj
+ Has several functions that allow you to work easily with 3D objects including moving them and setting the texture.
+ You can now detect collision between 2 3D objects and output them to the screen
+ Example code: http://pastethis.net/?code=49
+ Changed the way IrrColor colors work
+ Changed internally handling of some global variables
+ Added some static variables
+ Irrlicht Device is now static in IrrLib class
+ Some variables that deal with Physics are static
+ Updated copyright
+ Added new datatypes
+ Irr3DLibObj
+ Irr3DObj
+ Irr2DObj
+ IrrGUIObj
+ IrrGUIStruct
+ IrrEventObj
+ Irr3DSphere
+ Irr3DObjColor
- Deleted IrrData.h
+ 3D mesh display is working, though its still in the works (see example 11 in the SVN)
+ Implmented smart pointer class "IrrObj"
+ Possible fix of header circular inclusion
% Future planned use of namespace
Stable Version/1.3.3/CREDITS
1
2
3
4
5
6
7
8
9
10
IrrLib
Created by
Nathan Adams
From #irrlicht
Acid
wacom
From Irrlicht Forums
Denzel Morris
Stable Version/1.3.3/Collision.h
1
2
3
4
5
6
7
#ifndef COLLISION.H
#define COLLISION.H
struct Collision {
int nHits;
bool hit;
};
#endif
Stable Version/1.3.3/Irr2D.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Copyright (C) 2008
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
//#include "IrrLib.h"
//#include "IrrSphere.h" //You probably aren't going to be using 3D objects in a 2D environment!
#include <irrlicht.h>
#include <strings.h>
#include "Irr2D.h"
#include "IrrSprite.h"
//#include "IrrData.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
Irr2D::Irr2D(){
this->numTextures = 0;
this->numLines = 0;
this->nImages = 0;
//NA Should we set textures to new
}
Irr2D::~Irr2D(){
/*for(int i = 0; i < numTextures; ++i)
delete this->textures[i];
delete this->textures;*/
//No more dynamic memory business yay! NA
//All handled by vectors!
}
/*void Irr2D::SetSmgr(irr::scene::ISceneManager* smgr){
this->smgr = smgr;
Sprite.SetSmgr(smgr);
}
void Irr2D::SetDriver(irr::video::IVideoDriver* driver){
this->driver = driver;
Sprite.SetDriver(driver);
}*/
Irr2DObj Irr2D::LoadTexturemap(stringc file){
this->texturemap = driver->getTexture(file.c_str());
}
Irr2DObj Irr2D::LoadTexture(stringc file){
//this->textures[this->numTextures] = driver->getTexture(file.c_str());
textures.push_back(driver->getTexture(file.c_str()));
this->numTextures++;
Irr2DObj ret;
ret->eventid = 0;
ret->objectid = numTextures--;
return ret;
}
void Irr2D::DrawLine(IrrPos& start, IrrPos& end, irr::video::SColor color)
{
this->driver->draw2DLine(start, end, color);
}
void Irr2D::AddLines(IrrPos& start, IrrPos& end, irr::video::SColor color)
{
this->start.push_back(start);
this->end.push_back(end);
this->color.push_back(color);
this->numLines++;
}
void Irr2D::DrawLines()
{
for(int i = 0; i < numLines; ++i)
this->driver->draw2DLine(this->start[i], this->end[i], this->color[i]);
}
Irr2DObj Irr2D::LoadIrrImage(irr::core::stringc file)
{
images.push_back(this->driver->getTexture(file.c_str()));
Irr2DObj ret;
ret->objectid = nImages;
ret->eventid = 0;
this->nImages++;
return ret;
}
void Irr2D::DrawImage(Irr2DObj img)
{
irr::core::position2d<irr::s32> destPos(img->x, img->y);
this->driver->draw2DImage(images[img->objectid], destPos);
}
void Irr2D::Draw2DObj(irr::core::stringc file)
{
//NewtonObj tmp;
//tmp.irr_node = smgr->addMeshSceneNode(smgr->getMesh(file.c_str())->getMesh(0));
//IMeshSceneNode* temp;
objects.push_back(smgr->addMeshSceneNode(smgr->getMesh(file.c_str())->getMesh(0)));
objects.push_back(smgr->addMeshSceneNode(smgr->getMesh(file.c_str())->getMesh(0)));
objects[0]->setPosition(vector3df(-5,0,0));
objects[0]->getMaterial(0).EmissiveColor.set(255,0,255,5);
}
/*bool Irr2D::Collision(Irr2DObj obj1, Irr2DObj obj2)
{
int x1 = obj1.x;
int y1 = obj1.y;
}*/
Stable Version/1.3.3/Irr2D.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Copyright (C) 2008
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRR2D_H
#define IRR2D_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
#include <vector>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
//#include "IrrLib.h"
#include "IrrSprite.h"
#include "IrrDefines.h"
class Irr2D: public IrrLibBase {
private:
//irr::scene::ISceneManager* smgr;
//irr::video::IVideoDriver* driver;
//Inherited from IrrLibBase
irr::video::ITexture* texturemap;
int numTextures;
//irr::video::ITexture* textures[10];
std::vector<irr::video::ITexture*> textures;
std::vector<irr::core::position2d<irr::s32> > start;
std::vector<irr::core::position2d<irr::s32> > end;
std::vector<irr::video::SColor> color;
std::vector<irr::video::ITexture*> images;
std::vector<irr::scene::IMeshSceneNode*> objects;
int numLines;
int nImages;
public:
//Irr2D::Irr2D();
IrrSprite Sprite;
Irr2D();
~Irr2D();
//void Irr2D::SetDriver(irr::video::IVideoDriver* driver);
//void Irr2D::SetSmgr(irr::scene::ISceneManager* smgr);
//Inherited from irrlibbase
Irr2DObj LoadTexturemap(irr::core::stringc file);
Irr2DObj LoadTexture(irr::core::stringc file);
//Has been renamed from LoadImage to LoadIrrImage due to conflict with windows API
Irr2DObj LoadIrrImage(irr::core::stringc file);
//void Irr2D::DrawImage(int texture, const irr::core::position2d<irr::s32> & destPos);
//void Irr2D::DrawImage(IrrObj& img, irr::core::position2d<irr::s32>& destPos);
void DrawImage(Irr2DObj img);
void Draw2DObj(irr::core::stringc file);
//void Irr2D::MoveImage(IrrObj img, irr::core::dimension2d<irr::s32> destPos);
//void Irr2D::MoveImage(IrrObj img, int x, int y);
//void Irr2D::DrawImage(const irr::core::position2d<irr::s32> & destPos, const irr::core::rect<irr::s32> & sourceRect, const irr::core::rect<irr::s32> * clipRect, irr::video::SColor color, bool useAlphaChannelOfTexture);
//void Irr2D::DrawImage(const irr::core::position2d<irr::s32> & destPos, const irr::core::rect<irr::s32> & sourceRect, const irr::core::rect<irr::s32> * clipRect, irr::video::SColor color, bool useAlphaChannelOfTexture);
//void Irr2D::DrawLine(irr::core::position2d<irr::s32>& start, irr::core::position2d<irr::s32>& end, irr::video::SColor& color);
void DrawLine(IrrPos& start, IrrPos& end, irr::video::SColor color);
void DrawLines();
//void Irr2D::AddLines(irr::core::position2d<irr::s32>& start, irr::core::position2d<irr::s32>& end, irr::video::SColor& color);
void AddLines(IrrPos& start, IrrPos & end, irr::video::SColor color);
//bool Irr2D::Collision(IrrObj obj1, IrrObj obj2);
//IrrObj Irr2D::LoadImageA(irr::core::stringc file);
};
#endif
Stable Version/1.3.3/Irr3D.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Copyright (C) 2008
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <strings.h>
//#include "IrrLib.h"
//Libraries we create go here
#include "IrrSphere.h"
//#include "IrrColor.h"
#include "Irr3D.h"
#include <irrlicht.h>
//#include "Irr2D.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
/*void Irr3D::SetDriver(irr::video::IVideoDriver* driver) //so much for copying and pasting code from the header file
{
this->driver = driver;
Sphere.SetDriver(driver);
}
void Irr3D::SetSmgr(irr::scene::ISceneManager* smgr)
{
this->smgr = smgr;
Sphere.SetSmgr(smgr);
}*/
Irr3D::Irr3D()
{
//do stuff here!
}
Irr3D::~Irr3D()
{
//delete stuff here!
}
Stable Version/1.3.3/Irr3D.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Copyright (C) 2008
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRR3D_H
#define IRR3D_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
#include "IrrSphere.h"
//#include "IrrColor.h"
//#include "Irr3D.h"
//#include "Irr2D.h" This is a 3D class not 2D
/* However due to Irrlciht's nature mixing 2D with 3D is possible */
//Start class
class Irr3D: public IrrLibBase {
private:
//irr::video::IVideoDriver* driver;
//irr::scene::ISceneManager* smgr;
public:
IrrSphere Sphere;
Irr3D();
~Irr3D();
//void Irr3D::SetDriver(irr::video::IVideoDriver* driver);
//void Irr3D::SetSmgr(irr::scene::ISceneManager* smgr);
};
#endif
Stable Version/1.3.3/Irr3DLibObj.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Copyright (C) 2008
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <irrlicht.h>
#include <strings.h>
#include <newton.h>
#include "Irr3DLibObj.h"
#include "IrrPhysics.h"
#include "IrrFunctions.h"
#include "IrrLib.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
Irr3DLibObj::Irr3DLibObj()
{
this->col.a = 0;
this->col.b = 0;
this->col.g = 0;
this->col.r = 0;
}
void Irr3DLibObj::setColor(Irr3DObjColor col)
{
this->col.a = col.a;
this->col.b = col.b;
this->col.g = col.g;
this->col.r = col.r;
}
/*Irr3DLibObj::Irr3DLibObj(IrrLib &irr, Irr3DLibObjColor col)
{
this->col.a = col.a;
this->col.r = col.r;
this->col.g = col.g;
this->col.b = col.b;
}*/
IMeshSceneNode* Irr3DLibObj::getSceneNode()
{
return this->irr_node;
}
NewtonCollision* Irr3DLibObj::getNewtonCollision()
{
return this->nwtn_collision;
}
void Irr3DLibObj::setMesh(irr::core::stringc strng)
{
this->texture = strng;
}
void Irr3DLibObj::Move(Irr3DPos pos)
{
this->irr_node->setPosition(vector3df(pos.x, pos.y, pos.z));
}
void Irr3DLibObj::addToScene()
{
if (this->texture == "")
{
cout << "Material not set for this object" << endl;
return;
}
ISceneManager* smgr = IrrLib::device->getSceneManager();
//this->irr_node = this->device->getSceneManager->addMeshSceneNode(this->device->getSceneManager->getMesh(this->texture.c_str())->getMesh(0));
this->irr_node = smgr->addMeshSceneNode(smgr->getMesh(this->texture.c_str())->getMesh(0));
this->irr_node->getMaterial(0).EmissiveColor.set(this->col.a, this->col.r, this->col.g, this->col.b);
//cout << col.a << endl;
this->nwtn_collision = CreateCollisionFromMesh(this->irr_node->getMesh());
}
Stable Version/1.3.3/Irr3DLibObj.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Copyright (C) 2008
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRR3DLIBOBJ_H
#define IRR3DLIBOBJ_H
/* We have to include Irrlichts libs */
#include <irrlicht.h>
#include <newton.h>
#include "IrrLibBase.h"
//class IrrLib;
//#include "IrrData.h"
#include "Irr3DObjColor.h"
#include "Irr3DPos.h"
//class Irr3DLibObj;
//class IrrLib;
//#include "IrrLib.h"
//class Irr3DPos;
class IrrLib;
class Irr3DLibObj: public IrrLibBase {
private:
IrrLib * Irrlicht;
irr::scene::IMeshSceneNode *irr_node;
NewtonCollision *nwtn_collision;
irr::core::stringc texture;
Irr3DObjColor col;
public:
Irr3DLibObj();
void Move(Irr3DPos pos);
void addToScene();
void createNewObj();
void setMesh(irr::core::stringc strng);
void setPosition(Irr3DPos pos);
void setColor(Irr3DObjColor col);
void setPosition(irr::u32 x, irr::u32 y, irr::u32 z);
irr::scene::IMeshSceneNode* getSceneNode();
NewtonCollision* getNewtonCollision();
};
#endif
Stable Version/1.3.3/Irr3DObjColor.h
1
2
3
4
5
6
7
8
9
10
11
12
#ifndef IRR3DOBJCOLOR_H
#define IRR3DOBJCOLOR_H
#include <irrlicht.h>
struct Irr3DObjColor {
irr::u32 r;
irr::u32 g;
irr::u32 b;
irr::u32 a;
};
#endif
Stable Version/1.3.3/Irr3DPos.h
1
2
3
4
5
6
7
8
9
10
#ifndef IRR3DPOS_H
#define IRR3DPOS_H
struct Irr3DPos {
int x;
int y;
int z;
};
#endif
Stable Version/1.3.3/IrrColor.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Copyright (C) 2008
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <irrlicht.h>
#include <strings.h>
//#include "IrrLib.h"
#include "IrrColor.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
void IrrColor::Init(){
/*SColor * temp;
temp = new SColor(alpha, 255, 0, 0);
this->RED = temp;
delete temp;*/
this->RED = SColor(alpha, 255, 0, 0);
this->ORANGE = SColor(alpha, 255, 165, 0);
this->YELLOW = SColor(alpha, 255, 255, 0);
this->GREEN = SColor(alpha, 0, 255, 0);
this->BLUE = SColor(alpha, 0, 0, 255);
this->DARK_GREEN = SColor(alpha, 0, 100, 0);
this->PINK = SColor(alpha, 255, 192, 203);
this->GREY = SColor(alpha, 190, 190, 190);
this->WHITE = SColor(alpha, 0, 0, 0);
this->BLACK = SColor(alpha, 0, 0, 0);
}
IrrColor::~IrrColor(){
/*delete this->RED;
delete this->ORANGE;
delete this->YELLOW;
delete this->GREEN;
delete this->BLUE;
delete this->DARK_GREEN;
delete this->PINK;
delete this->GREY;
delete this->WHITE;
delete this->BLACK;*/
}
IrrColor::IrrColor(){
this->alpha = 255;
Init();
}
IrrColor::IrrColor(irr::u32 alpha){
this->alpha = alpha;
Init();
}
int IrrColor::getAlpha(){
return this->alpha;
}
void IrrColor::setAlpha(int alpha){
this->alpha = alpha;
}
SColor IrrColor::returnColor(stringw color){
int nColor = -1;
if (color == "red")
nColor = 1;
else if (color == "green")
nColor = 2;
else if (color == "blue")
nColor = 3;
else if (color == "dark green")
nColor = 4;
else if (color == "pink")
nColor = 5;
else if (color == "grey")
nColor = 6;
switch (nColor){
case 1:
return SColor(255, 255, 0, 0);
break;
case 2:
return SColor(255, 0, 255, 0);
break;
case 3:
return SColor(255, 0, 0, 255);
break;
case 4:
return SColor(255, 0, 50, 0);
break;
case 5:
return SColor(255, 255, 10, 255);
break;
case 6:
return SColor(255,200,200,200);
break;
default:
return SColor(255,200,200,200);
break;
}// TODO: Make this function modular
}
Stable Version/1.3.3/IrrColor.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Copyright (C) 2008
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRCOLOR_H
#define IRRCOLOR_H
#include <iostream>
#include <strings.h>
#include "irrlicht.h"
//#include "IrrLib.h"
class IrrColor {
private:
irr::u32 alpha;
void Init();
//who knows?
public:
//irr::video::SColor(alpha, 255, 0, 0);
irr::video::SColor RED;
irr::video::SColor ORANGE;
irr::video::SColor YELLOW;
irr::video::SColor GREEN;
irr::video::SColor BLUE;
irr::video::SColor DARK_GREEN;
irr::video::SColor PINK;
irr::video::SColor GREY;
irr::video::SColor WHITE;
irr::video::SColor BLACK;
/*const ORANGE = irr::video::SColor(alpha, 255, 165, 0);
const YELLOW = irr::video::SColor(alpha, 255, 255, 0);
const GREEN = irr::video::SColor(alpha, 0, 255, 0);
const BLUE = irr::video::SColor(alpha, 0, 0, 255);
const DARK_GREEN = irr::video::SColor(alpha, 0, 100, 0);
const PINK = irr::video::SColor(alpha, 255, 192, 203);
const GREY = irr::video::Scolor(alpha, 190, 190, 190);*/
//void IrrColor::test();
IrrColor();
IrrColor(irr::u32 alpha);
~IrrColor();
int getAlpha();
void setAlpha(int alpha);
irr::video::SColor returnColor(irr::core::stringw color);
};
#endif
Stable Version/1.3.3/IrrDefines.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#ifndef IRRDEFINES_H
#define IRRDEFINES_H
//#include "IrrData.h"
#include "IrrObj.h"
#include "IrrLibObj.h"
#include "IrrGUIStruct.h"
#include "Irr3DObjColor.h"
#include "Irr3DLibObj.h"
typedef IrrObj<IrrLibObj> Irr2DObj;
typedef IrrObj<IrrGUIStruct> IrrGUIObj;
typedef IrrObj<IrrLibObj> IrrEventObj;
typedef IrrObj<IrrLibObj> Irr3DSphere;
typedef IrrObj<Irr3DLibObj> Irr3DObj;
typedef irr::core::dimension2d<irr::s32> PixelSize;
typedef irr::core::position2d<irr::s32> IrrPos;
#endif
Stable Version/1.3.3/IrrEventReciever.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Copyright (C) 2008
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include "IrrEventReciever.h"
#include "IrrLib.h"
//#include "IrrLib.h"
#include <irrlicht.h>
#include <iostream>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
/*void IrrEventReciever::setIrrLib(IrrLib& IrrLib)
{
this.callingIrrLib = IrrLib;
}*/
IrrEventReciever::IrrEventReciever()
{
this->escexit = true;
this->mouse.x = 0;
this->mouse.y = 0;
for(int i = 0; i < irr::KEY_KEY_CODES_COUNT; i++)
keyStates[i] = false;
this->device = IrrLib::device;
}
#if IRRVER == 131
bool IrrEventReciever::OnEvent(SEvent event)
#else
bool IrrEventReciever::OnEvent(const SEvent &event)
#endif
{
// A button was clicked
if (event.EventType == irr::EET_GUI_EVENT)
{
s32 id = event.GUIEvent.Caller->getID();
switch(event.GUIEvent.EventType){
case EGET_BUTTON_CLICKED:
//cout << id << endl;
buttonStates.push_back(id);
break;
case EGET_LISTBOX_CHANGED:
//s32 id = event.GUIEvent.Caller->getID();
listStates.push_back(id);
break;
case EGET_LISTBOX_SELECTED_AGAIN:
listStates.push_back(id);
break;
default:
break;
}
}
/*if (event.EventType == irr::EGET_SCROLL_BAR_CHANGED)
{
}*/
if (event.EventType == irr::EET_KEY_INPUT_EVENT) {
if (!event.KeyInput.PressedDown){
this->keyStates[event.KeyInput.Key] = false;
//cout << "Key was not hit " << this->keyStates[event.KeyInput.Key] << endl;
}
else{
if(event.KeyInput.Key == KEY_ESCAPE && escexit)
IrrLib::device->closeDevice();
this->keyStates[event.KeyInput.Key] = true;
//cout << "Key was hit: " << event.KeyInput.Key << " " << this->keyStates[event.KeyInput.Key] << endl;
}
}
if (event.EventType == EET_MOUSE_INPUT_EVENT){
if (event.MouseInput.Event == EMIE_MOUSE_MOVED){
this->mouse.x = event.MouseInput.X;
this->mouse.y = event.MouseInput.Y;
}
if (event.MouseInput.Event == EMIE_LMOUSE_PRESSED_DOWN)
this->mouseStates[0] = true;
if (event.MouseInput.Event == EMIE_LMOUSE_LEFT_UP)
this->mouseStates[0] = false;
}
return false;
}
void IrrEventReciever::SetEscExit(bool onoff)
{
this->escexit = onoff;
}
int IrrEventReciever::getMouseX()
{
return this->mouse.x;
}
int IrrEventReciever::getMouseY()
{
return this->mouse.y;
}
int IrrEventReciever::getButtonState()
{
if(!this->buttonStates.empty()){
int id;
id = buttonStates.back();
this->buttonStates.pop_back();
return id;
}
else
return -1;
}
int IrrEventReciever::getRevButtonState()
{
if(!this->buttonStates.empty()){
int id = buttonStates.front();
this->buttonStates.erase(buttonStates.begin());
return id;
}
else
return -1;
}
void IrrEventReciever::clearButtonState()
{
this->buttonStates.clear();
}
int IrrEventReciever::checkButtonState(IrrEventObj obj)
{
if(!this->buttonStates.empty()){
int tmp = this->buttonStates.back();
if (tmp == obj->eventid)
{
this->delLastButtonState();
return 1;
}
else
{
return 0;
}
}
else
{
return -1;
}
}
void IrrEventReciever::delLastButtonState()
{
if(!this->buttonStates.empty())
this->buttonStates.pop_back();
}
bool IrrEventReciever::isButtonStateEmpty()
{
return this->buttonStates.empty();
}
int IrrEventReciever::checkListState(IrrEventObj obj)
{
if(!this->listStates.empty())
{
int tmp = this->listStates.back();
//cout << tmp << endl;
if (tmp == obj->eventid)
{
this->delLastListState();
return 1;
}
else
{
return 0;
}
}
else
{
return 0;
}
}
void IrrEventReciever::delLastListState()
{
if(!this->listStates.empty())
this->listStates.pop_back();
}
Stable Version/1.3.3/IrrEventReciever.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Copyright (C) 2008
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRREVENTRECIEVER_H
#define IRREVENTRECIEVER_H
//#include "IrrLib.h"
#include <vector>
#include <irrlicht.h>
#include "IrrLibBase.h"
#include "IrrDefines.h"
#include <stdlib.h>
#include "_mouse.h"
class IrrEventReciever : public irr::IEventReceiver, public IrrLibBase
{
private:
//IrrLib callingIrrLib;
_mouse mouse;
bool escexit;
std::vector<int> buttonStates;
std::vector<int> listStates;
irr::IrrlichtDevice *device;
public:
//IrrEventReciever();
bool mouseStates[1];
IrrEventReciever();
int getMouseX();
int getMouseY();
bool keyStates[irr::KEY_KEY_CODES_COUNT];
//void setIrrLib(IrrLib& IrrLib)
#if IRRVER == 131
virtual bool OnEvent(irr::SEvent event);
#else
virtual bool OnEvent(const irr::SEvent &event);
#endif
void SetEscExit(bool onoff);
int getButtonState();
int getRevButtonState();
void clearButtonState();
int checkButtonState(IrrEventObj obj);
void delLastButtonState();
bool isButtonStateEmpty(); //is there still stuff in the vector to be done? NA
int checkListState(IrrEventObj obj);
void delLastListState();
};
#endif
Stable Version/1.3.3/IrrFunctions.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
#include "IrrFunctions.h"
#include <newton.h>
#include <irrlicht.h>
#include <iostream>
#include "IrrDefines.h"
#include "IrrPhysics.h"
using namespace std;
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
/*void test(Irr3DObj obj_A, Irr3DObj obj_B)
{
cout << "Blah" << endl;
return;
}*/
int CheckForCollision(Irr3DObj& obj_A, Irr3DObj& obj_B)
{
//Matrix to store irr_node position
matrix4 mat_A,mat_B;
//Copy position
mat_A.makeIdentity();
mat_B.makeIdentity();
mat_A.setTranslation(obj_A->getSceneNode()->getPosition());
mat_B.setTranslation(obj_B->getSceneNode()->getPosition());
const int nContacts = 2;
float contacts[3 * nContacts];
float normals[3 * nContacts];
float penetration[ nContacts ];
//Check for collision between collision meshes,
// returns number of contact points
int nHits = NewtonCollisionCollide( IrrPhysics::nworld,nContacts,
obj_A->getNewtonCollision(), (float*)&mat_A[0],
obj_B->getNewtonCollision(), (float*)&mat_B[0],
contacts,
normals,
penetration);
//Collision detected if nHits > 0
/*if( nHits > 0)
return true;
return false;*/
return nHits;
}
//Function to create a NewtonCollision from irrlicht mesh with tree optimization
NewtonCollision * CreateTreeCollisionFromMesh(IMesh *irr_mesh )
{
//Create new (tree optimized) collision mesh
NewtonCollision *collision_obj = NewtonCreateTreeCollision(IrrPhysics::nworld ,NULL);
//Begin collision mesh construction
NewtonTreeCollisionBeginBuild(collision_obj);
int nMeshBuffer = 0; //Mesh Buffer count
int v_index[3] = {0,0,0}; //vertex indices
IMeshBuffer *mesh_buffer = NULL;
float array[9]; //Array to store 3 vertices
//Get (irr_)mesh buffers and copy face by face to collision mesh
for( nMeshBuffer=0 ; nMeshBuffer < irr_mesh->getMeshBufferCount() ; nMeshBuffer++ )
{
mesh_buffer = irr_mesh->getMeshBuffer(nMeshBuffer);
//Get pointer to vertices and indices
S3DVertex *vertices = (S3DVertex*)mesh_buffer->getVertices();
u16 *indices = mesh_buffer->getIndices();
//Fill collision mesh
for(int i=0; i<mesh_buffer->getIndexCount(); i+=3)
{
v_index[0] = indices[ i ];
v_index[1] = indices[i+1];
v_index[2] = indices[i+2];
// 1st position vertex
array[0] = vertices[ v_index[0] ].Pos.X;
array[1] = vertices[ v_index[0] ].Pos.Y;
array[2] = vertices[ v_index[0] ].Pos.Z;
// 2nd position vertex
array[3] = vertices[ v_index[1] ].Pos.X;
array[4] = vertices[ v_index[1] ].Pos.Y;
array[5] = vertices[ v_index[1] ].Pos.Z;
// 3rd position vertex
array[6] = vertices[ v_index[2] ].Pos.X;
array[7] = vertices[ v_index[2] ].Pos.Y;
array[8] = vertices[ v_index[2] ].Pos.Z;
//Add new face to collision mesh
NewtonTreeCollisionAddFace(collision_obj, //collision mesh to add face to
3, //number of vertices in array
(float*)array, //pointer to vertex array
3*sizeof(float),//size of each vertex
1); //ID of the face
}
}
//End collision contruction , set 1 as 2dn param for optimization
NewtonTreeCollisionEndBuild(collision_obj,0);
return collision_obj;
}
//Function to create a NewtonCollision from irrlicht mesh
NewtonCollision * CreateCollisionFromMesh(IMesh *irr_mesh )
{
int nMeshBuffer = 0; //Mesh Buffer count
IMeshBuffer *mesh_buffer = NULL;
float *vertices; //Array to store vertices
u32 nVertices = 0;
//Get number of vertices
for( nMeshBuffer=0 ; nMeshBuffer < irr_mesh->getMeshBufferCount() ; nMeshBuffer++ )
{
nVertices += irr_mesh->getMeshBuffer(nMeshBuffer)->getVertexCount();
}
//create buffer for vertices
vertices = new float[nVertices * 3];
u32 tmpCounter = 0;
//Get (irr_)mesh buffers and copy face vertices
for( nMeshBuffer=0 ; nMeshBuffer < irr_mesh->getMeshBufferCount() ; nMeshBuffer++ )
{
mesh_buffer = irr_mesh->getMeshBuffer(nMeshBuffer);
//Get pointer to vertices and indices
S3DVertex *S3vertices = (S3DVertex*)mesh_buffer->getVertices();
//copy vertices from mesh to buffer
for(int i=0; i<mesh_buffer->getVertexCount(); i++)
{
vertices[tmpCounter++] = S3vertices[i].Pos.X;
vertices[tmpCounter++] = S3vertices[i].Pos.Y;
vertices[tmpCounter++] = S3vertices[i].Pos.Z;
}
}
//Create Newton collision object
NewtonCollision *collision_obj = NewtonCreateConvexHull(IrrPhysics::nworld,nVertices,vertices,sizeof(float)*3,NULL);
//delete vertices
delete [] vertices;
return collision_obj;
}
Stable Version/1.3.3/IrrFunctions.h
1
2
3
4
5
6
7
8
9
10
11
12
#ifndef IRRFUNCTIONS_H
#define IRRFUNCTIONS_H
//#include "IrrObj.h"
#include "IrrDefines.h"
//void test(Irr3DObj obj_A, Irr3DObj obj_B);
int CheckForCollision(Irr3DObj& obj_A, Irr3DObj& obj_B);
NewtonCollision * CreateTreeCollisionFromMesh(irr::scene::IMesh *irr_mesh );
NewtonCollision * CreateCollisionFromMesh(irr::scene::IMesh *irr_mesh );
#endif
Stable Version/1.3.3/IrrGUIStruct.h
1
2
3
4
5
6
7
8
9
10
#ifndef IRRGUISTRUCT_H
#define IRRGUISTRUCT_H
struct IrrGUIStruct {
int eventid;
int objectid;
};
#endif
Stable Version/1.3.3/IrrLib.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Copyright (C) 2008
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <irrlicht.h>
#include <strings.h>
#include <sstream>
#include <time.h>
#include "IrrLib.h"
//Libraries we create go here
//#include "IrrSphere.h"
#include "IrrColor.h"
//#include "Irr2D.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
/*IrrLib::IrrLib(MastEventReceiver & receiver){
this->device = createDevice(EDT_SOFTWARE, dimension2d<s32>(640, 480), 16, false, false, false, &receiver);
if (this->device == 0)
exit(1);
IrrLib::Init();
}*/
IrrlichtDevice *IrrLib::device;
IrrLib::IrrLib(){
IrrLib::device = createDevice(EDT_SOFTWARE, dimension2d<s32>(640, 480), 16, false, false, false, &this->IrrEvent);
if (IrrLib::device == 0)
exit(1);
IrrLib::Init();
}
IrrLib::IrrLib(video::E_DRIVER_TYPE drivertype, core::dimension2d<s32> & res, u32 bits, bool fullscreen, bool stencilbuffer, bool vsync){
//MyEventReceiver receiver;
this->device = createDevice(drivertype, res, bits, fullscreen, stencilbuffer, vsync, &this->IrrEvent);
if (this->device == 0)
exit(1);
IrrLib::Init();
}
IrrLib::IrrLib(int nDrivertype, int width, int height, int bits, bool fullscreen, bool stencilbuffer, bool vsync){
//MyEventReceiver receiver;
video::E_DRIVER_TYPE drivertype;
switch (nDrivertype){
case 0: //TODO: finish this switch case
drivertype = EDT_NULL;
break;
case 1:
drivertype = EDT_SOFTWARE;
break;
case 2:
drivertype = EDT_BURNINGSVIDEO;
break;
case 3:
drivertype = EDT_OPENGL;
break;
case 4:
#if DX8 == 1
drivertype = EDT_DIRECT3D8;
#else
drivertype = EDT_OPENGL;
#endif
//*Note: It seems as Microsoft has stoped supporting DX 8.1, so you can not compile it into Irrlicht engine anymore
//TODO: Find how to detect if DX is complied into Irrlicht
//TODO: Find how to detecht for linux
break;
case 5:
#if DX9 == 1
drivertype = EDT_DIRECT3D9;
#else
drivertype = EDT_OPENGL;
#endif
break;
default:
drivertype = EDT_SOFTWARE;
break;
}
this->device = createDevice(drivertype, dimension2d<s32>(width, height), bits, fullscreen, stencilbuffer, vsync, &this->IrrEvent);
if (this->device == 0)
exit(1);
IrrLib::Init();
}
IrrLib::~IrrLib (){ //Our moms wont clean up after us!
//Although I'm sure Irrlicht does this for us already, its always a good idea to check!
/*if (this->device != NULL)
delete this->device;
if (this->driver != NULL)
delete this->driver;
if (this->smgr != NULL)
delete this->smgr;
if (this->mesh != NULL)
delete this->mesh;
if (this->node != NULL)
delete this->node;*/ //it seems Irrlicht picks up after us...
//however we created newNodes, now we need to delete it!
// NewtonReleaseCollision(nworld, sphere.nwtn_collision);
// NewtonReleaseCollision(nworld, cube.nwtn_collision);
//NewtonDestroy(IrrPhy.nworld);
}
void IrrLib::Init(){
//this->numNodes = 0;
//this->nodeNew = new ISceneNode[10];
//this->env->addStaticText(L"Transparent Control:", rect<s32>(20,30,300,80), true);
this->env = this->device->getGUIEnvironment();
this->driver = this->device->getVideoDriver();
this->smgr = this->device->getSceneManager();
Irr3DLib.SetSmgr(this->smgr);
Irr3DLib.SetDriver(this->driver);
Irr2DLib.SetSmgr(this->smgr);
Irr2DLib.SetDriver(this->driver);
//IrrEvent.SetDevice(this->device);
//Irr2DObj.SetDriver(this->device);
GUI.SetEnv(this->env);
//IrrEvent.SetDevice(this->device);
this->timer = this->device->getTimer();
tick = this->timer->getRealTime();
}
void IrrLib::ReadArchive(stringc file){
this->device->getFileSystem()->addZipFileArchive(file.c_str());
}
void IrrLib::LoadQ3Level(stringc q3level){
this->mesh = this->smgr->getMesh(q3level.c_str());
this->node = 0;
if (this->mesh)
this->node = this->smgr->addOctTreeSceneNode(this->mesh->getMesh(0), 0, -1, 128);
}
void IrrLib::MapPos(int x, int y, int z){
if (this->node)
this->node->setPosition(core::vector3df(x, y, z));
}
void IrrLib::MapPos(){
if (this->node)
this->node->setPosition(core::vector3df(0, 0, 0));
}
void IrrLib::AddFPSCam(){
this->cam = this->smgr->addCameraSceneNodeFPS();
}
void IrrLib::AddFPSCam(f32 x, f32 y, f32 z)
{
this->cam = this->smgr->addCameraSceneNodeFPS();
this->cam->setPosition(irr::core::vector3df(x, y, z));
}
void IrrLib::VisibleCursor(bool tf){
if (tf == false)
this->device->getCursorControl()->setVisible(false);
else
this->device->getCursorControl()->setVisible(true);
}
int IrrLib::GetFPSCount(){
return this->driver->getFPS();
}
bool IrrLib::DeviceIsRunning(){
return this->device->run();
}
bool IrrLib::IsActiveWindow(){
return this->device->isWindowActive();
}
void IrrLib::BeginScene(){
this->driver->beginScene(true, true, video::SColor(0,200,200,200));
//smgr->addCameraSceneNode(0, vector3df(0,1,-7), vector3df(0,0,0));
}
void IrrLib::BeginScene(irr::video::SColor color){
this->driver->beginScene(true, true, color);
}
void IrrLib::BeginScene(bool usebackBuffer, bool usezBuffer, irr::video::SColor color){
this->driver->beginScene(usebackBuffer, usezBuffer, color);
}
void IrrLib::DrawAll(){
//position2d<int> start(50, 50);
//position2d<int> end(100,100);
// SColor whitecolor(255,255,255,255);
//driver->draw2DLine(start, end, whitecolor);
this->smgr->drawAll();
//this->env->drawAll();
//this->device->getGUIEnvironment()->drawAll();
}
void IrrLib::EndScene(){
this->driver->endScene();
}
void IrrLib::SetWindowCaption(stringw str){
this->device->setWindowCaption(str.c_str());
}
irr::core::stringw IrrLib::GetDriverName(){
return this->driver->getName();
}
void IrrLib::EndIrrlicht(){
if(this->device != NULL){
this->device->drop();
this->device = NULL;
}
}
void IrrLib::KeyPress(char key){
this->key = key;
}
char IrrLib::KeyPressed(){
return key;
}
irr::f32 IrrLib::getX(){
return this->smgr->getActiveCamera()->getPosition().X;
}
irr::f32 IrrLib::getY(){
return this->smgr->getActiveCamera()->getPosition().Y;
}
irr::f32 IrrLib::getZ(){
return this->smgr->getActiveCamera()->getPosition().Z;
}
bool IrrLib::CheckGameLoop(){
u32 now;
now = this->timer->getRealTime();
if ((now - this->tick) >= 30){
//this->tick == time (NULL);
return true;
} else {
return false;
}
}
bool IrrLib::CheckGameLoop(u32 ms){
u32 now;
now = this->timer->getRealTime();
if ((now - this->tick) >= ms){
this->tick = now;
return true;
} else {
return false;
}
}
void IrrLib::Exit()
{
this->device->closeDevice();
}
PixelSize IrrLib::GetScreenSize()
{
return this->driver->getScreenSize();
/*pixels returnres;
returnres.width = screenres.Width;
returnres.height = screenres.Height;
return returnres;*/
}
void IrrLib::AddCamera(core::vector3df pos, core::vector3df lookat)
{
this->smgr->addCameraSceneNode(0, pos, lookat);
}
//template <class T> std::string IrrLib::to_string (T t)
/*std::string IrrLib::int_to_string (int t)
{
std::stringstream ss;
ss << t;
return ss.str();
}*/
// This is in the base class now, every class that decends from that class has this ability.
Stable Version/1.3.3/IrrLib.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Copyright (C) 2008
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRLIB_H
#define IRRLIB_H
#ifndef IRRVER
#define IRRVER 14
//2 Versions
// 14 or 131
//Different version due to different implmenation of eventreciever
#endif
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
#include <irrlicht.h>
#include <time.h>
/* We have to include Irrlichts libs */
/*class Irr3D;
class IrrColor;
class IrrLibGUI;
class IrrEventReciever;
class Irr2D;
//class IrrLibBase;
class IrrPhysics;
class Irr3DObj;*/
#include "Irr3D.h"
#include "IrrColor.h"
#include "IrrLibGUI.h"
#include "IrrEventReciever.h"
#include "Irr2D.h"
//#include "Irr2DObj.h"
#include "IrrLibBase.h"
//#include "IrrData.h"
//class IrrPhysics;
#include "IrrPhysics.h"
#include "IrrFunctions.h"
#include "Irr3DLibObj.h"
#include "IrrDefines.h"
//#include "Irr3DObj.h"
/*struct IrrObj {
int eventid;
int objectid;
};*/
//class IrrPhysics;
//Start class
class IrrLib: public IrrLibBase {
private:
/* Create an Irrlicht device as private because the class should handle
All irrlicht interaction */
//irr::IrrlichtDevice *device;
//In IrrLibBase
// Tells Irrlicht what driver to use
//video::E_DRIVER_TYPE driverType;
/*
Get a pointer to the video driver and the SceneManager so that
we do not always have to write device->getVideoDriver() and
device->getSceneManager().
*/
/*irr::video::IVideoDriver* driver;
irr::scene::ISceneManager* smgr;*/
//In IrrLibBase
irr::gui::IGUIEnvironment* env;
/*
Get a pointer to the 'mesh' aka the level.
Note: This is for Quake3 levels, ie bsp maps.
*/
irr::scene::IAnimatedMesh* mesh;
irr::scene::ISceneNode* node;
irr::scene::ISceneNode * tempNode; //use this to store nodeNew's data so we can resize it
irr::scene::ICameraSceneNode * cam;
char key;
void Init();
/*friend class IrrColor;
friend class Irr2DLib;
friend class Sphere;*/
//friend class IrrEventReciever;
irr::u32 tick;
irr::ITimer* timer;
//std::vector<Irr3DLibObj*> gc_vector;
public:
//IrrSphere Sphere; //This has to be public to be able to access the Sphere class
/* IrrSphere is now in Irr3D class */
//Prehaps put this into a IrrLib3D class?
Irr3D Irr3DLib;
IrrColor Color; //Color class...not much of a class but lets keep it OO
Irr2D Irr2DLib; //1/2 variable to be labeled like this due to variables not able to begin with a number
IrrLibGUI GUI;
IrrPhysics IrrPhy;
IrrEventReciever IrrEvent;
IrrLib();
static irr::IrrlichtDevice *device;
//IrrLib(MastEventReceiver & receiver);
IrrLib(irr::video::E_DRIVER_TYPE drivertype, irr::core::dimension2d<irr::s32> & res, irr::u32 bits, bool fullscreen, bool stencilbuffer, bool vsync);
IrrLib(int drivertype, int width, int height, int bits, bool fullscreen, bool stencilbuffer, bool vsync);
~IrrLib(); //Our moms wont clean up after us!
void ReadArchive(irr::core::stringc file);
void LoadQ3Level(irr::core::stringc q3level);
void MapPos(int x, int y, int z); //I think this moves the actual camera?
void MapPos();
void AddFPSCam();
void AddFPSCam(irr::f32 x, irr::f32 y, irr::f32 z);
void VisibleCursor(bool tf);
int GetFPSCount();
bool DeviceIsRunning();
bool IsActiveWindow();
void BeginScene();
void AddCamera(irr::core::vector3df pos, irr::core::vector3df lookat);
void BeginScene(irr::video::SColor color);
//void BeginScene(irr::video::SColor * color);
void BeginScene(bool usebackBuffer, bool usezBuffer, irr::video::SColor color);
//TODO: Add one more for human readable colors and hex colors!
void DrawAll();
void EndScene();
void SetWindowCaption(irr::core::stringw str);
irr::core::stringw GetDriverName();
//TODO: Make function to turn stringw to string and visa versa
void EndIrrlicht(); //Renamed from KillIrrlicht to EndIrrlicht
//TODO: Add logging
void KeyPress(char key);
char KeyPressed();
irr::f32 getX();
irr::f32 getY();
irr::f32 getZ();
bool CheckGameLoop();
bool CheckGameLoop(irr::u32 ms);
void Exit();
PixelSize GetScreenSize();
//void EndGameLoop();
//template <class T> std::string to_string (T t);
};
#endif
Stable Version/1.3.3/IrrLibBase.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Copyright (C) 2008
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <irrlicht.h>
#include "IrrLibBase.h"
#include <strings.h>
#include <sstream>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
/*
* Code from http://articles.techrepublic.com.com/5100-22-5079969.html#
*
struct str_stream
{
std::stringstream & underlying_stream() const
{ return m_streamOut; }
operator std::string() const
{
return m_streamOut.str();
}
private:
mutable std::stringstream m_streamOut;
};
template< class type>
inline const str_stream & operator<< ( const str_stream & out, const type & value)
{
out.underlying_stream() << value;
return out;
}
template<class type> std::string to_string( const type & value)
{
std::ostringstream streamOut;
streamOut << value;
return streamOut.str();
}
* End code copy
*/
void IrrLibBase::SetDriver(IVideoDriver* driver) //can be overloaded
{
this->driver = driver;
}
void IrrLibBase::SetSmgr(ISceneManager* smgr)
{
this->smgr = smgr;
}
std::string IrrLibBase::wchar_to_stdstring (const wchar_t* wc)
{
//cout << "Starting conversion";
//wcstombs(tmp, in, 255);
char c[255];
for(int t = 0; wc[t] != '\0'; t++)
c[t] = (char)wc[t];
/*for(int t = 0; c[t] != '\0'; t++)
wc[t] = c[t];*/
std::stringstream ss;
ss << c;
//cout << "Conversion OK";
return ss.str();
}
std::string IrrLibBase::int_to_string (int t)
{
std::stringstream ss;
ss << t;
return ss.str();
}
std::string IrrLibBase::stringw_to_stdstring(irr::core::stringw sw)
{
std::stringstream ss;
ss << sw.c_str();
return ss.str();
}
irr::core::stringw IrrLibBase::stdstring_to_stringw(std::string ss)
{
stringw tmpw(ss.c_str());
return tmpw;
}
/*void IrrLibBase::SetDevice(irr::IrrlichtDevice *device)
{
this->device = device;
}*/
void IrrLibBase::init()
{
}
/*irr::core::stringw int_to_stringw(int t)
{
std::stringstream ss;
ss << t;
//stringw ret(ss.str());
return ret;
}*/
Stable Version/1.3.3/IrrLibBase.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Copyright (C) 2008
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRLIBBASE_H
#define IRRLIBBASE_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
class IrrLibBase {
protected:
irr::video::IVideoDriver* driver;
irr::scene::ISceneManager* smgr;
irr::IrrlichtDevice *device;
public:
//template<class type> std::string to_string( const type & value);
irr::core::dimension2d<irr::s32> irrpixels;
void SetDriver(irr::video::IVideoDriver* driver);
void SetSmgr(irr::scene::ISceneManager* smgr);
void SetDevice(irr::IrrlichtDevice *device);
std::string int_to_string (int t);
std::string stringw_to_stdstring(irr::core::stringw sw);
irr::core::stringw stdstring_to_stringw(std::string ss);
std::string wchar_to_stdstring (const wchar_t* wc);
//irr::core::stringw int_to_stringw(int t);
void init();
};
#endif
Stable Version/1.3.3/IrrLibGUI.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Copyright (C) 2008
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <strings.h>
#include <irrlicht.h>
#include <vector>
#include <sstream>
#include "IrrLib.h"
#include "IrrLibGUI.h"
#include "IrrLibBase.h"
#include <stdlib.h>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
template<class type> std::string to_string( const type & value)
{
std::ostringstream streamOut;
streamOut << value;
return streamOut.str();
}
IrrLibGUI::IrrLibGUI()
{
//NA does it need to do anything at init?
this->nStaticText = 0;
this->nButton = 0;
this->nButtonid = 100;
this->nListBoxid = 200;
this->nListBox = 0;
//this->nListBoxid = 300;
//this->arrStaticText = new IGUIStaticText[10];
//this->env = this->device->getGUIEnvironment(); //NA yes we do!
}
IrrLibGUI::~IrrLibGUI()
{
//NA Do we have to delete anything?
}
void IrrLibGUI::SetEnv(IGUIEnvironment* env)
{
this->env = env;
//env->addButton(rect<s32>(10,210,110,210 + 32), 0, 109, L"Quit", L"Exits Program");
}
IrrGUIObj IrrLibGUI::addButton(const core::rect< s32 > & rectangle, IGUIElement *parent, s32 id, const wchar_t * text, const wchar_t * tooltiptext)
{
arrButton.push_back(this->env->addButton(rectangle, parent, id, text, tooltiptext));
++nButton;
++nButtonid;
IrrGUIObj ret;
ret->objectid = --nButtonid;
return ret;
}
IrrGUIObj IrrLibGUI::addListBox(const irr::core::rect< irr::s32 > &rectangle, IGUIElement * parent)
{
irr::gui::IGUIListBox* tmp = this->env->addListBox(rectangle, parent, nListBoxid);
arrListBox.push_back(tmp);
//we introduce a new datatype; IrroObj
IrrGUIObj ret;
ret->eventid = nListBoxid;
ret->objectid = nListBox;
++nListBox;
++nListBoxid;
return ret;
}
IrrGUIObj IrrLibGUI::AddListBox(int x1, int y1, int x2, int y2, IGUIElement * parent)
{
return addListBox(rect<s32>(x1, y1, x2, y2), parent);
}
IrrGUIObj IrrLibGUI::AddListBox(const irr::core::rect< irr::s32 > &rectangle, IGUIElement * parent)
{
return addListBox(rectangle, parent);
}
void IrrLibGUI::AddStringToListBox(IrrGUIObj nLbox, stringw text)
{
this->arrListBox[nLbox->objectid]->addItem(text.c_str());
//this->arrListBox[0]->addItem(L"TEST");
}
std::string IrrLibGUI::getSelectListString(IrrGUIObj lstbox)
{
//stringc tmp = this->arrListBox[lstbox]->getListItem(this->arrListBox[lstbox]->getSelected());
//s32 selected = this->arrListBox[lstbox.objectid]->getSelected();
//const wchar_t* tmp = this->arrListBox[lstbox]->getListItem(selected);
//irr::core::stringw tmp;
//char out[255];
//tmp = this->arrListBox[lstbox]->getText();
irr::core::stringc tmp(arrListBox[lstbox->objectid]->getListItem(arrListBox[lstbox->objectid]->getSelected()));
//cout << tmp.c_str() << endl;
//wcstombs(out, tmp, tmp.length());
//cout << tmp[0] << endl;
// std::stringstream ss;
//for (int i = 0; i < tmp.size(); ++i)
//ss << tmp.c_str();
std::string ret = tmp.c_str();
return ret;
}
void IrrLibGUI::Clear()
{
this->env->clear();
}
void IrrLibGUI::DrawAll()
{
this->env->drawAll();
}
IrrGUIObj IrrLibGUI::AddToStaticArray(irr::gui::IGUIStaticText * addme)
{
//arrStaticText[nStaticText] = addme;
arrStaticText.push_back(addme);
this->nStaticText++;
this->nButtonid++;
IrrGUIObj ret;
ret->objectid = this->nStaticText;
return ret;
}
void IrrLibGUI::AddStaticText()
{
//rect<s32>(20,30,300,80),
this->env->addStaticText(L"Powered by IrrLib.", rect<s32>(20,30,300,80), true);
}
IrrGUIObj IrrLibGUI::AddStaticText(stringw message)
{
irr::gui::IGUIStaticText * addthis;
addthis = this->env->addStaticText(message.c_str(), rect<s32>(20,30,300,80), true);
return AddToStaticArray(addthis);
}
IrrGUIObj IrrLibGUI::AddStaticText(stringw message, int x1, int y1, int x2, int y2)
{
irr::gui::IGUIStaticText * addthis;
addthis = this->env->addStaticText(message.c_str(), rect<s32>(x1,y1,x2,y2), true);
return AddToStaticArray(addthis);
}
IrrGUIObj IrrLibGUI::AddStaticText(stringw message, int x1, int y1, int x2, int y2, bool border, bool wordwrap)
{
irr::gui::IGUIStaticText * addthis;
addthis = this->env->addStaticText(message.c_str(), rect<s32>(x1,y1,x2,y2), border, wordwrap);
return AddToStaticArray(addthis);
}
IrrGUIObj IrrLibGUI::AddStaticText(stringw message, int x1, int y1, int x2, int y2, bool border, bool wordwrap, int id, bool fillbackground)
{
irr::gui::IGUIStaticText * addthis;
addthis = this->env->addStaticText(message.c_str(), rect<s32>(x1,y1,x2,y2), border, wordwrap, 0, id, fillbackground);
return AddToStaticArray(addthis);
}
IrrGUIObj IrrLibGUI::AddStaticText(stringw message, const core::rect< s32 > &rectangle)
{
irr::gui::IGUIStaticText * addthis;
addthis = this->env->addStaticText(message.c_str(), rectangle);
return AddToStaticArray(addthis);
}
IrrGUIObj IrrLibGUI::AddStaticText(stringw message, const core::rect< s32 > &rectangle, bool border, bool wordwrap)
{
irr::gui::IGUIStaticText * addthis;
addthis = this->env->addStaticText(message.c_str(), rectangle, border, wordwrap);
return AddToStaticArray(addthis);
}
IrrGUIObj IrrLibGUI::AddStaticText(stringw message, const core::rect< s32 > &rectangle, bool border, bool wordwrap, int id, bool fillbackground)
{
irr::gui::IGUIStaticText * addthis;
addthis = this->env->addStaticText(message.c_str(), rectangle, border, wordwrap, 0, id, fillbackground);
return AddToStaticArray(addthis);
}
void IrrLibGUI::ChangeStaticText(IrrGUIObj nstatictext, stringw message)
{
//this->arrStaticText[this->nStaticText.objectid-1]->setText(message.c_str());
this->arrStaticText[nstatictext->objectid]->setText(message.c_str());
}
void IrrLibGUI::ChangeFont(stringc fontfile)
{
IGUISkin* skin = this->env->getSkin();
IGUIFont* font = this->env->getFont(fontfile.c_str());
if (font)
skin->setFont(font);
}
IrrGUIObj IrrLibGUI::AddButton(stringw text, int x1, int y1, int x2, int y2, stringw tooltiptext = "")
{
return addButton(rect<s32>(x1, y1, x2, y2), 0, nButtonid, text.c_str(), tooltiptext.c_str());
}
IrrGUIObj IrrLibGUI::AddButton(stringw text, core::rect<s32> & rect, stringw tooltiptext = "")
{
return addButton(rect, 0, nButtonid, text.c_str(), tooltiptext.c_str());
}
Stable Version/1.3.3/IrrLibGUI.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Copyright (C) 2008
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRLIBGUI_H
#define IRRLIBGUI_H
#include <iostream>
#include <strings.h>
#include <irrlicht.h>
#include "IrrLib.h"
#include "IrrLibBase.h"
class IrrLibGUI: public IrrLibBase {
private:
irr::gui::IGUISkin* skin;
irr::gui::IGUIFont* font;
irr::gui::IGUIEnvironment* env;
//TODO: Create an array storing all messages
int nStaticText;
//irr::gui::IGUIStaticText* arrStaticText[10];
int nButton;
int nButtonid;
int nListBox;
int nListBoxid;
std::vector<irr::gui::IGUIStaticText*> arrStaticText;
std::vector<irr::gui::IGUIButton*> arrButton;
std::vector<irr::gui::IGUIListBox*> arrListBox;
IrrGUIObj AddToStaticArray(irr::gui::IGUIStaticText * addme);
IrrGUIObj addButton(const irr::core::rect< irr::s32 > & rectangle, irr::gui::IGUIElement *parent = 0, irr::s32 id = 0, const wchar_t * text = 0, const wchar_t * tooltiptext = 0); //TODO: Clean this up!
IrrGUIObj addListBox(const irr::core::rect< irr::s32 > &rectangle, irr::gui::IGUIElement * parent);
public:
IrrLibGUI();
~IrrLibGUI();
void SetEnv(irr::gui::IGUIEnvironment* env);
void Clear();
void DrawAll();
//irr::gui::IGUIStaticText* IrrLibGUI::AddStaticText(); //NA eh a default text adder why not?
/* This is bad coding, we do not want to return an irrlicht object, we want to return a standard datatype because this class handles the GUI elements, not the user. */
void AddStaticText(); //NA eh a default text adder why not?
IrrGUIObj AddStaticText(irr::core::stringw message);
IrrGUIObj AddStaticText(irr::core::stringw message, int x1, int y1, int x2, int y2);
IrrGUIObj AddStaticText(irr::core::stringw message, int x1, int y1, int x2, int y2, bool border, bool wordwrap);
IrrGUIObj AddStaticText(irr::core::stringw message, int x1, int y1, int x2, int y2, bool border, bool wordwrap, int id, bool fillbackground);
IrrGUIObj AddStaticText(irr::core::stringw message, const irr::core::rect< irr::s32 > &rectangle);
IrrGUIObj AddStaticText(irr::core::stringw message, const irr::core::rect< irr::s32 > &rectangle, bool border, bool wordwrap);
IrrGUIObj AddStaticText(irr::core::stringw message, const irr::core::rect< irr::s32 > &rectangle, bool border, bool wordwrap, int id, bool fillbackground);
IrrGUIObj AddButton(irr::core::stringw text, int x1, int y1, int x2, int y2, irr::core::stringw tooltiptext);
IrrGUIObj AddButton(irr::core::stringw text, irr::core::rect<irr::s32> & rect, irr::core::stringw tooltiptext); //TODO: Add move functions
IrrGUIObj AddListBox(int x1, int y1, int x2, int y2, irr::gui::IGUIElement * parent = 0);
IrrGUIObj AddListBox(const irr::core::rect< irr::s32 > &rectangle, irr::gui::IGUIElement * parent = 0);
void AddStringToListBox(IrrGUIObj nLbox, irr::core::stringw text);
void ChangeStaticText(IrrGUIObj nstatictext, irr::core::stringw message);
void ChangeFont(irr::core::stringc fontfile);
std::string getSelectListString(IrrGUIObj lstbox);
//irr::core::stringw getSelectListString(int lstbox);
};
#endif
Stable Version/1.3.3/IrrLibObj.h
1
2
3
4
5
6
7
8
9
10
11
#ifndef IRRLIBOBJ_H
#define IRRLIBOBJ_H
struct IrrLibObj {
int eventid;
int objectid;
int x;
int y;
};
#endif
Stable Version/1.3.3/IrrObj.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#ifndef IRROBJ_H
#define IRROBJ_H
#include <iostream>
//template <typename T> const char* typeof(T&) { return "unknown"; } // default
//template<> const char* typeof(Irr3DLibObj&) { return "Irr3DLibObj"; }
//template<> const char* typeof(float&) { return "float"; }
template <class T> class IrrObj {
T* ptr;
public:
explicit IrrObj(T* p = 0) : ptr(p) {std::cout << "Constructing an IrrObj" << std::endl; if (p == NULL) ptr = new T;}
~IrrObj() {std::cout << "Destructing an IrrObj" << std::endl; delete ptr;}
T& operator*() {return *ptr;}
T* operator->() {return ptr;}
void remove() {delete ptr;}
};
#endif
Stable Version/1.3.3/IrrOpt.h
1
2
3
4
5
6
7
8
9
#ifndef IRROPT.H
#define IRROPT.H
struct IrrOpt {
bool lighting;
irr::core::stringc t;
};
#endif
Stable Version/1.3.3/IrrPhysics.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Copyright (C) 2008
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
#include <vector>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
//#include "IrrLib.h"
#include <newton.h>
#include "IrrPhysics.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
NewtonWorld * IrrPhysics::nworld;
IrrPhysics::IrrPhysics()
{
this->nworld = NewtonCreate(NULL,NULL);
NewtonSetSolverModel(this->nworld, 1);
}
IrrPhysics::~IrrPhysics()
{
NewtonDestroy(this->nworld);
}
Stable Version/1.3.3/IrrPhysics.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Copyright (C) 2008
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRPHYSICS_H
#define IRRPHYSICS_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
#include <vector>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
#include <newton.h>
//#include "IrrLib.h"
#include "IrrLibBase.h"
class IrrPhysics: public IrrLibBase {
//private:
public:
static NewtonWorld *nworld;
IrrPhysics();
~IrrPhysics();
};
#endif
Stable Version/1.3.3/IrrSphere.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Copyright (C) 2008
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include "IrrLib.h"
#include "IrrSphere.h"
#include <irrlicht.h>
#include <strings.h>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
/*void IrrSphere::SetSmgr(irr::scene::ISceneManager* smgr){
this->smgr = smgr;
}
void IrrSphere::SetDriver(irr::video::IVideoDriver* driver){
this->driver = driver;
}*/
Irr3DSphere IrrSphere::CreateNewSphereNode(int x, int y, int z, stringc texture, bool light){
//this->nodeNew[this->numNodes] = this->smgr->addSphereSceneNode();
//this->sphereNodes[this->numNodes]->setPosition(core::vector3df(x,y,z));
//this->sphereNodes[this->numNodes]->setMaterialTexture(0, this->driver->getTexture(texture.c_str()));
//this->sphereNodes[this->numNodes]->setMaterialFlag(video::EMF_LIGHTING, light);
Irr3DSphere ret;
nodeNew = this->smgr->addSphereSceneNode();
nodeNew->setPosition(core::vector3df(x,y,z));
nodeNew->setMaterialTexture(0, this->driver->getTexture(texture.c_str()));
nodeNew->setMaterialFlag(video::EMF_LIGHTING, light);
sphereNodes.push_back(nodeNew);
this->numNodes++;
ret->objectid = this->numNodes--;
return ret;
/*this->node = this->smgr->addSphereSceneNode();
this->node->setPosition(core::vector3df(x,y,z));
this->node->setMaterialTexture(0, this->driver->getTexture(texture.c_str()));
this->node->setMaterialFlag(video::EMF_LIGHTING, light);*/
}
irr::core::vector3df IrrSphere::GetSphereVector(int sphere){
//We are converting to vectors, under construction NA
//return this->nodeNew[sphere]->getPosition();
return this->sphereNodes[sphere]->getPosition();
}
void IrrSphere::SetSphereVector(int sphere, irr::core::vector3df v){
this->sphereNodes[sphere]->setPosition(v);
}
IrrSphere::IrrSphere(){
this->numNodes = 0;
}
IrrSphere::~IrrSphere(){
/*for(int i = 0; i < numNodes; ++i)
delete this->nodeNew[i];
delete this->nodeNew;*/
//We are using vectors now, no more memory clowing business NA
}
Stable Version/1.3.3/IrrSphere.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Copyright (C) 2008
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRSPHERE_H
#define IRRSPHERE_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
#include <vector>
#include <irrlicht.h>
/* We have to include Irrlichts libs */
#include "IrrLibBase.h"
//#include "IrrData.h"
#include "IrrDefines.h"
//#include "IrrLib.h"
class IrrSphere: public IrrLibBase
{
private:
//irr::scene::ISceneNode* nodeNew[10];
irr::scene::ISceneNode* nodeNew;
std::vector<irr::scene::ISceneNode*> sphereNodes;
int numNodes;
//irr::scene::ISceneManager* smgr;
//irr::video::IVideoDriver* driver;
public:
//void IrrSphere::SetDriver(irr::video::IVideoDriver* driver);
//void IrrSphere::SetSmgr(irr::scene::ISceneManager* smgr);
Irr3DSphere CreateNewSphereNode(int x, int y, int z, irr::core::stringc texture, bool light); //this is going to take my advanced C++ skillz!
irr::core::vector3df GetSphereVector(int sphere);
void SetSphereVector(int sphere, irr::core::vector3df v);
IrrSphere();
//IrrSphere::IrrSphere(IrrLib*);
~IrrSphere();
};
#endif
Stable Version/1.3.3/IrrSprite.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Copyright (C) 2008
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <irrlicht.h>
#include <strings.h>
#include "IrrLib.h"
//Libraries we create go here
//#include "IrrSphere.h"
#include "IrrColor.h"
#include "IrrSprite.h"
//#include "Irr2D.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
IrrSprite::IrrSprite()
{
//do stuff
}
IrrSprite::~IrrSprite()
{
//delete stuff
}
/*void IrrSprite::SetDriver(irr::video::IVideoDriver* driver)
{
this->driver = driver;
}
void IrrSprite::SetSmgr(irr::scene::ISceneManager* smgr)
{
this->smgr = smgr;
}*/
Stable Version/1.3.3/IrrSprite.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Copyright (C) 2008
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRSPRITE_H
#define IRRSPRITE_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
//#include "IrrSphere.h"
#include "IrrLibBase.h"
#include "IrrColor.h"
//#include "Irr2D.h"
//#include "IrrSprite.h"
//Start class
class IrrSprite: public IrrLibBase {
private:
//irr::video::IVideoDriver* driver;
//irr::scene::ISceneManager* smgr;
public:
IrrSprite();
~IrrSprite();
/*void IrrSprite::SetDriver(irr::video::IVideoDriver* driver);
void IrrSprite::SetSmgr(irr::scene::ISceneManager* smgr);*/
// I forgot a semicolon here....and it wasn't compling
//Thats 1 bad thing about OOP if there is an error you don't know where the @#$@# the problem is!
};
#endif
Stable Version/1.3.3/Newton.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
//********************************************************************
// Newton Game dynamics
// copyright 2000-2004
// By Julio Jerez
// VC: 6.0
// One and only header file.
//********************************************************************
#ifndef NEWTON_H__736495_6495_076__INCLUDED_
#define NEWTON_H__736495_6495_076__INCLUDED_
// force all not visual studio platform to be in library form
#ifndef _MSC_VER
#ifndef _NEWTON_USE_LIB
#define _NEWTON_USE_LIB
#endif
#endif
#ifdef _NEWTON_USE_LIB
#define NEWTON_API
#else
#ifdef _NEWTON_BUILD_DLL
#define NEWTON_API __declspec(dllexport)
#else
#define NEWTON_API __declspec(dllimport)
#endif
#endif
//#define __USE_DOUBLE_PRECISION__
#ifdef __USE_DOUBLE_PRECISION__
typedef double dFloat;
#else
typedef float dFloat;
#endif
#ifdef __cplusplus
extern "C" {
#endif
typedef struct NewtonBody{} NewtonBody;
typedef struct NewtonWorld{} NewtonWorld;
typedef struct NewtonJoint{} NewtonJoint;
typedef struct NewtonContact{} NewtonContact;
typedef struct NewtonMaterial{} NewtonMaterial;
typedef struct NewtonCollision{} NewtonCollision;
typedef struct NewtonRagDoll{} NewtonRagDoll;
typedef struct NewtonRagDollBone{} NewtonRagDollBone;
typedef struct NewtonUserMeshCollisionCollideDescTag
{
dFloat m_boxP0[4];// lower bounding box of intersection query in local space
dFloat m_boxP1[4];// upper bounding box of intersection query in local space
void* m_userData; // user data passed to the collision geometry at creation time
int m_faceCount; // the application should set here how many polygons intersect the query box
dFloat* m_vertex; // the application should the pointer to the vertex array.
int m_vertexStrideInBytes; // the application should set here the size of each vertex
int* m_userAttribute; // the application should set here the pointer to the user data, one for each face
int* m_faceIndexCount; // the application should set here the pointer to the vertex count of each face.
int* m_faceVertexIndex; // the application should set here the pointer index array for each vertex on a face.
NewtonBody* m_objBody; // pointer to the colliding body
NewtonBody* m_polySoupBody; // pointer to the rigid body owner of this collision tree
} NewtonUserMeshCollisionCollideDesc;
typedef struct NewtonUserMeshCollisionRayHitDescTag
{
dFloat m_p0[4];// ray origin in collision local space
dFloat m_p1[4]; // ray destination in collision local space
dFloat m_normalOut[4];// copy here the normal at the rat intersection
int m_userIdOut; // copy here a user defined id for further feedback
void* m_userData; // user data passed to the collision geometry at creation time
} NewtonUserMeshCollisionRayHitDesc;
typedef struct NewtonHingeSliderUpdateDescTag
{
dFloat m_accel;
dFloat m_minFriction;
dFloat m_maxFriction;
dFloat m_timestep;
} NewtonHingeSliderUpdateDesc;
// Newton callback functions
typedef void* (*NewtonAllocMemory) (int sizeInBytes);
typedef void (*NewtonFreeMemory) (void *ptr, int sizeInBytes);
typedef void (*NewtonSerialize) (void* serializeHandle, const void* buffer, size_t size);
typedef void (*NewtonDeserialize) (void* serializeHandle, void* buffer, size_t size);
typedef void (*NewtonUserMeshCollisionCollideCallback) (NewtonUserMeshCollisionCollideDesc* collideDescData);
typedef dFloat (*NewtonUserMeshCollisionRayHitCallback) (NewtonUserMeshCollisionRayHitDesc* lineDescData);
typedef void (*NewtonUserMeshCollisionDestroyCallback) (void* descData);
typedef void (*NewtonTreeCollisionCallback) (const NewtonBody* bodyWithTreeCollision, const NewtonBody* body,
const dFloat* vertex, int vertexstrideInBytes,
int indexCount, const int* indexArray);
typedef void (*NewtonBodyDestructor) (const NewtonBody* body);
typedef void (*NewtonApplyForceAndTorque) (const NewtonBody* body);
typedef void (*NewtonBodyActivationState) (const NewtonBody* body, unsigned state);
typedef void (*NewtonSetTransform) (const NewtonBody* body, const dFloat* matrix);
typedef void (*NewtonSetRagDollTransform) (const NewtonRagDollBone* bone);
typedef int (*NewtonGetBuoyancyPlane) (const int collisionID, void *context, const dFloat* globalSpaceMatrix, dFloat* globalSpacePlane);
typedef void (*NewtonVehicleTireUpdate) (const NewtonJoint* vehicle);
typedef unsigned (*NewtonWorldRayPrefilterCallback)(const NewtonBody* body, const NewtonCollision* collision, void* userData);
typedef dFloat (*NewtonWorldRayFilterCallback)(const NewtonBody* body, const dFloat* hitNormal, int collisionID, void* userData, dFloat intersetParam);
typedef void (*NewtonBodyLeaveWorld) (const NewtonBody* body);
typedef int (*NewtonContactBegin) (const NewtonMaterial* material, const NewtonBody* body0, const NewtonBody* body1);
typedef int (*NewtonContactProcess) (const NewtonMaterial* material, const NewtonContact* contact);
typedef void (*NewtonContactEnd) (const NewtonMaterial* material);
typedef void (*NewtonBodyIterator) (const NewtonBody* body);
typedef void (*NewtonCollisionIterator) (const NewtonBody* body, int vertexCount, const dFloat* FaceArray, int faceId);
typedef void (*NewtonBallCallBack) (const NewtonJoint* ball);
typedef unsigned (*NewtonHingeCallBack) (const NewtonJoint* hinge, NewtonHingeSliderUpdateDesc* desc);
typedef unsigned (*NewtonSliderCallBack) (const NewtonJoint* slider, NewtonHingeSliderUpdateDesc* desc);
typedef unsigned (*NewtonUniversalCallBack) (const NewtonJoint* universal, NewtonHingeSliderUpdateDesc* desc);
typedef unsigned (*NewtonCorkscrewCallBack) (const NewtonJoint* corkscrew, NewtonHingeSliderUpdateDesc* desc);
typedef void (*NewtonUserBilateralCallBack) (const NewtonJoint* userJoint);
typedef void (*NewtonConstraintDestructor) (const NewtonJoint* me);
// **********************************************************************************************
//
// world control functions
//
// **********************************************************************************************
NEWTON_API NewtonWorld* NewtonCreate (NewtonAllocMemory malloc, NewtonFreeMemory mfree);
NEWTON_API void NewtonDestroy (const NewtonWorld* newtonWorld);
NEWTON_API void NewtonDestroyAllBodies (const NewtonWorld* newtonWorld);
NEWTON_API void NewtonUpdate (const NewtonWorld* newtonWorld, dFloat timestep);
NEWTON_API void NewtonSetPlatformArchitecture (const NewtonWorld* newtonWorld, int mode);
NEWTON_API void NewtonSetSolverModel (const NewtonWorld* newtonWorld, int model);
NEWTON_API void NewtonSetFrictionModel (const NewtonWorld* newtonWorld, int model);
NEWTON_API dFloat NewtonGetTimeStep (const NewtonWorld* newtonWorld);
NEWTON_API void NewtonSetMinimumFrameRate (const NewtonWorld* newtonWorld, dFloat frameRate);
NEWTON_API void NewtonSetBodyLeaveWorldEvent (const NewtonWorld* newtonWorld, NewtonBodyLeaveWorld callback);
NEWTON_API void NewtonSetWorldSize (const NewtonWorld* newtonWorld, const dFloat* minPoint, const dFloat* maxPoint);
NEWTON_API void NewtonWorldFreezeBody (const NewtonWorld* newtonWorld, const NewtonBody* body);
NEWTON_API void NewtonWorldUnfreezeBody (const NewtonWorld* newtonWorld, const NewtonBody* body);
NEWTON_API void NewtonWorldForEachBodyDo (const NewtonWorld* newtonWorld, NewtonBodyIterator callback);
NEWTON_API void NewtonWorldForEachBodyInAABBDo (const NewtonWorld* newtonWorld, const dFloat* p0, const dFloat* p1, NewtonBodyIterator callback);
NEWTON_API void NewtonWorldSetUserData (const NewtonWorld* newtonWorld, void* userData);
NEWTON_API void* NewtonWorldGetUserData (const NewtonWorld* newtonWorld);
NEWTON_API int NewtonWorldGetVersion (const NewtonWorld* newtonWorld);
NEWTON_API void NewtonWorldRayCast (const NewtonWorld* newtonWorld, const dFloat* p0, const dFloat* p1, NewtonWorldRayFilterCallback filter, void* userData, NewtonWorldRayPrefilterCallback prefilter);
// world utility functions
// NEWTON_API int NewtonGetBodiesCount();
// NEWTON_API int NewtonGetActiveBodiesCount();
// NEWTON_API int NewtonGetActiveConstraintsCount();
// NEWTON_API dFloat NewtonGetGlobalScale (const NewtonWorld* newtonWorld);
// **********************************************************************************************
//
// Physics Material Section
//
// **********************************************************************************************
NEWTON_API int NewtonMaterialGetDefaultGroupID(const NewtonWorld* newtonWorld);
NEWTON_API int NewtonMaterialCreateGroupID(const NewtonWorld* newtonWorld);
NEWTON_API void NewtonMaterialDestroyAllGroupID(const NewtonWorld* newtonWorld);
NEWTON_API void NewtonMaterialSetDefaultSoftness (const NewtonWorld* newtonWorld, int id0, int id1, dFloat value);
NEWTON_API void NewtonMaterialSetDefaultElasticity (const NewtonWorld* newtonWorld, int id0, int id1, dFloat elasticCoef);
NEWTON_API void NewtonMaterialSetDefaultCollidable (const NewtonWorld* newtonWorld, int id0, int id1, int state);
NEWTON_API void NewtonMaterialSetContinuousCollisionMode (const NewtonWorld* newtonWorld, int id0, int id1, int state);
NEWTON_API void NewtonMaterialSetDefaultFriction (const NewtonWorld* newtonWorld, int id0, int id1,
dFloat staticFriction, dFloat kineticFriction);
NEWTON_API void NewtonMaterialSetCollisionCallback (const NewtonWorld* newtonWorld, int id0, int id1, void* userData,
NewtonContactBegin begin, NewtonContactProcess process, NewtonContactEnd end);
NEWTON_API void* NewtonMaterialGetUserData (const NewtonWorld* newtonWorld, int id0, int id1);
// **********************************************************************************************
//
// Physics Contact control functions
//
// **********************************************************************************************
NEWTON_API void NewtonMaterialDisableContact (const NewtonMaterial* material);
NEWTON_API dFloat NewtonMaterialGetCurrentTimestep (const NewtonMaterial* material);
NEWTON_API void *NewtonMaterialGetMaterialPairUserData (const NewtonMaterial* material);
NEWTON_API unsigned NewtonMaterialGetContactFaceAttribute (const NewtonMaterial* material);
NEWTON_API unsigned NewtonMaterialGetBodyCollisionID (const NewtonMaterial* material, const NewtonBody* body);
NEWTON_API dFloat NewtonMaterialGetContactNormalSpeed (const NewtonMaterial* material, const NewtonContact* contactlHandle);
NEWTON_API void NewtonMaterialGetContactForce (const NewtonMaterial* material, dFloat* force);
NEWTON_API void NewtonMaterialGetContactPositionAndNormal (const NewtonMaterial* material, dFloat* posit, dFloat* normal);
NEWTON_API void NewtonMaterialGetContactTangentDirections (const NewtonMaterial* material, dFloat* dir0, dFloat* dir);
NEWTON_API dFloat NewtonMaterialGetContactTangentSpeed (const NewtonMaterial* material, const NewtonContact* contactlHandle, int index);
NEWTON_API void NewtonMaterialSetContactSoftness (const NewtonMaterial* material, dFloat softness);
NEWTON_API void NewtonMaterialSetContactElasticity (const NewtonMaterial* material, dFloat restitution);
NEWTON_API void NewtonMaterialSetContactFrictionState (const NewtonMaterial* material, int state, int index);
NEWTON_API void NewtonMaterialSetContactStaticFrictionCoef (const NewtonMaterial* material, dFloat coef, int index);
NEWTON_API void NewtonMaterialSetContactKineticFrictionCoef (const NewtonMaterial* material, dFloat coef, int index);
NEWTON_API void NewtonMaterialSetContactNormalAcceleration (const NewtonMaterial* material, dFloat accel);
NEWTON_API void NewtonMaterialSetContactNormalDirection (const NewtonMaterial* material, const dFloat* directionVector);
NEWTON_API void NewtonMaterialSetContactTangentAcceleration (const NewtonMaterial* material, dFloat accel, int index);
NEWTON_API void NewtonMaterialContactRotateTangentDirections (const NewtonMaterial* material, const dFloat* directionVector);
// **********************************************************************************************
//
// convex collision primitives creation functions
//
// **********************************************************************************************
NEWTON_API NewtonCollision* NewtonCreateNull (const NewtonWorld* newtonWorld);
NEWTON_API NewtonCollision* NewtonCreateSphere (const NewtonWorld* newtonWorld, dFloat radiusX, dFloat radiusY, dFloat radiusZ, const dFloat *offsetMatrix);
NEWTON_API NewtonCollision* NewtonCreateBox (const NewtonWorld* newtonWorld, dFloat dx, dFloat dy, dFloat dz, const dFloat *offsetMatrix);
NEWTON_API NewtonCollision* NewtonCreateCone (const NewtonWorld* newtonWorld, dFloat radius, dFloat height, const dFloat *offsetMatrix);
NEWTON_API NewtonCollision* NewtonCreateCapsule (const NewtonWorld* newtonWorld, dFloat radius, dFloat height, const dFloat *offsetMatrix);
NEWTON_API NewtonCollision* NewtonCreateCylinder (const NewtonWorld* newtonWorld, dFloat radius, dFloat height, const dFloat *offsetMatrix);
NEWTON_API NewtonCollision* NewtonCreateChamferCylinder (const NewtonWorld* newtonWorld, dFloat radius, dFloat height, const dFloat *offsetMatrix);
NEWTON_API NewtonCollision* NewtonCreateConvexHull (const NewtonWorld* newtonWorld, int count, const dFloat* vertexCloud, int strideInBytes, const dFloat *offsetMatrix);
NEWTON_API NewtonCollision* NewtonCreateConvexHullModifier (const NewtonWorld* newtonWorld, const NewtonCollision* convexHullCollision);
NEWTON_API void NewtonConvexHullModifierGetMatrix (const NewtonCollision* convexHullCollision, dFloat* matrix);
NEWTON_API void NewtonConvexHullModifierSetMatrix (const NewtonCollision* convexHullCollision, const dFloat* matrix);
NEWTON_API void NewtonConvexCollisionSetUserID (const NewtonCollision* convexCollision, unsigned id);
NEWTON_API unsigned NewtonConvexCollisionGetUserID (const NewtonCollision* convexCollision);
NEWTON_API dFloat NewtonConvexCollisionCalculateVolume (const NewtonCollision* convexCollision);
NEWTON_API void NewtonConvexCollisionCalculateInertialMatrix (const NewtonCollision* convexCollision, dFloat* inertia, dFloat* origin);
NEWTON_API void NewtonCollisionMakeUnique (const NewtonWorld* newtonWorld, const NewtonCollision* collision);
NEWTON_API void NewtonReleaseCollision (const NewtonWorld* newtonWorld, const NewtonCollision* collision);
// **********************************************************************************************
//
// complex collision primitives creation functions
// note: can only be used with static bodies (bodies with infinite mass)
//
// **********************************************************************************************
NEWTON_API NewtonCollision* NewtonCreateCompoundCollision (const NewtonWorld* newtonWorld, int count,
NewtonCollision* const collisionPrimitiveArray[]);
NEWTON_API NewtonCollision* NewtonCreateUserMeshCollision (const NewtonWorld* newtonWorld, const dFloat *minBox,
const dFloat *maxBox, void *userData, NewtonUserMeshCollisionCollideCallback collideCallback,
NewtonUserMeshCollisionRayHitCallback rayHitCallback, NewtonUserMeshCollisionDestroyCallback destroyCallback);
// **********************************************************************************************
//
// CollisionTree Utility functions
//
// **********************************************************************************************
NEWTON_API NewtonCollision* NewtonCreateTreeCollision (const NewtonWorld* newtonWorld, NewtonTreeCollisionCallback userCallback);
NEWTON_API void NewtonTreeCollisionBeginBuild (const NewtonCollision* treeCollision);
NEWTON_API void NewtonTreeCollisionAddFace (const NewtonCollision* treeCollision, int vertexCount, const dFloat* vertexPtr,
int strideInBytes, int faceAttribute);
NEWTON_API void NewtonTreeCollisionEndBuild (const NewtonCollision* treeCollision, int optimize);
NEWTON_API void NewtonTreeCollisionSerialize (const NewtonCollision* treeCollision, NewtonSerialize serializeFunction,
void* serializeHandle);
NEWTON_API NewtonCollision* NewtonCreateTreeCollisionFromSerialization (const NewtonWorld* newtonWorld,
NewtonTreeCollisionCallback userCallback, NewtonDeserialize deserializeFunction, void* serializeHandle);
NEWTON_API int NewtonTreeCollisionGetFaceAtribute (const NewtonCollision* treeCollision, const int* faceIndexArray);
NEWTON_API void NewtonTreeCollisionSetFaceAtribute (const NewtonCollision* treeCollision, const int* faceIndexArray,
int attribute);
// **********************************************************************************************
//
// General purpose collision library functions
//
// **********************************************************************************************
NEWTON_API int NewtonCollisionPointDistance (const NewtonWorld* newtonWorld, const dFloat *point,
const NewtonCollision* collsion, const dFloat* matrix, dFloat* contact, dFloat* normal);
NEWTON_API int NewtonCollisionClosestPoint (const NewtonWorld* newtonWorld,
const NewtonCollision* collsionA, const dFloat* matrixA, const NewtonCollision* collsionB, const dFloat* matrixB,
dFloat* contactA, dFloat* contactB, dFloat* normalAB);
NEWTON_API int NewtonCollisionCollide (const NewtonWorld* newtonWorld, int maxSize,
const NewtonCollision* collsionA, const dFloat* matrixA, const NewtonCollision* collsionB, const dFloat* matrixB,
dFloat* contacts, dFloat* normals, dFloat* penetration);
NEWTON_API int NewtonCollisionCollideContinue (const NewtonWorld* newtonWorld, int maxSize, const dFloat timestap,
const NewtonCollision* collsionA, const dFloat* matrixA, const dFloat* velocA, const dFloat* omegaA,
const NewtonCollision* collsionB, const dFloat* matrixB, const dFloat* velocB, const dFloat* omegaB,
dFloat* timeOfImpact, dFloat* contacts, dFloat* normals, dFloat* penetration);
NEWTON_API dFloat NewtonCollisionRayCast (const NewtonCollision* collision, const dFloat* p0, const dFloat* p1, dFloat* normals, int* attribute);
NEWTON_API void NewtonCollisionCalculateAABB (const NewtonCollision* collision, const dFloat *matrix, dFloat* p0, dFloat* p1);
// **********************************************************************************************
//
// transforms utility functions
//
// **********************************************************************************************
NEWTON_API void NewtonGetEulerAngle (const dFloat* matrix, dFloat* eulersAngles);
NEWTON_API void NewtonSetEulerAngle (const dFloat* eulersAngles, dFloat* matrix);
// **********************************************************************************************
//
// body manipulation functions
//
// **********************************************************************************************
NEWTON_API NewtonBody* NewtonCreateBody (const NewtonWorld* newtonWorld, const NewtonCollision* collision);
NEWTON_API void NewtonDestroyBody(const NewtonWorld* newtonWorld, const NewtonBody* body);
NEWTON_API void NewtonBodyAddForce (const NewtonBody* body, const dFloat* force);
NEWTON_API void NewtonBodyAddTorque (const NewtonBody* body, const dFloat* torque);
NEWTON_API void NewtonBodySetMatrix (const NewtonBody* body, const dFloat* matrix);
NEWTON_API void NewtonBodySetMatrixRecursive (const NewtonBody* body, const dFloat* matrix);
NEWTON_API void NewtonBodySetMassMatrix (const NewtonBody* body, dFloat mass, dFloat Ixx, dFloat Iyy, dFloat Izz);
NEWTON_API void NewtonBodySetMaterialGroupID (const NewtonBody* body, int id);
NEWTON_API void NewtonBodySetContinuousCollisionMode (const NewtonBody* body, unsigned state);
NEWTON_API void NewtonBodySetJointRecursiveCollision (const NewtonBody* body, unsigned state);
NEWTON_API void NewtonBodySetOmega (const NewtonBody* body, const dFloat* omega);
NEWTON_API void NewtonBodySetVelocity (const NewtonBody* body, const dFloat* velocity);
NEWTON_API void NewtonBodySetForce (const NewtonBody* body, const dFloat* force);
NEWTON_API void NewtonBodySetTorque (const NewtonBody* body, const dFloat* torque);
NEWTON_API void NewtonBodySetCentreOfMass (const NewtonBody* body, const dFloat* com);
NEWTON_API void NewtonBodySetLinearDamping (const NewtonBody* body, dFloat linearDamp);
NEWTON_API void NewtonBodySetAngularDamping (const NewtonBody* body, const dFloat* angularDamp);
NEWTON_API void NewtonBodySetUserData (const NewtonBody* body, void* userData);
NEWTON_API void NewtonBodyCoriolisForcesMode (const NewtonBody* body, int mode);
NEWTON_API void NewtonBodySetCollision (const NewtonBody* body, const NewtonCollision* collision);
NEWTON_API void NewtonBodySetAutoFreeze (const NewtonBody* body, int state);
NEWTON_API void NewtonBodySetFreezeTreshold (const NewtonBody* body, dFloat freezeSpeed2, dFloat freezeOmega2, int framesCount);
NEWTON_API void NewtonBodySetTransformCallback (const NewtonBody* body, NewtonSetTransform callback);
NEWTON_API void NewtonBodySetDestructorCallback (const NewtonBody* body, NewtonBodyDestructor callback);
NEWTON_API void NewtonBodySetAutoactiveCallback (const NewtonBody* body, NewtonBodyActivationState callback);
NEWTON_API void NewtonBodySetForceAndTorqueCallback (const NewtonBody* body, NewtonApplyForceAndTorque callback);
NEWTON_API NewtonApplyForceAndTorque NewtonBodyGetForceAndTorqueCallback (const NewtonBody* body);
NEWTON_API void* NewtonBodyGetUserData (const NewtonBody* body);
NEWTON_API NewtonWorld* NewtonBodyGetWorld (const NewtonBody* body);
NEWTON_API NewtonCollision* NewtonBodyGetCollision (const NewtonBody* body);
NEWTON_API int NewtonBodyGetMaterialGroupID (const NewtonBody* body);
NEWTON_API int NewtonBodyGetContinuousCollisionMode (const NewtonBody* body);
NEWTON_API int NewtonBodyGetJointRecursiveCollision (const NewtonBody* body);
NEWTON_API void NewtonBodyGetMatrix(const NewtonBody* body, dFloat* matrix);
NEWTON_API void NewtonBodyGetMassMatrix (const NewtonBody* body, dFloat* mass, dFloat* Ixx, dFloat* Iyy, dFloat* Izz);
NEWTON_API void NewtonBodyGetInvMass(const NewtonBody* body, dFloat* invMass, dFloat* invIxx, dFloat* invIyy, dFloat* invIzz);
NEWTON_API void NewtonBodyGetOmega(const NewtonBody* body, dFloat* vector);
NEWTON_API void NewtonBodyGetVelocity(const NewtonBody* body, dFloat* vector);
NEWTON_API void NewtonBodyGetForce(const NewtonBody* body, dFloat* vector);
NEWTON_API void NewtonBodyGetTorque(const NewtonBody* body, dFloat* vector);
NEWTON_API void NewtonBodyGetCentreOfMass (const NewtonBody* body, dFloat* com);
NEWTON_API int NewtonBodyGetSleepingState(const NewtonBody* body);
NEWTON_API int NewtonBodyGetAutoFreeze(const NewtonBody* body);
NEWTON_API dFloat NewtonBodyGetLinearDamping (const NewtonBody* body);
NEWTON_API void NewtonBodyGetAngularDamping (const NewtonBody* body, dFloat* vector);
NEWTON_API void NewtonBodyGetAABB (const NewtonBody* body, dFloat* p0, dFloat* p1);
NEWTON_API void NewtonBodyGetFreezeTreshold (const NewtonBody* body, dFloat* freezeSpeed2, dFloat* freezeOmega2);
NEWTON_API void NewtonBodyAddBuoyancyForce (const NewtonBody* body, dFloat fluidDensity,
dFloat fluidLinearViscosity, dFloat fluidAngularViscosity,
const dFloat* gravityVector, NewtonGetBuoyancyPlane buoyancyPlane, void *context);
NEWTON_API void NewtonBodyForEachPolygonDo (const NewtonBody* body, NewtonCollisionIterator callback);
NEWTON_API void NewtonAddBodyImpulse (const NewtonBody* body, const dFloat* pointDeltaVeloc, const dFloat* pointPosit);
// **********************************************************************************************
//
// Common joint functions
//
// **********************************************************************************************
NEWTON_API void* NewtonJointGetUserData (const NewtonJoint* joint);
NEWTON_API void NewtonJointSetUserData (const NewtonJoint* joint, void* userData);
NEWTON_API int NewtonJointGetCollisionState (const NewtonJoint* joint);
NEWTON_API void NewtonJointSetCollisionState (const NewtonJoint* joint, int state);
NEWTON_API dFloat NewtonJointGetStiffness (const NewtonJoint* joint);
NEWTON_API void NewtonJointSetStiffness (const NewtonJoint* joint, dFloat state);
NEWTON_API void NewtonDestroyJoint(const NewtonWorld* newtonWorld, const NewtonJoint* joint);
NEWTON_API void NewtonJointSetDestructor (const NewtonJoint* joint, NewtonConstraintDestructor destructor);
// **********************************************************************************************
//
// Ball and Socket joint functions
//
// **********************************************************************************************
NEWTON_API NewtonJoint* NewtonConstraintCreateBall (const NewtonWorld* newtonWorld, const dFloat* pivotPoint,
const NewtonBody* childBody, const NewtonBody* parentBody);
NEWTON_API void NewtonBallSetUserCallback (const NewtonJoint* ball, NewtonBallCallBack callback);
NEWTON_API void NewtonBallGetJointAngle (const NewtonJoint* ball, dFloat* angle);
NEWTON_API void NewtonBallGetJointOmega (const NewtonJoint* ball, dFloat* omega);
NEWTON_API void NewtonBallGetJointForce (const NewtonJoint* ball, dFloat* force);
NEWTON_API void NewtonBallSetConeLimits (const NewtonJoint* ball, const dFloat* pin, dFloat maxConeAngle, dFloat maxTwistAngle);
// **********************************************************************************************
//
// Hinge joint functions
//
// **********************************************************************************************
NEWTON_API NewtonJoint* NewtonConstraintCreateHinge (const NewtonWorld* newtonWorld,
const dFloat* pivotPoint, const dFloat* pinDir,
const NewtonBody* childBody, const NewtonBody* parentBody);
NEWTON_API void NewtonHingeSetUserCallback (const NewtonJoint* hinge, NewtonHingeCallBack callback);
NEWTON_API dFloat NewtonHingeGetJointAngle (const NewtonJoint* hinge);
NEWTON_API dFloat NewtonHingeGetJointOmega (const NewtonJoint* hinge);
NEWTON_API void NewtonHingeGetJointForce (const NewtonJoint* hinge, dFloat* force);
NEWTON_API dFloat NewtonHingeCalculateStopAlpha (const NewtonJoint* hinge, const NewtonHingeSliderUpdateDesc* desc, dFloat angle);
// **********************************************************************************************
//
// Slider joint functions
//
// **********************************************************************************************
NEWTON_API NewtonJoint* NewtonConstraintCreateSlider (const NewtonWorld* newtonWorld,
const dFloat* pivotPoint, const dFloat* pinDir,
const NewtonBody* childBody, const NewtonBody* parentBody);
NEWTON_API void NewtonSliderSetUserCallback (const NewtonJoint* slider, NewtonSliderCallBack callback);
NEWTON_API dFloat NewtonSliderGetJointPosit (const NewtonJoint* slider);
NEWTON_API dFloat NewtonSliderGetJointVeloc (const NewtonJoint* slider);
NEWTON_API void NewtonSliderGetJointForce (const NewtonJoint* slider, dFloat* force);
NEWTON_API dFloat NewtonSliderCalculateStopAccel (const NewtonJoint* slider, const NewtonHingeSliderUpdateDesc* desc, dFloat position);
// **********************************************************************************************
//
// Corkscrew joint functions
//
// **********************************************************************************************
NEWTON_API NewtonJoint* NewtonConstraintCreateCorkscrew (const NewtonWorld* newtonWorld,
const dFloat* pivotPoint, const dFloat* pinDir,
const NewtonBody* childBody, const NewtonBody* parentBody);
NEWTON_API void NewtonCorkscrewSetUserCallback (const NewtonJoint* corkscrew, NewtonCorkscrewCallBack callback);
NEWTON_API dFloat NewtonCorkscrewGetJointPosit (const NewtonJoint* corkscrew);
NEWTON_API dFloat NewtonCorkscrewGetJointAngle (const NewtonJoint* corkscrew);
NEWTON_API dFloat NewtonCorkscrewGetJointVeloc (const NewtonJoint* corkscrew);
NEWTON_API dFloat NewtonCorkscrewGetJointOmega (const NewtonJoint* corkscrew);
NEWTON_API void NewtonCorkscrewGetJointForce (const NewtonJoint* corkscrew, dFloat* force);
NEWTON_API dFloat NewtonCorkscrewCalculateStopAlpha (const NewtonJoint* corkscrew, const NewtonHingeSliderUpdateDesc* desc, dFloat angle);
NEWTON_API dFloat NewtonCorkscrewCalculateStopAccel (const NewtonJoint* corkscrew, const NewtonHingeSliderUpdateDesc* desc, dFloat position);
// **********************************************************************************************
//
// Universal joint functions
//
// **********************************************************************************************
NEWTON_API NewtonJoint* NewtonConstraintCreateUniversal (const NewtonWorld* newtonWorld,
const dFloat* pivotPoint, const dFloat* pinDir0, const dFloat* pinDir1,
const NewtonBody* childBody, const NewtonBody* parentBody);
NEWTON_API void NewtonUniversalSetUserCallback (const NewtonJoint* universal, NewtonUniversalCallBack callback);
NEWTON_API dFloat NewtonUniversalGetJointAngle0 (const NewtonJoint* universal);
NEWTON_API dFloat NewtonUniversalGetJointAngle1 (const NewtonJoint* universal);
NEWTON_API dFloat NewtonUniversalGetJointOmega0 (const NewtonJoint* universal);
NEWTON_API dFloat NewtonUniversalGetJointOmega1 (const NewtonJoint* universal);
NEWTON_API void NewtonUniversalGetJointForce (const NewtonJoint* universal, dFloat* force);
NEWTON_API dFloat NewtonUniversalCalculateStopAlpha0 (const NewtonJoint* universal, const NewtonHingeSliderUpdateDesc* desc, dFloat angle);
NEWTON_API dFloat NewtonUniversalCalculateStopAlpha1 (const NewtonJoint* universal, const NewtonHingeSliderUpdateDesc* desc, dFloat angle);
// **********************************************************************************************
//
// Up vector joint functions
//
// **********************************************************************************************
NEWTON_API NewtonJoint* NewtonConstraintCreateUpVector (const NewtonWorld* newtonWorld, const dFloat* pinDir, const NewtonBody* body);
NEWTON_API void NewtonUpVectorGetPin (const NewtonJoint* upVector, dFloat *pin);
NEWTON_API void NewtonUpVectorSetPin (const NewtonJoint* upVector, const dFloat *pin);
// **********************************************************************************************
//
// User defined bilateral Joint
//
// **********************************************************************************************
NEWTON_API NewtonJoint* NewtonConstraintCreateUserJoint (const NewtonWorld* newtonWorld, int maxDOF, NewtonUserBilateralCallBack callback,
const NewtonBody* childBody, const NewtonBody* parentBody);
NEWTON_API void NewtonUserJointAddLinearRow (const NewtonJoint* joint, const dFloat *pivot0, const dFloat *pivot1, const dFloat *dir);
NEWTON_API void NewtonUserJointAddAngularRow (const NewtonJoint* joint, dFloat relativeAngle, const dFloat *dir);
NEWTON_API void NewtonUserJointAddGeneralRow (const NewtonJoint* joint, const dFloat *jacobian0, const dFloat *jacobian1);
NEWTON_API void NewtonUserJointSetRowMinimumFriction (const NewtonJoint* joint, dFloat friction);
NEWTON_API void NewtonUserJointSetRowMaximumFriction (const NewtonJoint* joint, dFloat friction);
NEWTON_API void NewtonUserJointSetRowAcceleration (const NewtonJoint* joint, dFloat acceleration);
NEWTON_API void NewtonUserJointSetRowSpringDamperAcceleration (const NewtonJoint* joint, dFloat springK, dFloat springD);
NEWTON_API void NewtonUserJointSetRowStiffness (const NewtonJoint* joint, dFloat stiffness);
NEWTON_API dFloat NewtonUserJointGetRowForce (const NewtonJoint* joint, int row);
// **********************************************************************************************
//
// Rag doll joint container functions
//
// **********************************************************************************************
NEWTON_API NewtonRagDoll* NewtonCreateRagDoll (const NewtonWorld* newtonWorld);
NEWTON_API void NewtonDestroyRagDoll (const NewtonWorld* newtonWorld, const NewtonRagDoll* ragDoll);
NEWTON_API void NewtonRagDollBegin (const NewtonRagDoll* ragDoll);
NEWTON_API void NewtonRagDollEnd (const NewtonRagDoll* ragDoll);
//NEWTON_API void NewtonRagDollSetFriction (const NewtonRagDoll* ragDoll, dFloat friction);
NEWTON_API NewtonRagDollBone* NewtonRagDollFindBone (const NewtonRagDoll* ragDoll, int id);
//NEWTON_API NewtonRagDollBone* NewtonRagDollGetRootBone (const NewtonRagDoll* ragDoll);
NEWTON_API void NewtonRagDollSetForceAndTorqueCallback (const NewtonRagDoll* ragDoll, NewtonApplyForceAndTorque callback);
NEWTON_API void NewtonRagDollSetTransformCallback (const NewtonRagDoll* ragDoll, NewtonSetRagDollTransform callback);
NEWTON_API NewtonRagDollBone* NewtonRagDollAddBone (const NewtonRagDoll* ragDoll, const NewtonRagDollBone* parent,
void *userData, dFloat mass, const dFloat* matrix,
const NewtonCollision* boneCollision, const dFloat* size);
NEWTON_API void* NewtonRagDollBoneGetUserData (const NewtonRagDollBone* bone);
NEWTON_API NewtonBody* NewtonRagDollBoneGetBody (const NewtonRagDollBone* bone);
NEWTON_API void NewtonRagDollBoneSetID (const NewtonRagDollBone* bone, int id);
NEWTON_API void NewtonRagDollBoneSetLimits (const NewtonRagDollBone* bone,
const dFloat* coneDir, dFloat minConeAngle, dFloat maxConeAngle, dFloat maxTwistAngle,
const dFloat* bilateralConeDir, dFloat negativeBilateralConeAngle, dFloat positiveBilateralConeAngle);
//NEWTON_API NewtonRagDollBone* NewtonRagDollBoneGetChild (const NewtonRagDollBone* bone);
//NEWTON_API NewtonRagDollBone* NewtonRagDollBoneGetSibling (const NewtonRagDollBone* bone);
//NEWTON_API NewtonRagDollBone* NewtonRagDollBoneGetParent (const NewtonRagDollBone* bone);
//NEWTON_API void NewtonRagDollBoneSetLocalMatrix (const NewtonRagDollBone* bone, dFloat* matrix);
//NEWTON_API void NewtonRagDollBoneSetGlobalMatrix (const NewtonRagDollBone* bone, dFloat* matrix);
NEWTON_API void NewtonRagDollBoneGetLocalMatrix (const NewtonRagDollBone* bone, dFloat* matrix);
NEWTON_API void NewtonRagDollBoneGetGlobalMatrix (const NewtonRagDollBone* bone, dFloat* matrix);
// **********************************************************************************************
//
// Vehicle joint functions
//
// **********************************************************************************************
NEWTON_API NewtonJoint* NewtonConstraintCreateVehicle (const NewtonWorld* newtonWorld, const dFloat* upDir, const NewtonBody* body);
NEWTON_API void NewtonVehicleReset (const NewtonJoint* vehicle);
NEWTON_API void NewtonVehicleSetTireCallback (const NewtonJoint* vehicle, NewtonVehicleTireUpdate update);
NEWTON_API void* NewtonVehicleAddTire (const NewtonJoint* vehicle, const dFloat* localMatrix, const dFloat* pin, dFloat mass, dFloat width, dFloat radius,
dFloat suspesionShock, dFloat suspesionSpring, dFloat suspesionLength, void* userData, int collisionID);
NEWTON_API void NewtonVehicleRemoveTire (const NewtonJoint* vehicle, void* tireId);
NEWTON_API void* NewtonVehicleGetFirstTireID (const NewtonJoint* vehicle);
NEWTON_API void* NewtonVehicleGetNextTireID (const NewtonJoint* vehicle, void* tireId);
NEWTON_API int NewtonVehicleTireIsAirBorne (const NewtonJoint* vehicle, void* tireId);
NEWTON_API int NewtonVehicleTireLostSideGrip (const NewtonJoint* vehicle, void* tireId);
NEWTON_API int NewtonVehicleTireLostTraction (const NewtonJoint* vehicle, void* tireId);
NEWTON_API void* NewtonVehicleGetTireUserData (const NewtonJoint* vehicle, void* tireId);
NEWTON_API dFloat NewtonVehicleGetTireOmega (const NewtonJoint* vehicle, void* tireId);
NEWTON_API dFloat NewtonVehicleGetTireNormalLoad (const NewtonJoint* vehicle, void* tireId);
NEWTON_API dFloat NewtonVehicleGetTireSteerAngle (const NewtonJoint* vehicle, void* tireId);
NEWTON_API dFloat NewtonVehicleGetTireLateralSpeed (const NewtonJoint* vehicle, void* tireId);
NEWTON_API dFloat NewtonVehicleGetTireLongitudinalSpeed (const NewtonJoint* vehicle, void* tireId);
NEWTON_API void NewtonVehicleGetTireMatrix (const NewtonJoint* vehicle, void* tireId, dFloat* matrix);
NEWTON_API void NewtonVehicleSetTireTorque (const NewtonJoint* vehicle, void* tireId, dFloat torque);
NEWTON_API void NewtonVehicleSetTireSteerAngle (const NewtonJoint* vehicle, void* tireId, dFloat angle);
NEWTON_API void NewtonVehicleSetTireMaxSideSleepSpeed (const NewtonJoint* vehicle, void* tireId, dFloat speed);
NEWTON_API void NewtonVehicleSetTireSideSleepCoeficient (const NewtonJoint* vehicle, void* tireId, dFloat coeficient);
NEWTON_API void NewtonVehicleSetTireMaxLongitudinalSlideSpeed (const NewtonJoint* vehicle, void* tireId, dFloat speed);
NEWTON_API void NewtonVehicleSetTireLongitudinalSlideCoeficient (const NewtonJoint* vehicle, void* tireId, dFloat coeficient);
NEWTON_API dFloat NewtonVehicleTireCalculateMaxBrakeAcceleration (const NewtonJoint* vehicle, void* tireId);
NEWTON_API void NewtonVehicleTireSetBrakeAcceleration (const NewtonJoint* vehicle, void* tireId, dFloat accelaration, dFloat torqueLimit);
#ifdef __cplusplus
}
#endif
#endif
Stable Version/1.3.3/README
1
2
3
4
5
6
7
8
9
10
11
12
13
Irrlicht Library Wrapper
Created by Nathan Adams
Version 1.3.3
Copyright (C) 2008
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
Please leave all files intact if you redistrubte this software.
How to use:
Add all the files to your Irrlicht project, you could compile it into a DLL if you wanted too, but for now just add all the files to your project.
Then inside your complier add the directory that you have the IrrLib files and use #include "IrrLib.h" to refrence it, and you are good to go!
Stable Version/1.3.3/_mouse.h
1
2
3
4
5
6
7
8
9
#ifndef __MOUSE_H
#define __MOUSE_H
struct _mouse {
int x;
int y;
};
#endif
Unstable Version/1.2.2b/CHANGES
1
2
3
4
5
Version 1.2
+ Added a Irr3DLib class that will control all 3D objects
+ Also Added a Irr2D class that works on the same concept.
+ IrrSphere is now owned by Irr3DLib
+ Updated the examples using the latest code
Unstable Version/1.2.2b/Irr2D.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include "IrrLib.h"
//#include "IrrSphere.h" //You probably aren't going to be using 3D objects in a 2D environment!
#include "Irr2D.h"
#include <irrlicht.h>
#include <strings.h>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
Irr2D::Irr2D(){
this->numTextures = 0;
}
Irr2D::~Irr2D(){
for(int i = 0; i < numTextures; ++i)
delete this->textures[i];
delete this->textures;
}
void Irr2D::SetSmgr(irr::scene::ISceneManager* smgr){
this->smgr = smgr;
Sprite.SetSmgr(smgr);
}
void Irr2D::SetDriver(irr::video::IVideoDriver* driver){
this->driver = driver;
Sprite.SetDriver(driver);
}
void Irr2D::LoadTexturemap(std::string file){
this->texturemap = driver->getTexture(file.c_str());
}
int Irr2D::LoadTexture(std::string file){
this->textures[this->numTextures] = driver->getTexture(file.c_str());
this->numTextures++;
return numTextures--;
}
Unstable Version/1.2.2b/Irr2D.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRR2D_H
#define IRR2D_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
#include "IrrLib.h"
#include "IrrSprite.h"
class Irr2D {
private:
irr::scene::ISceneManager* smgr;
irr::video::IVideoDriver* driver;
irr::video::ITexture* texturemap;
int numTextures;
irr::video::ITexture* textures[10];
public:
//Irr2D::Irr2D();
IrrSprite Sprite;
Irr2D::Irr2D();
Irr2D::~Irr2D();
void Irr2D::SetDriver(irr::video::IVideoDriver* driver);
void Irr2D::SetSmgr(irr::scene::ISceneManager* smgr);
void Irr2D::LoadTexturemap(std::string file);
int Irr2D::LoadTexture(std::string file);
void Irr2D::DrawImage(int texture, const irr::core::position2d<irr::s32> & destPos);
void Irr2D::DrawImage(const irr::core::position2d<irr::s32> & destPos, const irr::core::rect<irr::s32> & sourceRect, const irr::core::rect<irr::s32> * clipRect, irr::video::SColor color, bool useAlphaChannelOfTexture);
void Irr2D::DrawLine(const irr::core::position2d<irr::s32> & start, const irr::core::position2d<irr::s32> & end, irr::video::SColor color);
};
#endif
Unstable Version/1.2.2b/Irr3D.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <strings.h>
//#include "IrrLib.h"
//Libraries we create go here
#include "IrrSphere.h"
//#include "IrrColor.h"
#include "Irr3D.h"
#include <irrlicht.h>
//#include "Irr2D.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
void Irr3D::SetDriver(irr::video::IVideoDriver* driver)
{
this->driver = driver;
Sphere.SetDriver(driver);
}
void Irr3D::SetSmgr(irr::scene::ISceneManager* smgr)
{
this->smgr = smgr;
Sphere.SetSmgr(smgr);
}
Irr3D::Irr3D()
{
//do stuff here!
}
Irr3D::~Irr3D()
{
//delete stuff here!
}
Unstable Version/1.2.2b/Irr3D.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRR3D_H
#define IRR3D_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
#include "IrrSphere.h"
//#include "IrrColor.h"
//#include "Irr3D.h"
//#include "Irr2D.h" This is a 3D class not 2D
/* However due to Irrlciht's nature mixing 2D with 3D is possible */
//Start class
class Irr3D {
private:
irr::video::IVideoDriver* driver;
irr::scene::ISceneManager* smgr;
public:
IrrSphere Sphere;
Irr3D::Irr3D();
Irr3D::~Irr3D();
void Irr3D::SetDriver(irr::video::IVideoDriver* driver);
void Irr3D::SetSmgr(irr::scene::ISceneManager* smgr);
};
#endif
Unstable Version/1.2.2b/IrrColor.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <irrlicht.h>
#include <strings.h>
//#include "IrrLib.h"
#include "IrrColor.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
void IrrColor::test(){
//do nothing
}
SColor IrrColor::returnColor(std::string color){
int nColor = -1;
if (color == "red")
nColor = 1;
else if (color == "green")
nColor = 2;
else if (color == "blue")
nColor = 3;
else if (color == "dark green")
nColor = 4;
else if (color == "pink")
nColor = 5;
else if (color == "grey")
nColor = 6;
switch (nColor){
case 1:
return SColor(255, 255, 0, 0);
break;
case 2:
return SColor(255, 0, 255, 0);
break;
case 3:
return SColor(255, 0, 0, 255);
break;
case 4:
return SColor(255, 0, 50, 0);
break;
case 5:
return SColor(255, 255, 10, 255);
break;
case 6:
return SColor(255,200,200,200);
break;
default:
return SColor(255,200,200,200);
break;
}// TODO: Make this function modular
}
Unstable Version/1.2.2b/IrrColor.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRCOLOR_H
#define IRRCOLOR_H
#include <iostream>
#include <strings.h>
#include "irrlicht.h"
//#include "IrrLib.h"
class IrrColor {
private:
//who knows?
public:
void IrrColor::test();
irr::video::SColor IrrColor::returnColor(std::string color);
};
#endif
Unstable Version/1.2.2b/IrrEventReciever.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRREVENTRECIEVER_H
#define IRREVENTRECIEVER_H
#include <irrlicht.h>
class IrrEventReciever : public IEventReciever {
public:
virtual bool OnEvent(SEvent event) {
if (event.EventType == irr::EET_KEY_INPUT_EVENT) {
if (!event.KeyInput.PressedDown)
keyStates[event.KeyInput.Key] = true;
else
keyStates[event.KeyInput.Key] = false;
}
return false;
}
};
#endif
Unstable Version/1.2.2b/IrrLib.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <irrlicht.h>
#include <strings.h>
#include "IrrLib.h"
//Libraries we create go here
//#include "IrrSphere.h"
#include "IrrColor.h"
#include "Irr2D.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
//TODO: Create own class for handling inputs!
/*IrrLib::IrrLib(MastEventReceiver & receiver){
this->device = createDevice(EDT_SOFTWARE, dimension2d<s32>(640, 480), 16, false, false, false, &receiver);
if (this->device == 0)
exit(1);
IrrLib::Init();
}*/
IrrLib::IrrLib(){
this->device = createDevice(EDT_SOFTWARE, dimension2d<s32>(640, 480), 16, false, false, false, &irecv);
if (this->device == 0)
exit(1);
IrrLib::Init();
}
IrrLib::IrrLib(video::E_DRIVER_TYPE drivertype, core::dimension2d<s32> & res, u32 bits, bool fullscreen, bool stencilbuffer, bool vsync){
//MyEventReceiver receiver;
this->device = createDevice(drivertype, res, bits, fullscreen, stencilbuffer, vsync, &irecv);
if (this->device == 0)
exit(1);
IrrLib::Init();
}
IrrLib::IrrLib(int nDrivertype, int width, int height, int bits, bool fullscreen, bool stencilbuffer, bool vsync){
//MyEventReceiver receiver;
video::E_DRIVER_TYPE drivertype;
switch (nDrivertype){
case 0: //TODO: finish this switch case
drivertype = EDT_NULL;
break;
case 1:
drivertype = EDT_SOFTWARE;
break;
case 2:
drivertype = EDT_BURNINGSVIDEO;
break;
case 3:
drivertype = EDT_OPENGL;
break;
case 4:
drivertype = EDT_DIRECT3D8;
//*Note: It seems as Microsoft has stoped supporting DX 8.1, so you can not compile it into Irrlicht engine anymore
//TODO: Find how to detect if DX is complied into Irrlicht
//TODO: Find how to detecht for linux
break;
case 5:
drivertype = EDT_DIRECT3D9;
break;
default:
drivertype = EDT_SOFTWARE;
break;
}
this->device = createDevice(drivertype, dimension2d<s32>(width, height), bits, fullscreen, stencilbuffer, vsync, &irecv);
if (this->device == 0)
exit(1);
IrrLib::Init();
}
IrrLib::~IrrLib (){ //Our moms wont clean up after us!
//Although I'm sure Irrlicht does this for us already, its always a good idea to check!
/*if (this->device != NULL)
delete this->device;
if (this->driver != NULL)
delete this->driver;
if (this->smgr != NULL)
delete this->smgr;
if (this->mesh != NULL)
delete this->mesh;
if (this->node != NULL)
delete this->node;*/ //it seems Irrlicht picks up after us...
//however we created newNodes, now we need to delete it!
}
void IrrLib::Init(){
//this->numNodes = 0;
//this->nodeNew = new ISceneNode[10];
this->driver = this->device->getVideoDriver();
this->smgr = this->device->getSceneManager();
Irr3DLib.SetSmgr(this->smgr);
Irr3DLib.SetDriver(this->driver);
Irr2DLib.SetSmgr(this->smgr);
Irr2DLib.SetDriver(this->driver);
}
void IrrLib::ReadArchive(std::string file){
this->device->getFileSystem()->addZipFileArchive(file.c_str());
}
void IrrLib::LoadQ3Level(std::string q3level){
this->mesh = this->smgr->getMesh(q3level.c_str());
this->node = 0;
if (this->mesh)
this->node = this->smgr->addOctTreeSceneNode(this->mesh->getMesh(0), 0, -1, 128);
}
void IrrLib::MapPos(int x, int y, int z){
if (this->node)
this->node->setPosition(core::vector3df(x, y, z));
}
void IrrLib::MapPos(){
if (this->node)
this->node->setPosition(core::vector3df(0, 0, 0));
}
void IrrLib::AddFPSCam(){
this->cam = this->smgr->addCameraSceneNodeFPS();
}
void IrrLib::AddFPSCam(f32 x, f32 y, f32 z)
{
this->cam = this->smgr->addCameraSceneNodeFPS();
this->cam->setPosition(irr::core::vector3df(x, y, z));
}
void IrrLib::VisibleCursor(bool tf){
if (tf == false)
this->device->getCursorControl()->setVisible(false);
else
this->device->getCursorControl()->setVisible(true);
}
int IrrLib::GetFPSCount(){
return this->driver->getFPS();
}
bool IrrLib::DeviceIsRunning(){
return this->device->run();
}
bool IrrLib::IsActiveWindow(){
return this->device->isWindowActive();
}
void IrrLib::BeginScene(){
this->driver->beginScene(true, true, video::SColor(0,200,200,200));
}
void IrrLib::BeginScene(irr::video::SColor color){
this->driver->beginScene(true, true, color);
}
void IrrLib::BeginScene(bool usebackBuffer, bool usezBuffer, irr::video::SColor color){
this->driver->beginScene(usebackBuffer, usezBuffer, color);
}
void IrrLib::DrawAll(){
this->smgr->drawAll();
//this->device->getGUIEnvironment()->drawAll();
}
void IrrLib::EndScene(){
this->driver->endScene();
}
void IrrLib::SetWindowCaption(stringw str){
this->device->setWindowCaption(str.c_str());
}
irr::core::stringw IrrLib::GetDriverName(){
return this->driver->getName();
}
void IrrLib::EndIrrlicht(){
this->device->drop();
}
void IrrLib::KeyPress(char key){
this->key = key;
}
char IrrLib::KeyPressed(){
return key;
}
irr::f32 IrrLib::getX(){
return this->smgr->getActiveCamera()->getPosition().X;
}
irr::f32 IrrLib::getY(){
return this->smgr->getActiveCamera()->getPosition().Y;
}
irr::f32 IrrLib::getZ(){
return this->smgr->getActiveCamera()->getPosition().Z;
}
bool IrrLib::isKeyDown(EKEY_CODE key) {
return keyStates[key];
}
bool IrrLib::isKeyUp(EKEY_CODE key) {
return !keyStates[key];
}
Unstable Version/1.2.2b/IrrLib.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRLIB_H
#define IRRLIB_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
#include "Irr3D.h"
#include "IrrColor.h"
#include "Irr2D.h"
#include "IrrEventReciever.h"
IrrEventReciever irecv;
//Start class
class IrrLib {
private:
/* Create an Irrlicht device as private because the class should handle
All irrlicht interaction */
irr::IrrlichtDevice *device;
// Tells Irrlicht what driver to use
//video::E_DRIVER_TYPE driverType;
/*
Get a pointer to the video driver and the SceneManager so that
we do not always have to write device->getVideoDriver() and
device->getSceneManager().
*/
irr::video::IVideoDriver* driver;
irr::scene::ISceneManager* smgr;
/*
Get a pointer to the 'mesh' aka the level.
Note: This is for Quake3 levels, ie bsp maps.
*/
irr::scene::IAnimatedMesh* mesh;
irr::scene::ISceneNode* node;
irr::scene::ISceneNode * tempNode; //use this to store nodeNew's data so we can resize it
irr::scene::ICameraSceneNode * cam;
char key;
void IrrLib::Init();
/*friend class IrrColor;
friend class Irr2DLib;
friend class Sphere;*/
bool keyStates[KEY_KEY_CODES_COUNT];
public:
//IrrSphere Sphere; //This has to be public to be able to access the Sphere class
/* IrrSphere is now in Irr3D class */
//Prehaps put this into a IrrLib3D class?
Irr3D Irr3DLib;
IrrColor Color; //Color class...not much of a class but lets keep it OO
Irr2D Irr2DLib; //1/2 variable to be labeled like this due to variables not able to begin with a number
IrrLib::IrrLib();
//IrrLib::IrrLib(MastEventReceiver & receiver);
IrrLib::IrrLib(irr::video::E_DRIVER_TYPE drivertype, irr::core::dimension2d<irr::s32> & res, irr::u32 bits, bool fullscreen, bool stencilbuffer, bool vsync);
IrrLib::IrrLib(int drivertype, int width, int height, int bits, bool fullscreen, bool stencilbuffer, bool vsync);
IrrLib::~IrrLib(); //Our moms wont clean up after us!
void IrrLib::ReadArchive(std::string file);
void IrrLib::LoadQ3Level(std::string q3level);
void IrrLib::MapPos(int x, int y, int z); //I think this moves the actual camera?
void IrrLib::MapPos();
void IrrLib::AddFPSCam();
void IrrLib::AddFPSCam(irr::f32 x, irr::f32 y, irr::f32 z);
void IrrLib::VisibleCursor(bool tf);
int IrrLib::GetFPSCount();
bool IrrLib::DeviceIsRunning();
bool IrrLib::IsActiveWindow();
void IrrLib::BeginScene();
void IrrLib::BeginScene(irr::video::SColor color);
void IrrLib::BeginScene(bool usebackBuffer, bool usezBuffer, irr::video::SColor color);
//TODO: Add one more for human readable colors and hex colors!
void IrrLib::DrawAll();
void IrrLib::EndScene();
void IrrLib::SetWindowCaption(irr::core::stringw str);
irr::core::stringw IrrLib::GetDriverName();
//TODO: Make function to turn stringw to string and visa versa
void IrrLib::EndIrrlicht(); //Renamed from KillIrrlicht to EndIrrlicht
//TODO: Add logging
friend bool irecv::OnEvent(SEvent event);
bool isKeyDown(EKEY_CODE key);
bool isKeyUp(EKEY_CODE key);
irr::f32 getX();
irr::f32 getY();
irr::f32 getZ();
};
#endif
Unstable Version/1.2.2b/IrrSphere.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include "IrrLib.h"
#include "IrrSphere.h"
#include <irrlicht.h>
#include <strings.h>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
void IrrSphere::SetSmgr(irr::scene::ISceneManager* smgr){
this->smgr = smgr;
}
void IrrSphere::SetDriver(irr::video::IVideoDriver* driver){
this->driver = driver;
}
int IrrSphere::CreateNewSphereNode(int x, int y, int z, std::string texture, bool light){
//TODO: Resize after 10, and add 10 more to the mix!
this->nodeNew[this->numNodes] = this->smgr->addSphereSceneNode();
this->nodeNew[this->numNodes]->setPosition(core::vector3df(x,y,z));
this->nodeNew[this->numNodes]->setMaterialTexture(0, this->driver->getTexture(texture.c_str()));
this->nodeNew[this->numNodes]->setMaterialFlag(video::EMF_LIGHTING, light);
this->numNodes++;
return this->numNodes--;
/*this->node = this->smgr->addSphereSceneNode();
this->node->setPosition(core::vector3df(x,y,z));
this->node->setMaterialTexture(0, this->driver->getTexture(texture.c_str()));
this->node->setMaterialFlag(video::EMF_LIGHTING, light);*/
}
irr::core::vector3df IrrSphere::GetSphereVector(int sphere){
return this->nodeNew[sphere]->getPosition();
}
void IrrSphere::SetSphereVector(int sphere, irr::core::vector3df v){
this->nodeNew[sphere]->setPosition(v);
}
IrrSphere::IrrSphere(){
this->numNodes = 0;
}
IrrSphere::~IrrSphere(){
for(int i = 0; i < numNodes; ++i)
delete this->nodeNew[i];
delete this->nodeNew;
}
Unstable Version/1.2.2b/IrrSphere.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRSPHERE_H
#define IRRSPHERE_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
//#include "IrrLib.h"
class IrrSphere
{
private:
irr::scene::ISceneNode* nodeNew[10];
int numNodes;
irr::scene::ISceneManager* smgr;
irr::video::IVideoDriver* driver;
public:
void IrrSphere::SetDriver(irr::video::IVideoDriver* driver);
void IrrSphere::SetSmgr(irr::scene::ISceneManager* smgr);
int IrrSphere::CreateNewSphereNode(int x, int y, int z, std::string texture, bool light); //this is going to take my advanced C++ skillz!
irr::core::vector3df IrrSphere::GetSphereVector(int sphere);
void IrrSphere::SetSphereVector(int sphere, irr::core::vector3df v);
IrrSphere::IrrSphere();
//IrrSphere::IrrSphere(IrrLib*);
IrrSphere::~IrrSphere();
};
#endif
Unstable Version/1.2.2b/IrrSprite.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <irrlicht.h>
#include <strings.h>
#include "IrrLib.h"
//Libraries we create go here
#include "IrrSphere.h"
#include "IrrColor.h"
#include "Irr2D.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
IrrSprite::IrrSprite()
{
//do stuff
}
IrrSprite::~IrrSprite()
{
//delete stuff
}
void IrrSprite::SetDriver(irr::video::IVideoDriver* driver)
{
this->driver = driver;
}
void IrrSprite::SetSmgr(irr::scene::ISceneManager* smgr)
{
this->smgr = smgr;
}
Unstable Version/1.2.2b/IrrSprite.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRSPRITE_H
#define IRRSPRITE_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
#include "IrrSphere.h"
#include "IrrColor.h"
#include "Irr2D.h"
#include "IrrSprite.h"
//Start class
class IrrSprite {
private:
irr::video::IVideoDriver* driver;
irr::scene::ISceneManager* smgr;
public:
IrrSprite::IrrSprite();
IrrSprite::~IrrSprite();
void IrrSprite::SetDriver(irr::video::IVideoDriver* driver);
void IrrSprite::SetSmgr(irr::scene::ISceneManager* smgr);
// I forgot a semicolon here....and it wasn't compling
//Thats 1 bad thing about OOP if there is an error you don't know where the @#$@# the problem is!
};
#endif
Unstable Version/1.2.2b/README
1
2
3
4
5
6
7
8
9
10
11
12
13
Irrlicht Library Wrapper
Created by Nathan Adams
Version 1.2
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
Please leave all files intact if you redistrubte this software.
How to use:
Add all the files to your Irrlicht project, you could compile it into a DLL if you wanted too, but for now just add all the files to your project.
Then inside your complier add the directory that you have the IrrLib files and use #include "IrrLib.h" to refrence it, and you are good to go! test
Unstable Version/1.2.8/CHANGES
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
Version 1.2
+ Added a Irr3DLib class that will control all 3D objects
+ Also Added a Irr2D class that works on the same concept.
+ IrrSphere is now owned by Irr3DLib
+ Updated the examples using the latest code
Version 1.2.2
+ Added IrrEventReciever to handle all input
- Still under work
+ Fixed some misc coding bugs
+ Added template class
+ Added sprite class
+ Added GUI class
Version 1.2.3
+ IrrEventReciver now works as advertised
+ Baseclass is now being used
+ A couple somewhat-useful functions
+ int_to_string
+ stringw_to_stdstring
+ stdstring_to_stringw
+ GUI elements
+ Static text is working
+ Under construction for a data type class
Version 1.2.4
+ Implmented color codes accessiable through the class
+ IrrLib.Color.RED (ect)
Version 1.2.5
+ Implmented mouse events
+ IrrLib.IrrEvent.getMouseX();
+ IrrLib.IrrEvent.getMouseY();
+ Using vectors instead of static arrays
+ Side note: Was going to use dynamic arrays, but C++ has vectors which are 10x better.
+ Added a default exit for when you hit esc
+ Use IrrLib.IrrEvent.SetEscExit(false) to turn that off for your software
+ Use IrrLib.IrrEvent.SetEscExit(true) to turn it back on
+ Every stable version will now include a windows DLL.
+ Possible Linux .so file in the future.
Version 1.2.6
+ Added a IrrEvent for buttons
+ IrrLib.IrrEvent.checkButtonState();
+ See example for use
+ Added an AddButton function
+ IrrLib.GUI.AddButton(..);
+ See example for use
+ Problems with making the DLL
+ reasearching
Version 1.2.7
+ Fixed DLL Problem
+ Added an enum example to example 1
+ Added more examples
+ Added example 9
+ Added left click handling (see example 9)
+ Added AddLines function to Irr2D
+ DrawLines function in Irr2D will draw the lines you add
Unstable Version/1.2.8/CREDITS
1
2
3
4
5
6
7
IrrLib
Created by
Nathan Adams
Denzel Morris
From #irrlicht
Acid
Unstable Version/1.2.8/Irr2D.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
//#include "IrrLib.h"
//#include "IrrSphere.h" //You probably aren't going to be using 3D objects in a 2D environment!
#include <irrlicht.h>
#include <strings.h>
#include "Irr2D.h"
#include "IrrSprite.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
Irr2D::Irr2D(){
this->numTextures = 0;
this->numLines = 0;
//NA Should we set textures to new
}
Irr2D::~Irr2D(){
/*for(int i = 0; i < numTextures; ++i)
delete this->textures[i];
delete this->textures;*/
//No more dynamic memory business yay! NA
}
void Irr2D::SetSmgr(irr::scene::ISceneManager* smgr){
this->smgr = smgr;
Sprite.SetSmgr(smgr);
}
void Irr2D::SetDriver(irr::video::IVideoDriver* driver){
this->driver = driver;
Sprite.SetDriver(driver);
}
void Irr2D::LoadTexturemap(std::string file){
this->texturemap = driver->getTexture(file.c_str());
}
int Irr2D::LoadTexture(std::string file){
//this->textures[this->numTextures] = driver->getTexture(file.c_str());
textures.push_back(driver->getTexture(file.c_str()));
this->numTextures++;
return numTextures--;
}
void Irr2D::DrawLine(irr::core::position2d<irr::s32>& start, irr::core::position2d<irr::s32>& end, irr::video::SColor& color)
{
this->driver->draw2DLine(start, end, color);
}
void Irr2D::AddLines(irr::core::position2d<irr::s32>& start, irr::core::position2d<irr::s32>& end, irr::video::SColor& color)
{
this->start.push_back(start);
this->end.push_back(end);
this->color.push_back(color);
this->numLines++;
}
void Irr2D::DrawLines()
{
for(int i = 0; i < numLines; ++i)
this->driver->draw2DLine(this->start[i], this->end[i], this->color[i]);
}
Unstable Version/1.2.8/Irr2D.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRR2D_H
#define IRR2D_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
#include <vector>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
//#include "IrrLib.h"
#include "IrrSprite.h"
class Irr2D {
private:
irr::scene::ISceneManager* smgr;
irr::video::IVideoDriver* driver;
irr::video::ITexture* texturemap;
int numTextures;
//irr::video::ITexture* textures[10];
std::vector<irr::video::ITexture*> textures;
std::vector<irr::core::position2d<irr::s32> > start;
std::vector<irr::core::position2d<irr::s32> > end;
std::vector<irr::video::SColor> color;
int numLines;
public:
//Irr2D::Irr2D();
IrrSprite Sprite;
Irr2D::Irr2D();
Irr2D::~Irr2D();
void Irr2D::SetDriver(irr::video::IVideoDriver* driver);
void Irr2D::SetSmgr(irr::scene::ISceneManager* smgr);
void Irr2D::LoadTexturemap(std::string file);
int Irr2D::LoadTexture(std::string file);
void Irr2D::DrawImage(int texture, const irr::core::position2d<irr::s32> & destPos);
void Irr2D::DrawImage(const irr::core::position2d<irr::s32> & destPos, const irr::core::rect<irr::s32> & sourceRect, const irr::core::rect<irr::s32> * clipRect, irr::video::SColor color, bool useAlphaChannelOfTexture);
void Irr2D::DrawLine(irr::core::position2d<irr::s32>& start, irr::core::position2d<irr::s32>& end, irr::video::SColor& color);
void Irr2D::DrawLines();
void Irr2D::AddLines(irr::core::position2d<irr::s32>& start, irr::core::position2d<irr::s32>& end, irr::video::SColor& color);
};
#endif
Unstable Version/1.2.8/Irr3D.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <strings.h>
//#include "IrrLib.h"
//Libraries we create go here
#include "IrrSphere.h"
//#include "IrrColor.h"
#include "Irr3D.h"
#include <irrlicht.h>
//#include "Irr2D.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
void Irr3D::SetDriver(irr::video::IVideoDriver* driver) //so much for copying and pasting code from the header file
{
this->driver = driver;
Sphere.SetDriver(driver);
}
void Irr3D::SetSmgr(irr::scene::ISceneManager* smgr)
{
this->smgr = smgr;
Sphere.SetSmgr(smgr);
}
Irr3D::Irr3D()
{
//do stuff here!
}
Irr3D::~Irr3D()
{
//delete stuff here!
}
Unstable Version/1.2.8/Irr3D.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRR3D_H
#define IRR3D_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
#include "IrrSphere.h"
//#include "IrrColor.h"
//#include "Irr3D.h"
//#include "Irr2D.h" This is a 3D class not 2D
/* However due to Irrlciht's nature mixing 2D with 3D is possible */
//Start class
class Irr3D {
private:
irr::video::IVideoDriver* driver;
irr::scene::ISceneManager* smgr;
public:
IrrSphere Sphere;
Irr3D::Irr3D();
Irr3D::~Irr3D();
void Irr3D::SetDriver(irr::video::IVideoDriver* driver);
void Irr3D::SetSmgr(irr::scene::ISceneManager* smgr);
};
#endif
Unstable Version/1.2.8/IrrColor.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <irrlicht.h>
#include <strings.h>
//#include "IrrLib.h"
#include "IrrColor.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
void IrrColor::Init(){
/*SColor * temp;
temp = new SColor(alpha, 255, 0, 0);
this->RED = temp;
delete temp;*/
this->RED = SColor(alpha, 255, 0, 0);
this->ORANGE = SColor(alpha, 255, 165, 0);
this->YELLOW = SColor(alpha, 255, 255, 0);
this->GREEN = SColor(alpha, 0, 255, 0);
this->BLUE = SColor(alpha, 0, 0, 255);
this->DARK_GREEN = SColor(alpha, 0, 100, 0);
this->PINK = SColor(alpha, 255, 192, 203);
this->GREY = SColor(alpha, 190, 190, 190);
}
IrrColor::~IrrColor(){
//delete this->RED;
}
IrrColor::IrrColor(){
this->alpha = 255;
Init();
}
IrrColor::IrrColor(irr::u32 alpha){
this->alpha = alpha;
Init();
}
int IrrColor::getAlpha(){
return this->alpha;
}
void IrrColor::setAlpha(int alpha){
this->alpha = alpha;
}
SColor IrrColor::returnColor(std::string color){
int nColor = -1;
if (color == "red")
nColor = 1;
else if (color == "green")
nColor = 2;
else if (color == "blue")
nColor = 3;
else if (color == "dark green")
nColor = 4;
else if (color == "pink")
nColor = 5;
else if (color == "grey")
nColor = 6;
switch (nColor){
case 1:
return SColor(255, 255, 0, 0);
break;
case 2:
return SColor(255, 0, 255, 0);
break;
case 3:
return SColor(255, 0, 0, 255);
break;
case 4:
return SColor(255, 0, 50, 0);
break;
case 5:
return SColor(255, 255, 10, 255);
break;
case 6:
return SColor(255,200,200,200);
break;
default:
return SColor(255,200,200,200);
break;
}// TODO: Make this function modular
}
Unstable Version/1.2.8/IrrColor.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRCOLOR_H
#define IRRCOLOR_H
#include <iostream>
#include <strings.h>
#include "irrlicht.h"
//#include "IrrLib.h"
class IrrColor {
private:
irr::u32 alpha;
void Init();
//who knows?
public:
//irr::video::SColor(alpha, 255, 0, 0);
irr::video::SColor RED;
irr::video::SColor ORANGE;
irr::video::SColor YELLOW;
irr::video::SColor GREEN;
irr::video::SColor BLUE;
irr::video::SColor DARK_GREEN;
irr::video::SColor PINK;
irr::video::SColor GREY;
/*const ORANGE = irr::video::SColor(alpha, 255, 165, 0);
const YELLOW = irr::video::SColor(alpha, 255, 255, 0);
const GREEN = irr::video::SColor(alpha, 0, 255, 0);
const BLUE = irr::video::SColor(alpha, 0, 0, 255);
const DARK_GREEN = irr::video::SColor(alpha, 0, 100, 0);
const PINK = irr::video::SColor(alpha, 255, 192, 203);
const GREY = irr::video::Scolor(alpha, 190, 190, 190);*/
//void IrrColor::test();
IrrColor();
IrrColor(irr::u32 alpha);
~IrrColor();
int getAlpha();
void setAlpha(int alpha);
irr::video::SColor IrrColor::returnColor(std::string color);
};
#endif
Unstable Version/1.2.8/IrrEventReciever.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include "IrrEventReciever.h"
//#include "IrrLib.h"
#include <irrlicht.h>
#include <iostream>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
/*void IrrEventReciever::setIrrLib(IrrLib& IrrLib)
{
this.callingIrrLib = IrrLib;
}*/
IrrEventReciever::IrrEventReciever()
{
this->escexit = true;
this->mouse.x = 0;
this->mouse.y = 0;
}
bool IrrEventReciever::OnEvent(SEvent event)
{
// A button was clicked
if (event.EventType == irr::EET_GUI_EVENT)
{
switch(event.GUIEvent.EventType){
case EGET_BUTTON_CLICKED:
s32 id = event.GUIEvent.Caller->getID();
//cout << id << endl;
buttonStates.push_back(id);
break;
default:
break;
}
}
/*if (event.EventType == irr::EGET_SCROLL_BAR_CHANGED)
{
}*/
if (event.EventType == irr::EET_KEY_INPUT_EVENT) {
if (!event.KeyInput.PressedDown){
this->keyStates[event.KeyInput.Key] = false;
//cout << "Key was not hit " << this->keyStates[event.KeyInput.Key] << endl;
}
else{
if(event.KeyInput.Key == KEY_ESCAPE && escexit)
this->device->closeDevice();
this->keyStates[event.KeyInput.Key] = true;
//cout << "Key was hit: " << event.KeyInput.Key << " " << this->keyStates[event.KeyInput.Key] << endl;
}
}
if (event.EventType == EET_MOUSE_INPUT_EVENT){
if (event.MouseInput.Event == EMIE_MOUSE_MOVED){
this->mouse.x = event.MouseInput.X;
this->mouse.y = event.MouseInput.Y;
}
if (event.MouseInput.Event == EMIE_LMOUSE_PRESSED_DOWN)
this->mouseStates[0] = true;
if (event.MouseInput.Event == EMIE_LMOUSE_LEFT_UP)
this->mouseStates[0] = false;
}
return false;
}
void IrrEventReciever::SetEscExit(bool onoff)
{
this->escexit = onoff;
}
int IrrEventReciever::getMouseX()
{
return this->mouse.x;
}
int IrrEventReciever::getMouseY()
{
return this->mouse.y;
}
int IrrEventReciever::getButtonState()
{
if(!this->buttonStates.empty()){
int id;
id = buttonStates.back();
this->buttonStates.pop_back();
return id;
}
else
return -1;
}
int IrrEventReciever::getRevButtonState()
{
if(!this->buttonStates.empty()){
int id = buttonStates.front();
this->buttonStates.erase(buttonStates.begin());
return id;
}
else
return -1;
}
void IrrEventReciever::clearButtonState()
{
this->buttonStates.clear();
}
int IrrEventReciever::checkButtonState()
{
if(!this->buttonStates.empty())
return this->buttonStates.back();
else
return -1;
}
void IrrEventReciever::delLastButtonStat()
{
if(!this->buttonStates.empty())
this->buttonStates.pop_back();
}
bool IrrEventReciever::isButtonStateEmpty()
{
return this->buttonStates.empty();
}
Unstable Version/1.2.8/IrrEventReciever.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRREVENTRECIEVER_H
#define IRREVENTRECIEVER_H
//#include "IrrLib.h"
#include <vector>
#include <irrlicht.h>
#include "IrrLibBase.h"
struct _mouse {
int x;
int y;
};
class IrrEventReciever : public irr::IEventReceiver, public IrrLibBase
{
private:
//IrrLib callingIrrLib;
_mouse mouse;
bool escexit;
std::vector<int> buttonStates;
public:
bool mouseStates[1];
IrrEventReciever();
int getMouseX();
int getMouseY();
bool keyStates[irr::KEY_KEY_CODES_COUNT];
//void setIrrLib(IrrLib& IrrLib)
virtual bool OnEvent(irr::SEvent event);
void SetEscExit(bool onoff);
int getButtonState();
int getRevButtonState();
void clearButtonState();
int checkButtonState();
void delLastButtonStat();
bool isButtonStateEmpty(); //is there still stuff in the vector to be done? NA
};
#endif
Unstable Version/1.2.8/IrrLib.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <irrlicht.h>
#include <strings.h>
#include <sstream>
#include <time.h>
#include "IrrLib.h"
//Libraries we create go here
//#include "IrrSphere.h"
#include "IrrColor.h"
//#include "Irr2D.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
//TODO: Create own class for handling inputs!
/*IrrLib::IrrLib(MastEventReceiver & receiver){
this->device = createDevice(EDT_SOFTWARE, dimension2d<s32>(640, 480), 16, false, false, false, &receiver);
if (this->device == 0)
exit(1);
IrrLib::Init();
}*/
IrrLib::IrrLib(){
this->device = createDevice(EDT_SOFTWARE, dimension2d<s32>(640, 480), 16, false, false, false, &this->IrrEvent);
if (this->device == 0)
exit(1);
IrrLib::Init();
}
IrrLib::IrrLib(video::E_DRIVER_TYPE drivertype, core::dimension2d<s32> & res, u32 bits, bool fullscreen, bool stencilbuffer, bool vsync){
//MyEventReceiver receiver;
this->device = createDevice(drivertype, res, bits, fullscreen, stencilbuffer, vsync, &this->IrrEvent);
if (this->device == 0)
exit(1);
IrrLib::Init();
}
IrrLib::IrrLib(int nDrivertype, int width, int height, int bits, bool fullscreen, bool stencilbuffer, bool vsync){
//MyEventReceiver receiver;
video::E_DRIVER_TYPE drivertype;
switch (nDrivertype){
case 0: //TODO: finish this switch case
drivertype = EDT_NULL;
break;
case 1:
drivertype = EDT_SOFTWARE;
break;
case 2:
drivertype = EDT_BURNINGSVIDEO;
break;
case 3:
drivertype = EDT_OPENGL;
break;
case 4:
drivertype = EDT_DIRECT3D8;
//*Note: It seems as Microsoft has stoped supporting DX 8.1, so you can not compile it into Irrlicht engine anymore
//TODO: Find how to detect if DX is complied into Irrlicht
//TODO: Find how to detecht for linux
break;
case 5:
drivertype = EDT_DIRECT3D9;
break;
default:
drivertype = EDT_SOFTWARE;
break;
}
this->device = createDevice(drivertype, dimension2d<s32>(width, height), bits, fullscreen, stencilbuffer, vsync, &this->IrrEvent);
if (this->device == 0)
exit(1);
IrrLib::Init();
}
IrrLib::~IrrLib (){ //Our moms wont clean up after us!
//Although I'm sure Irrlicht does this for us already, its always a good idea to check!
/*if (this->device != NULL)
delete this->device;
if (this->driver != NULL)
delete this->driver;
if (this->smgr != NULL)
delete this->smgr;
if (this->mesh != NULL)
delete this->mesh;
if (this->node != NULL)
delete this->node;*/ //it seems Irrlicht picks up after us...
//however we created newNodes, now we need to delete it!
}
void IrrLib::Init(){
//this->numNodes = 0;
//this->nodeNew = new ISceneNode[10];
//this->env->addStaticText(L"Transparent Control:", rect<s32>(20,30,300,80), true);
this->env = this->device->getGUIEnvironment();
this->driver = this->device->getVideoDriver();
this->smgr = this->device->getSceneManager();
Irr3DLib.SetSmgr(this->smgr);
Irr3DLib.SetDriver(this->driver);
Irr2DLib.SetSmgr(this->smgr);
Irr2DLib.SetDriver(this->driver);
GUI.SetEnv(this->env);
IrrEvent.SetDevice(this->device);
this->timer = this->device->getTimer();
tick = this->timer->getRealTime();
}
void IrrLib::ReadArchive(std::string file){
this->device->getFileSystem()->addZipFileArchive(file.c_str());
}
void IrrLib::LoadQ3Level(std::string q3level){
this->mesh = this->smgr->getMesh(q3level.c_str());
this->node = 0;
if (this->mesh)
this->node = this->smgr->addOctTreeSceneNode(this->mesh->getMesh(0), 0, -1, 128);
}
void IrrLib::MapPos(int x, int y, int z){
if (this->node)
this->node->setPosition(core::vector3df(x, y, z));
}
void IrrLib::MapPos(){
if (this->node)
this->node->setPosition(core::vector3df(0, 0, 0));
}
void IrrLib::AddFPSCam(){
this->cam = this->smgr->addCameraSceneNodeFPS();
}
void IrrLib::AddFPSCam(f32 x, f32 y, f32 z)
{
this->cam = this->smgr->addCameraSceneNodeFPS();
this->cam->setPosition(irr::core::vector3df(x, y, z));
}
void IrrLib::VisibleCursor(bool tf){
if (tf == false)
this->device->getCursorControl()->setVisible(false);
else
this->device->getCursorControl()->setVisible(true);
}
int IrrLib::GetFPSCount(){
return this->driver->getFPS();
}
bool IrrLib::DeviceIsRunning(){
return this->device->run();
}
bool IrrLib::IsActiveWindow(){
return this->device->isWindowActive();
}
void IrrLib::BeginScene(){
this->driver->beginScene(true, true, video::SColor(0,200,200,200));
}
void IrrLib::BeginScene(irr::video::SColor color){
this->driver->beginScene(true, true, color);
}
void IrrLib::BeginScene(bool usebackBuffer, bool usezBuffer, irr::video::SColor color){
this->driver->beginScene(usebackBuffer, usezBuffer, color);
}
void IrrLib::DrawAll(){
//position2d<int> start(50, 50);
//position2d<int> end(100,100);
// SColor whitecolor(255,255,255,255);
//driver->draw2DLine(start, end, whitecolor);
this->smgr->drawAll();
this->env->drawAll();
//this->device->getGUIEnvironment()->drawAll();
}
void IrrLib::EndScene(){
this->driver->endScene();
}
void IrrLib::SetWindowCaption(stringw str){
this->device->setWindowCaption(str.c_str());
}
irr::core::stringw IrrLib::GetDriverName(){
return this->driver->getName();
}
void IrrLib::EndIrrlicht(){
if(this->device != NULL){
this->device->drop();
this->device = NULL;
}
}
void IrrLib::KeyPress(char key){
this->key = key;
}
char IrrLib::KeyPressed(){
return key;
}
irr::f32 IrrLib::getX(){
return this->smgr->getActiveCamera()->getPosition().X;
}
irr::f32 IrrLib::getY(){
return this->smgr->getActiveCamera()->getPosition().Y;
}
irr::f32 IrrLib::getZ(){
return this->smgr->getActiveCamera()->getPosition().Z;
}
bool IrrLib::CheckGameLoop(){
u32 now;
now = this->timer->getRealTime();
if ((now - this->tick) >= 30){
//this->tick == time (NULL);
return true;
} else {
return false;
}
}
bool IrrLib::CheckGameLoop(u32 ms){
u32 now;
now = this->timer->getRealTime();
if ((now - this->tick) >= ms){
this->tick = now;
return true;
} else {
return false;
}
}
void IrrLib::Exit()
{
this->device->closeDevice();
}
dimension2d<s32> IrrLib::GetScreenSize()
{
return this->driver->getScreenSize();
/*pixels returnres;
returnres.width = screenres.Width;
returnres.height = screenres.Height;
return returnres;*/
}
//template <class T> std::string IrrLib::to_string (T t)
/*std::string IrrLib::int_to_string (int t)
{
std::stringstream ss;
ss << t;
return ss.str();
}*/
// This is in the base class now, every class that decends from that class has this ability.
Unstable Version/1.2.8/IrrLib.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRLIB_H
#define IRRLIB_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
#include <irrlicht.h>
#include <time.h>
/* We have to include Irrlichts libs */
#include "Irr3D.h"
#include "IrrColor.h"
#include "IrrLibGUI.h"
#include "IrrEventReciever.h"
#include "Irr2D.h"
#include "IrrLibBase.h"
//Start class
class IrrLib: public IrrLibBase {
private:
/* Create an Irrlicht device as private because the class should handle
All irrlicht interaction */
irr::IrrlichtDevice *device;
// Tells Irrlicht what driver to use
//video::E_DRIVER_TYPE driverType;
/*
Get a pointer to the video driver and the SceneManager so that
we do not always have to write device->getVideoDriver() and
device->getSceneManager().
*/
irr::video::IVideoDriver* driver;
irr::scene::ISceneManager* smgr;
irr::gui::IGUIEnvironment* env;
/*
Get a pointer to the 'mesh' aka the level.
Note: This is for Quake3 levels, ie bsp maps.
*/
irr::scene::IAnimatedMesh* mesh;
irr::scene::ISceneNode* node;
irr::scene::ISceneNode * tempNode; //use this to store nodeNew's data so we can resize it
irr::scene::ICameraSceneNode * cam;
char key;
void IrrLib::Init();
/*friend class IrrColor;
friend class Irr2DLib;
friend class Sphere;*/
friend class IrrEventReciever;
irr::u32 tick;
irr::ITimer* timer;
public:
//IrrSphere Sphere; //This has to be public to be able to access the Sphere class
/* IrrSphere is now in Irr3D class */
//Prehaps put this into a IrrLib3D class?
Irr3D Irr3DLib;
IrrColor Color; //Color class...not much of a class but lets keep it OO
Irr2D Irr2DLib; //1/2 variable to be labeled like this due to variables not able to begin with a number
IrrLibGUI GUI;
IrrEventReciever IrrEvent;
IrrLib::IrrLib();
//IrrLib::IrrLib(MastEventReceiver & receiver);
IrrLib::IrrLib(irr::video::E_DRIVER_TYPE drivertype, irr::core::dimension2d<irr::s32> & res, irr::u32 bits, bool fullscreen, bool stencilbuffer, bool vsync);
IrrLib::IrrLib(int drivertype, int width, int height, int bits, bool fullscreen, bool stencilbuffer, bool vsync);
IrrLib::~IrrLib(); //Our moms wont clean up after us!
void IrrLib::ReadArchive(std::string file);
void IrrLib::LoadQ3Level(std::string q3level);
void IrrLib::MapPos(int x, int y, int z); //I think this moves the actual camera?
void IrrLib::MapPos();
void IrrLib::AddFPSCam();
void IrrLib::AddFPSCam(irr::f32 x, irr::f32 y, irr::f32 z);
void IrrLib::VisibleCursor(bool tf);
int IrrLib::GetFPSCount();
bool IrrLib::DeviceIsRunning();
bool IrrLib::IsActiveWindow();
void IrrLib::BeginScene();
void IrrLib::BeginScene(irr::video::SColor color);
//void IrrLib::BeginScene(irr::video::SColor * color);
void IrrLib::BeginScene(bool usebackBuffer, bool usezBuffer, irr::video::SColor color);
//TODO: Add one more for human readable colors and hex colors!
void IrrLib::DrawAll();
void IrrLib::EndScene();
void IrrLib::SetWindowCaption(irr::core::stringw str);
irr::core::stringw IrrLib::GetDriverName();
//TODO: Make function to turn stringw to string and visa versa
void IrrLib::EndIrrlicht(); //Renamed from KillIrrlicht to EndIrrlicht
//TODO: Add logging
void IrrLib::KeyPress(char key);
char IrrLib::KeyPressed();
irr::f32 getX();
irr::f32 getY();
irr::f32 getZ();
bool CheckGameLoop();
bool CheckGameLoop(irr::u32 ms);
void Exit();
irr::core::dimension2d<irr::s32> GetScreenSize();
//void EndGameLoop();
//template <class T> std::string to_string (T t);
};
#endif
Unstable Version/1.2.8/IrrLibBase.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <irrlicht.h>
#include "IrrLibBase.h"
#include <strings.h>
#include <sstream>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
void IrrLibBase::SetDriver(IVideoDriver* driver) //can be overloaded
{
this->driver = driver;
}
void IrrLibBase::SetSmgr(ISceneManager* smgr)
{
this->smgr = smgr;
}
std::string IrrLibBase::int_to_string (int t)
{
std::stringstream ss;
ss << t;
return ss.str();
}
std::string IrrLibBase::stringw_to_stdstring(irr::core::stringw sw)
{
std::stringstream ss;
ss << sw.c_str();
return ss.str();
}
irr::core::stringw IrrLibBase::stdstring_to_stringw(std::string ss)
{
stringw tmpw(ss.c_str());
return tmpw;
}
void IrrLibBase::SetDevice(irr::IrrlichtDevice *device)
{
this->device = device;
}
void IrrLibBase::init()
{
}
Unstable Version/1.2.8/IrrLibBase.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRLIBBASE_H
#define IRRLIBBASE_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
class IrrLibBase {
protected:
irr::video::IVideoDriver* driver;
irr::scene::ISceneManager* smgr;
irr::IrrlichtDevice *device;
public:
struct pixels {
int width;
int height;
}; //possible future use in 2D objects when specifying the properties of an object draw
void IrrLibBase::SetDriver(irr::video::IVideoDriver* driver);
void IrrLibBase::SetSmgr(irr::scene::ISceneManager* smgr);
void SetDevice(irr::IrrlichtDevice *device);
std::string int_to_string (int t);
std::string stringw_to_stdstring(irr::core::stringw sw);
irr::core::stringw stdstring_to_stringw(std::string ss);
void init();
};
#endif
Unstable Version/1.2.8/IrrLibGUI.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <strings.h>
#include <irrlicht.h>
#include <vector>
#include "IrrLibGUI.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
IrrLibGUI::IrrLibGUI()
{
//NA does it need to do anything at init?
this->nStaticText = 0;
this->nButton = 0;
this->nButtonid = 100;
this->nListBoxid = 200;
this->nListBox = 0;
//this->arrStaticText = new IGUIStaticText[10];
//this->env = this->device->getGUIEnvironment(); //NA yes we do!
}
IrrLibGUI::~IrrLibGUI()
{
//NA Do we have to delete anything?
}
void IrrLibGUI::SetEnv(IGUIEnvironment* env)
{
this->env = env;
//env->addButton(rect<s32>(10,210,110,210 + 32), 0, 109, L"Quit", L"Exits Program");
}
int IrrLibGUI::addButton(const core::rect< s32 > & rectangle, IGUIElement *parent, s32 id, const wchar_t * text, const wchar_t * tooltiptext)
{
arrButton.push_back(this->env->addButton(rectangle, parent, id, text, tooltiptext));
++nButton;
++nButtonid;
return nButtonid - 1;
}
int IrrLibGUI::addListBox(const irr::core::rect< irr::s32 > &rectangle, IGUIElement * parent)
{
arrListBox.push_back(this->env->addListBox(rectangle, parent, nListBoxid));
++nListBox;
++nListBoxid;
return nListBox - 1;
}
int IrrLibGUI::AddListBox(int x1, int y1, int x2, int y2, IGUIElement * parent)
{
return addListBox(rect<s32>(x1, y1, x2, y2), parent);
}
int IrrLibGUI::AddListBox(const irr::core::rect< irr::s32 > &rectangle, IGUIElement * parent)
{
return addListBox(rectangle, parent);
}
void IrrLibGUI::AddStringToListBox(int nLbox, std::string text)
{
//this->arrListBox[nLbox]->addItem(stdstring_to_stringw(text).c_str());
this->arrListBox[0]->addItem(L"TEST");
}
void IrrLibGUI::Clear()
{
this->env->clear();
}
void IrrLibGUI::DrawAll()
{
this->env->drawAll();
}
int IrrLibGUI::AddToStaticArray(irr::gui::IGUIStaticText * addme)
{
//arrStaticText[nStaticText] = addme;
arrStaticText.push_back(addme);
this->nStaticText++;
this->nButtonid++;
return this->nStaticText;
}
void IrrLibGUI::AddStaticText()
{
//rect<s32>(20,30,300,80),
this->env->addStaticText(L"Powered by IrrLib.", rect<s32>(20,30,300,80), true);
}
int IrrLibGUI::AddStaticText(std::string message)
{
irr::gui::IGUIStaticText * addthis;
stringw tmpw(message.c_str());
addthis = this->env->addStaticText(tmpw.c_str(), rect<s32>(20,30,300,80), true);
return AddToStaticArray(addthis);
}
int IrrLibGUI::AddStaticText(std::string message, int x1, int y1, int x2, int y2)
{
irr::gui::IGUIStaticText * addthis;
stringw tmpw(message.c_str());
addthis = this->env->addStaticText(tmpw.c_str(), rect<s32>(x1,y1,x2,y2), true);
return AddToStaticArray(addthis);
}
int IrrLibGUI::AddStaticText(std::string message, int x1, int y1, int x2, int y2, bool border, bool wordwrap)
{
irr::gui::IGUIStaticText * addthis;
stringw tmpw(message.c_str());
addthis = this->env->addStaticText(tmpw.c_str(), rect<s32>(x1,y1,x2,y2), border, wordwrap);
return AddToStaticArray(addthis);
}
int IrrLibGUI::AddStaticText(std::string message, int x1, int y1, int x2, int y2, bool border, bool wordwrap, int id, bool fillbackground)
{
irr::gui::IGUIStaticText * addthis;
stringw tmpw(message.c_str());
addthis = this->env->addStaticText(tmpw.c_str(), rect<s32>(x1,y1,x2,y2), border, wordwrap, 0, id, fillbackground);
return AddToStaticArray(addthis);
}
int IrrLibGUI::AddStaticText(std::string message, const core::rect< s32 > &rectangle)
{
irr::gui::IGUIStaticText * addthis;
stringw tmpw(message.c_str());
addthis = this->env->addStaticText(tmpw.c_str(), rectangle);
return AddToStaticArray(addthis);
}
int IrrLibGUI::AddStaticText(std::string message, const core::rect< s32 > &rectangle, bool border, bool wordwrap)
{
irr::gui::IGUIStaticText * addthis;
stringw tmpw(message.c_str());
addthis = this->env->addStaticText(tmpw.c_str(), rectangle, border, wordwrap);
return AddToStaticArray(addthis);
}
int IrrLibGUI::AddStaticText(std::string message, const core::rect< s32 > &rectangle, bool border, bool wordwrap, int id, bool fillbackground)
{
irr::gui::IGUIStaticText * addthis;
stringw tmpw(message.c_str());
addthis = this->env->addStaticText(tmpw.c_str(), rectangle, border, wordwrap, 0, id, fillbackground);
return AddToStaticArray(addthis);
}
void IrrLibGUI::ChangeStaticText(int nstatictext, std::string message)
{
stringw tmpw(message.c_str());
this->arrStaticText[this->nStaticText-1]->setText(tmpw.c_str());
}
void IrrLibGUI::ChangeFont(std::string fontfile)
{
IGUISkin* skin = this->env->getSkin();
IGUIFont* font = this->env->getFont(fontfile.c_str());
if (font)
skin->setFont(font);
}
int IrrLibGUI::AddButton(std::string text, int x1, int y1, int x2, int y2, std::string tooltiptext = "")
{
return addButton(rect<s32>(x1, y1, x2, y2), 0, nButtonid, stdstring_to_stringw(text).c_str(), stdstring_to_stringw(tooltiptext).c_str());
}
int IrrLibGUI::AddButton(std::string text, core::rect<s32> & rect, std::string tooltiptext = "")
{
return addButton(rect, 0, nButtonid, stdstring_to_stringw(text).c_str(), stdstring_to_stringw(tooltiptext).c_str());
}
Unstable Version/1.2.8/IrrLibGUI.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRLIBGUI_H
#define IRRLIBGUI_H
#include <iostream>
#include <strings.h>
#include <irrlicht.h>
#include "IrrLibBase.h"
class IrrLibGUI: public IrrLibBase {
private:
irr::gui::IGUISkin* skin;
irr::gui::IGUIFont* font;
irr::gui::IGUIEnvironment* env;
//TODO: Create an array storing all messages
int nStaticText;
//irr::gui::IGUIStaticText* arrStaticText[10];
int nButton;
int nButtonid;
int nListBox;
int nListBoxid;
std::vector<irr::gui::IGUIStaticText*> arrStaticText;
std::vector<irr::gui::IGUIButton*> arrButton;
std::vector<irr::gui::IGUIListBox*> arrListBox;
int AddToStaticArray(irr::gui::IGUIStaticText * addme);
int addButton(const irr::core::rect< irr::s32 > & rectangle, irr::gui::IGUIElement *parent = 0, irr::s32 id = 0, const wchar_t * text = 0, const wchar_t * tooltiptext = 0); //TODO: Clean this up!
int addListBox(const irr::core::rect< irr::s32 > &rectangle, irr::gui::IGUIElement * parent);
public:
IrrLibGUI();
~IrrLibGUI();
void SetEnv(irr::gui::IGUIEnvironment* env);
void Clear();
void DrawAll();
//irr::gui::IGUIStaticText* IrrLibGUI::AddStaticText(); //NA eh a default text adder why not?
/* This is bad coding, we do not want to return an irrlicht object, we want to return a standard datatype because this class handles the GUI elements, not the user. */
void AddStaticText(); //NA eh a default text adder why not?
int AddStaticText(std::string message);
int AddStaticText(std::string message, int x1, int y1, int x2, int y2);
int AddStaticText(std::string message, int x1, int y1, int x2, int y2, bool border, bool wordwrap);
int AddStaticText(std::string message, int x1, int y1, int x2, int y2, bool border, bool wordwrap, int id, bool fillbackground);
int AddStaticText(std::string message, const irr::core::rect< irr::s32 > &rectangle);
int AddStaticText(std::string message, const irr::core::rect< irr::s32 > &rectangle, bool border, bool wordwrap);
int AddStaticText(std::string message, const irr::core::rect< irr::s32 > &rectangle, bool border, bool wordwrap, int id, bool fillbackground);
int AddButton(std::string text, int x1, int y1, int x2, int y2, std::string tooltiptext);
int AddButton(std::string text, irr::core::rect<irr::s32> & rect, std::string tooltiptext); //TODO: Add move functions
int AddListBox(int x1, int y1, int x2, int y2, irr::gui::IGUIElement * parent = 0);
int AddListBox(const irr::core::rect< irr::s32 > &rectangle, irr::gui::IGUIElement * parent = 0);
void AddStringToListBox(int nLbox, std::string text);
void ChangeStaticText(int nstatictext, std::string message);
void ChangeFont(std::string fontfile);
};
#endif
Unstable Version/1.2.8/IrrSphere.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include "IrrLib.h"
#include "IrrSphere.h"
#include <irrlicht.h>
#include <strings.h>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
void IrrSphere::SetSmgr(irr::scene::ISceneManager* smgr){
this->smgr = smgr;
}
void IrrSphere::SetDriver(irr::video::IVideoDriver* driver){
this->driver = driver;
}
int IrrSphere::CreateNewSphereNode(int x, int y, int z, std::string texture, bool light){
//TODO: Resize after 10, and add 10 more to the mix!
//this->nodeNew[this->numNodes] = this->smgr->addSphereSceneNode();
//this->sphereNodes[this->numNodes]->setPosition(core::vector3df(x,y,z));
//this->sphereNodes[this->numNodes]->setMaterialTexture(0, this->driver->getTexture(texture.c_str()));
//this->sphereNodes[this->numNodes]->setMaterialFlag(video::EMF_LIGHTING, light);
nodeNew = this->smgr->addSphereSceneNode();
nodeNew->setPosition(core::vector3df(x,y,z));
nodeNew->setMaterialTexture(0, this->driver->getTexture(texture.c_str()));
nodeNew->setMaterialFlag(video::EMF_LIGHTING, light);
sphereNodes.push_back(nodeNew);
this->numNodes++;
return this->numNodes--;
/*this->node = this->smgr->addSphereSceneNode();
this->node->setPosition(core::vector3df(x,y,z));
this->node->setMaterialTexture(0, this->driver->getTexture(texture.c_str()));
this->node->setMaterialFlag(video::EMF_LIGHTING, light);*/
}
irr::core::vector3df IrrSphere::GetSphereVector(int sphere){
//We are converting to vectors, under construction NA
//return this->nodeNew[sphere]->getPosition();
return this->sphereNodes[sphere]->getPosition();
}
void IrrSphere::SetSphereVector(int sphere, irr::core::vector3df v){
this->sphereNodes[sphere]->setPosition(v);
}
IrrSphere::IrrSphere(){
this->numNodes = 0;
}
IrrSphere::~IrrSphere(){
/*for(int i = 0; i < numNodes; ++i)
delete this->nodeNew[i];
delete this->nodeNew;*/
//We are using vectors now, no more memory clowing business NA
}
Unstable Version/1.2.8/IrrSphere.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRSPHERE_H
#define IRRSPHERE_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
#include <vector>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
//#include "IrrLib.h"
class IrrSphere
{
private:
//irr::scene::ISceneNode* nodeNew[10];
irr::scene::ISceneNode* nodeNew;
std::vector<irr::scene::ISceneNode*> sphereNodes;
int numNodes;
irr::scene::ISceneManager* smgr;
irr::video::IVideoDriver* driver;
public:
void IrrSphere::SetDriver(irr::video::IVideoDriver* driver);
void IrrSphere::SetSmgr(irr::scene::ISceneManager* smgr);
int IrrSphere::CreateNewSphereNode(int x, int y, int z, std::string texture, bool light); //this is going to take my advanced C++ skillz!
irr::core::vector3df IrrSphere::GetSphereVector(int sphere);
void IrrSphere::SetSphereVector(int sphere, irr::core::vector3df v);
IrrSphere::IrrSphere();
//IrrSphere::IrrSphere(IrrLib*);
IrrSphere::~IrrSphere();
};
#endif
Unstable Version/1.2.8/IrrSprite.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <irrlicht.h>
#include <strings.h>
#include "IrrLib.h"
//Libraries we create go here
//#include "IrrSphere.h"
#include "IrrColor.h"
#include "IrrSprite.h"
//#include "Irr2D.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
IrrSprite::IrrSprite()
{
//do stuff
}
IrrSprite::~IrrSprite()
{
//delete stuff
}
void IrrSprite::SetDriver(irr::video::IVideoDriver* driver)
{
this->driver = driver;
}
void IrrSprite::SetSmgr(irr::scene::ISceneManager* smgr)
{
this->smgr = smgr;
}
Unstable Version/1.2.8/IrrSprite.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRSPRITE_H
#define IRRSPRITE_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
//#include "IrrSphere.h"
#include "IrrColor.h"
//#include "Irr2D.h"
//#include "IrrSprite.h"
//Start class
class IrrSprite {
private:
irr::video::IVideoDriver* driver;
irr::scene::ISceneManager* smgr;
public:
IrrSprite::IrrSprite();
IrrSprite::~IrrSprite();
void IrrSprite::SetDriver(irr::video::IVideoDriver* driver);
void IrrSprite::SetSmgr(irr::scene::ISceneManager* smgr);
// I forgot a semicolon here....and it wasn't compling
//Thats 1 bad thing about OOP if there is an error you don't know where the @#$@# the problem is!
};
#endif
Unstable Version/1.2.8/README
1
2
3
4
5
6
7
8
9
10
11
12
13
Irrlicht Library Wrapper
Created by Nathan Adams
Version 1.2.7
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
Please leave all files intact if you redistrubte this software.
How to use:
Add all the files to your Irrlicht project, you could compile it into a DLL if you wanted too, but for now just add all the files to your project.
Then inside your complier add the directory that you have the IrrLib files and use #include "IrrLib.h" to refrence it, and you are good to go!
Unstable Version/1.2.9/CHANGES
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
Version 1.2
+ Added a Irr3DLib class that will control all 3D objects
+ Also Added a Irr2D class that works on the same concept.
+ IrrSphere is now owned by Irr3DLib
+ Updated the examples using the latest code
Version 1.2.2
+ Added IrrEventReciever to handle all input
- Still under work
+ Fixed some misc coding bugs
+ Added template class
+ Added sprite class
+ Added GUI class
Version 1.2.3
+ IrrEventReciver now works as advertised
+ Baseclass is now being used
+ A couple somewhat-useful functions
+ int_to_string
+ stringw_to_stdstring
+ stdstring_to_stringw
+ GUI elements
+ Static text is working
+ Under construction for a data type class
Version 1.2.4
+ Implmented color codes accessiable through the class
+ IrrLib.Color.RED (ect)
Version 1.2.5
+ Implmented mouse events
+ IrrLib.IrrEvent.getMouseX();
+ IrrLib.IrrEvent.getMouseY();
+ Using vectors instead of static arrays
+ Side note: Was going to use dynamic arrays, but C++ has vectors which are 10x better.
+ Added a default exit for when you hit esc
+ Use IrrLib.IrrEvent.SetEscExit(false) to turn that off for your software
+ Use IrrLib.IrrEvent.SetEscExit(true) to turn it back on
+ Every stable version will now include a windows DLL.
+ Possible Linux .so file in the future.
Version 1.2.6
+ Added a IrrEvent for buttons
+ IrrLib.IrrEvent.checkButtonState();
+ See example for use
+ Added an AddButton function
+ IrrLib.GUI.AddButton(..);
+ See example for use
+ Problems with making the DLL
+ reasearching
Version 1.2.7
+ Fixed DLL Problem
+ Added an enum example to example 1
+ Added more examples
+ Added example 9
+ Added left click handling (see example 9)
+ Added AddLines function to Irr2D
+ DrawLines function in Irr2D will draw the lines you add
Version 1.2.9
+ Added Listbox GUI object
+ Added a new datatype IrrObj
+ Contains 2 ints, 1 for object id and 1 for event id
+ Added a IrrData.h file
Unstable Version/1.2.9/CREDITS
1
2
3
4
5
6
7
8
IrrLib
Created by
Nathan Adams
Denzel Morris
From #irrlicht
Acid
wacom
Unstable Version/1.2.9/Irr2D.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
//#include "IrrLib.h"
//#include "IrrSphere.h" //You probably aren't going to be using 3D objects in a 2D environment!
#include <irrlicht.h>
#include <strings.h>
#include "Irr2D.h"
#include "IrrSprite.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
Irr2D::Irr2D(){
this->numTextures = 0;
this->numLines = 0;
//NA Should we set textures to new
}
Irr2D::~Irr2D(){
/*for(int i = 0; i < numTextures; ++i)
delete this->textures[i];
delete this->textures;*/
//No more dynamic memory business yay! NA
}
void Irr2D::SetSmgr(irr::scene::ISceneManager* smgr){
this->smgr = smgr;
Sprite.SetSmgr(smgr);
}
void Irr2D::SetDriver(irr::video::IVideoDriver* driver){
this->driver = driver;
Sprite.SetDriver(driver);
}
void Irr2D::LoadTexturemap(std::string file){
this->texturemap = driver->getTexture(file.c_str());
}
int Irr2D::LoadTexture(std::string file){
//this->textures[this->numTextures] = driver->getTexture(file.c_str());
textures.push_back(driver->getTexture(file.c_str()));
this->numTextures++;
return numTextures--;
}
void Irr2D::DrawLine(irr::core::position2d<irr::s32>& start, irr::core::position2d<irr::s32>& end, irr::video::SColor& color)
{
this->driver->draw2DLine(start, end, color);
}
void Irr2D::AddLines(irr::core::position2d<irr::s32>& start, irr::core::position2d<irr::s32>& end, irr::video::SColor& color)
{
this->start.push_back(start);
this->end.push_back(end);
this->color.push_back(color);
this->numLines++;
}
void Irr2D::DrawLines()
{
for(int i = 0; i < numLines; ++i)
this->driver->draw2DLine(this->start[i], this->end[i], this->color[i]);
}
Unstable Version/1.2.9/Irr2D.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRR2D_H
#define IRR2D_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
#include <vector>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
//#include "IrrLib.h"
#include "IrrSprite.h"
class Irr2D {
private:
irr::scene::ISceneManager* smgr;
irr::video::IVideoDriver* driver;
irr::video::ITexture* texturemap;
int numTextures;
//irr::video::ITexture* textures[10];
std::vector<irr::video::ITexture*> textures;
std::vector<irr::core::position2d<irr::s32> > start;
std::vector<irr::core::position2d<irr::s32> > end;
std::vector<irr::video::SColor> color;
int numLines;
public:
//Irr2D::Irr2D();
IrrSprite Sprite;
Irr2D::Irr2D();
Irr2D::~Irr2D();
void Irr2D::SetDriver(irr::video::IVideoDriver* driver);
void Irr2D::SetSmgr(irr::scene::ISceneManager* smgr);
void Irr2D::LoadTexturemap(std::string file);
int Irr2D::LoadTexture(std::string file);
void Irr2D::DrawImage(int texture, const irr::core::position2d<irr::s32> & destPos);
void Irr2D::DrawImage(const irr::core::position2d<irr::s32> & destPos, const irr::core::rect<irr::s32> & sourceRect, const irr::core::rect<irr::s32> * clipRect, irr::video::SColor color, bool useAlphaChannelOfTexture);
void Irr2D::DrawLine(irr::core::position2d<irr::s32>& start, irr::core::position2d<irr::s32>& end, irr::video::SColor& color);
void Irr2D::DrawLines();
void Irr2D::AddLines(irr::core::position2d<irr::s32>& start, irr::core::position2d<irr::s32>& end, irr::video::SColor& color);
};
#endif
Unstable Version/1.2.9/Irr3D.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <strings.h>
//#include "IrrLib.h"
//Libraries we create go here
#include "IrrSphere.h"
//#include "IrrColor.h"
#include "Irr3D.h"
#include <irrlicht.h>
//#include "Irr2D.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
void Irr3D::SetDriver(irr::video::IVideoDriver* driver) //so much for copying and pasting code from the header file
{
this->driver = driver;
Sphere.SetDriver(driver);
}
void Irr3D::SetSmgr(irr::scene::ISceneManager* smgr)
{
this->smgr = smgr;
Sphere.SetSmgr(smgr);
}
Irr3D::Irr3D()
{
//do stuff here!
}
Irr3D::~Irr3D()
{
//delete stuff here!
}
Unstable Version/1.2.9/Irr3D.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRR3D_H
#define IRR3D_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
#include "IrrSphere.h"
//#include "IrrColor.h"
//#include "Irr3D.h"
//#include "Irr2D.h" This is a 3D class not 2D
/* However due to Irrlciht's nature mixing 2D with 3D is possible */
//Start class
class Irr3D {
private:
irr::video::IVideoDriver* driver;
irr::scene::ISceneManager* smgr;
public:
IrrSphere Sphere;
Irr3D::Irr3D();
Irr3D::~Irr3D();
void Irr3D::SetDriver(irr::video::IVideoDriver* driver);
void Irr3D::SetSmgr(irr::scene::ISceneManager* smgr);
};
#endif
Unstable Version/1.2.9/IrrColor.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <irrlicht.h>
#include <strings.h>
//#include "IrrLib.h"
#include "IrrColor.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
void IrrColor::Init(){
/*SColor * temp;
temp = new SColor(alpha, 255, 0, 0);
this->RED = temp;
delete temp;*/
this->RED = SColor(alpha, 255, 0, 0);
this->ORANGE = SColor(alpha, 255, 165, 0);
this->YELLOW = SColor(alpha, 255, 255, 0);
this->GREEN = SColor(alpha, 0, 255, 0);
this->BLUE = SColor(alpha, 0, 0, 255);
this->DARK_GREEN = SColor(alpha, 0, 100, 0);
this->PINK = SColor(alpha, 255, 192, 203);
this->GREY = SColor(alpha, 190, 190, 190);
this->WHITE = SColor(alpha, 0, 0, 0);
this->BLACK = SColor(alpha, 0, 0, 0);
}
IrrColor::~IrrColor(){
//delete this->RED;
}
IrrColor::IrrColor(){
this->alpha = 255;
Init();
}
IrrColor::IrrColor(irr::u32 alpha){
this->alpha = alpha;
Init();
}
int IrrColor::getAlpha(){
return this->alpha;
}
void IrrColor::setAlpha(int alpha){
this->alpha = alpha;
}
SColor IrrColor::returnColor(std::string color){
int nColor = -1;
if (color == "red")
nColor = 1;
else if (color == "green")
nColor = 2;
else if (color == "blue")
nColor = 3;
else if (color == "dark green")
nColor = 4;
else if (color == "pink")
nColor = 5;
else if (color == "grey")
nColor = 6;
switch (nColor){
case 1:
return SColor(255, 255, 0, 0);
break;
case 2:
return SColor(255, 0, 255, 0);
break;
case 3:
return SColor(255, 0, 0, 255);
break;
case 4:
return SColor(255, 0, 50, 0);
break;
case 5:
return SColor(255, 255, 10, 255);
break;
case 6:
return SColor(255,200,200,200);
break;
default:
return SColor(255,200,200,200);
break;
}// TODO: Make this function modular
}
Unstable Version/1.2.9/IrrColor.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRCOLOR_H
#define IRRCOLOR_H
#include <iostream>
#include <strings.h>
#include "irrlicht.h"
//#include "IrrLib.h"
class IrrColor {
private:
irr::u32 alpha;
void Init();
//who knows?
public:
//irr::video::SColor(alpha, 255, 0, 0);
irr::video::SColor RED;
irr::video::SColor ORANGE;
irr::video::SColor YELLOW;
irr::video::SColor GREEN;
irr::video::SColor BLUE;
irr::video::SColor DARK_GREEN;
irr::video::SColor PINK;
irr::video::SColor GREY;
irr::video::SColor WHITE;
irr::video::SColor BLACK;
/*const ORANGE = irr::video::SColor(alpha, 255, 165, 0);
const YELLOW = irr::video::SColor(alpha, 255, 255, 0);
const GREEN = irr::video::SColor(alpha, 0, 255, 0);
const BLUE = irr::video::SColor(alpha, 0, 0, 255);
const DARK_GREEN = irr::video::SColor(alpha, 0, 100, 0);
const PINK = irr::video::SColor(alpha, 255, 192, 203);
const GREY = irr::video::Scolor(alpha, 190, 190, 190);*/
//void IrrColor::test();
IrrColor();
IrrColor(irr::u32 alpha);
~IrrColor();
int getAlpha();
void setAlpha(int alpha);
irr::video::SColor IrrColor::returnColor(std::string color);
};
#endif
Unstable Version/1.2.9/IrrEventReciever.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include "IrrEventReciever.h"
//#include "IrrLib.h"
#include <irrlicht.h>
#include <iostream>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
/*void IrrEventReciever::setIrrLib(IrrLib& IrrLib)
{
this.callingIrrLib = IrrLib;
}*/
IrrEventReciever::IrrEventReciever()
{
this->escexit = true;
this->mouse.x = 0;
this->mouse.y = 0;
}
bool IrrEventReciever::OnEvent(SEvent event)
{
// A button was clicked
if (event.EventType == irr::EET_GUI_EVENT)
{
s32 id = event.GUIEvent.Caller->getID();
switch(event.GUIEvent.EventType){
case EGET_BUTTON_CLICKED:
//cout << id << endl;
buttonStates.push_back(id);
break;
case EGET_LISTBOX_CHANGED:
//s32 id = event.GUIEvent.Caller->getID();
listStates.push_back(id);
break;
case EGET_LISTBOX_SELECTED_AGAIN:
listStates.push_back(id);
break;
default:
break;
}
}
/*if (event.EventType == irr::EGET_SCROLL_BAR_CHANGED)
{
}*/
if (event.EventType == irr::EET_KEY_INPUT_EVENT) {
if (!event.KeyInput.PressedDown){
this->keyStates[event.KeyInput.Key] = false;
//cout << "Key was not hit " << this->keyStates[event.KeyInput.Key] << endl;
}
else{
if(event.KeyInput.Key == KEY_ESCAPE && escexit)
this->device->closeDevice();
this->keyStates[event.KeyInput.Key] = true;
//cout << "Key was hit: " << event.KeyInput.Key << " " << this->keyStates[event.KeyInput.Key] << endl;
}
}
if (event.EventType == EET_MOUSE_INPUT_EVENT){
if (event.MouseInput.Event == EMIE_MOUSE_MOVED){
this->mouse.x = event.MouseInput.X;
this->mouse.y = event.MouseInput.Y;
}
if (event.MouseInput.Event == EMIE_LMOUSE_PRESSED_DOWN)
this->mouseStates[0] = true;
if (event.MouseInput.Event == EMIE_LMOUSE_LEFT_UP)
this->mouseStates[0] = false;
}
return false;
}
void IrrEventReciever::SetEscExit(bool onoff)
{
this->escexit = onoff;
}
int IrrEventReciever::getMouseX()
{
return this->mouse.x;
}
int IrrEventReciever::getMouseY()
{
return this->mouse.y;
}
int IrrEventReciever::getButtonState()
{
if(!this->buttonStates.empty()){
int id;
id = buttonStates.back();
this->buttonStates.pop_back();
return id;
}
else
return -1;
}
int IrrEventReciever::getRevButtonState()
{
if(!this->buttonStates.empty()){
int id = buttonStates.front();
this->buttonStates.erase(buttonStates.begin());
return id;
}
else
return -1;
}
void IrrEventReciever::clearButtonState()
{
this->buttonStates.clear();
}
int IrrEventReciever::checkButtonState()
{
if(!this->buttonStates.empty())
return this->buttonStates.back();
else
return -1;
}
void IrrEventReciever::delLastButtonStat()
{
if(!this->buttonStates.empty())
this->buttonStates.pop_back();
}
bool IrrEventReciever::isButtonStateEmpty()
{
return this->buttonStates.empty();
}
int IrrEventReciever::checkListState()
{
if(!this->listStates.empty())
return this->listStates.back();
else
return -1;
}
void IrrEventReciever::delLastListStat()
{
if(!this->listStates.empty())
this->listStates.pop_back();
}
Unstable Version/1.2.9/IrrEventReciever.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRREVENTRECIEVER_H
#define IRREVENTRECIEVER_H
//#include "IrrLib.h"
#include <vector>
#include <irrlicht.h>
#include "IrrLibBase.h"
#include "IrrData.h"
#include <stdlib.h>
class IrrEventReciever : public irr::IEventReceiver, public IrrLibBase
{
private:
//IrrLib callingIrrLib;
_mouse mouse;
bool escexit;
std::vector<int> buttonStates;
std::vector<int> listStates;
public:
bool mouseStates[1];
IrrEventReciever();
int getMouseX();
int getMouseY();
bool keyStates[irr::KEY_KEY_CODES_COUNT];
//void setIrrLib(IrrLib& IrrLib)
virtual bool OnEvent(irr::SEvent event);
void SetEscExit(bool onoff);
int getButtonState();
int getRevButtonState();
void clearButtonState();
int checkButtonState();
void delLastButtonStat();
bool isButtonStateEmpty(); //is there still stuff in the vector to be done? NA
int checkListState();
void delLastListStat();
};
#endif
Unstable Version/1.2.9/IrrLib.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <irrlicht.h>
#include <strings.h>
#include <sstream>
#include <time.h>
#include "IrrLib.h"
//Libraries we create go here
//#include "IrrSphere.h"
#include "IrrColor.h"
//#include "Irr2D.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
//TODO: Create own class for handling inputs!
/*IrrLib::IrrLib(MastEventReceiver & receiver){
this->device = createDevice(EDT_SOFTWARE, dimension2d<s32>(640, 480), 16, false, false, false, &receiver);
if (this->device == 0)
exit(1);
IrrLib::Init();
}*/
IrrLib::IrrLib(){
this->device = createDevice(EDT_SOFTWARE, dimension2d<s32>(640, 480), 16, false, false, false, &this->IrrEvent);
if (this->device == 0)
exit(1);
IrrLib::Init();
}
IrrLib::IrrLib(video::E_DRIVER_TYPE drivertype, core::dimension2d<s32> & res, u32 bits, bool fullscreen, bool stencilbuffer, bool vsync){
//MyEventReceiver receiver;
this->device = createDevice(drivertype, res, bits, fullscreen, stencilbuffer, vsync, &this->IrrEvent);
if (this->device == 0)
exit(1);
IrrLib::Init();
}
IrrLib::IrrLib(int nDrivertype, int width, int height, int bits, bool fullscreen, bool stencilbuffer, bool vsync){
//MyEventReceiver receiver;
video::E_DRIVER_TYPE drivertype;
switch (nDrivertype){
case 0: //TODO: finish this switch case
drivertype = EDT_NULL;
break;
case 1:
drivertype = EDT_SOFTWARE;
break;
case 2:
drivertype = EDT_BURNINGSVIDEO;
break;
case 3:
drivertype = EDT_OPENGL;
break;
case 4:
drivertype = EDT_DIRECT3D8;
//*Note: It seems as Microsoft has stoped supporting DX 8.1, so you can not compile it into Irrlicht engine anymore
//TODO: Find how to detect if DX is complied into Irrlicht
//TODO: Find how to detecht for linux
break;
case 5:
drivertype = EDT_DIRECT3D9;
break;
default:
drivertype = EDT_SOFTWARE;
break;
}
this->device = createDevice(drivertype, dimension2d<s32>(width, height), bits, fullscreen, stencilbuffer, vsync, &this->IrrEvent);
if (this->device == 0)
exit(1);
IrrLib::Init();
}
IrrLib::~IrrLib (){ //Our moms wont clean up after us!
//Although I'm sure Irrlicht does this for us already, its always a good idea to check!
/*if (this->device != NULL)
delete this->device;
if (this->driver != NULL)
delete this->driver;
if (this->smgr != NULL)
delete this->smgr;
if (this->mesh != NULL)
delete this->mesh;
if (this->node != NULL)
delete this->node;*/ //it seems Irrlicht picks up after us...
//however we created newNodes, now we need to delete it!
}
void IrrLib::Init(){
//this->numNodes = 0;
//this->nodeNew = new ISceneNode[10];
//this->env->addStaticText(L"Transparent Control:", rect<s32>(20,30,300,80), true);
this->env = this->device->getGUIEnvironment();
this->driver = this->device->getVideoDriver();
this->smgr = this->device->getSceneManager();
Irr3DLib.SetSmgr(this->smgr);
Irr3DLib.SetDriver(this->driver);
Irr2DLib.SetSmgr(this->smgr);
Irr2DLib.SetDriver(this->driver);
GUI.SetEnv(this->env);
IrrEvent.SetDevice(this->device);
this->timer = this->device->getTimer();
tick = this->timer->getRealTime();
}
void IrrLib::ReadArchive(std::string file){
this->device->getFileSystem()->addZipFileArchive(file.c_str());
}
void IrrLib::LoadQ3Level(std::string q3level){
this->mesh = this->smgr->getMesh(q3level.c_str());
this->node = 0;
if (this->mesh)
this->node = this->smgr->addOctTreeSceneNode(this->mesh->getMesh(0), 0, -1, 128);
}
void IrrLib::MapPos(int x, int y, int z){
if (this->node)
this->node->setPosition(core::vector3df(x, y, z));
}
void IrrLib::MapPos(){
if (this->node)
this->node->setPosition(core::vector3df(0, 0, 0));
}
void IrrLib::AddFPSCam(){
this->cam = this->smgr->addCameraSceneNodeFPS();
}
void IrrLib::AddFPSCam(f32 x, f32 y, f32 z)
{
this->cam = this->smgr->addCameraSceneNodeFPS();
this->cam->setPosition(irr::core::vector3df(x, y, z));
}
void IrrLib::VisibleCursor(bool tf){
if (tf == false)
this->device->getCursorControl()->setVisible(false);
else
this->device->getCursorControl()->setVisible(true);
}
int IrrLib::GetFPSCount(){
return this->driver->getFPS();
}
bool IrrLib::DeviceIsRunning(){
return this->device->run();
}
bool IrrLib::IsActiveWindow(){
return this->device->isWindowActive();
}
void IrrLib::BeginScene(){
this->driver->beginScene(true, true, video::SColor(0,200,200,200));
}
void IrrLib::BeginScene(irr::video::SColor color){
this->driver->beginScene(true, true, color);
}
void IrrLib::BeginScene(bool usebackBuffer, bool usezBuffer, irr::video::SColor color){
this->driver->beginScene(usebackBuffer, usezBuffer, color);
}
void IrrLib::DrawAll(){
//position2d<int> start(50, 50);
//position2d<int> end(100,100);
// SColor whitecolor(255,255,255,255);
//driver->draw2DLine(start, end, whitecolor);
this->smgr->drawAll();
this->env->drawAll();
//this->device->getGUIEnvironment()->drawAll();
}
void IrrLib::EndScene(){
this->driver->endScene();
}
void IrrLib::SetWindowCaption(stringw str){
this->device->setWindowCaption(str.c_str());
}
irr::core::stringw IrrLib::GetDriverName(){
return this->driver->getName();
}
void IrrLib::EndIrrlicht(){
if(this->device != NULL){
this->device->drop();
this->device = NULL;
}
}
void IrrLib::KeyPress(char key){
this->key = key;
}
char IrrLib::KeyPressed(){
return key;
}
irr::f32 IrrLib::getX(){
return this->smgr->getActiveCamera()->getPosition().X;
}
irr::f32 IrrLib::getY(){
return this->smgr->getActiveCamera()->getPosition().Y;
}
irr::f32 IrrLib::getZ(){
return this->smgr->getActiveCamera()->getPosition().Z;
}
bool IrrLib::CheckGameLoop(){
u32 now;
now = this->timer->getRealTime();
if ((now - this->tick) >= 30){
//this->tick == time (NULL);
return true;
} else {
return false;
}
}
bool IrrLib::CheckGameLoop(u32 ms){
u32 now;
now = this->timer->getRealTime();
if ((now - this->tick) >= ms){
this->tick = now;
return true;
} else {
return false;
}
}
void IrrLib::Exit()
{
this->device->closeDevice();
}
PixelSize IrrLib::GetScreenSize()
{
return this->driver->getScreenSize();
/*pixels returnres;
returnres.width = screenres.Width;
returnres.height = screenres.Height;
return returnres;*/
}
//template <class T> std::string IrrLib::to_string (T t)
/*std::string IrrLib::int_to_string (int t)
{
std::stringstream ss;
ss << t;
return ss.str();
}*/
// This is in the base class now, every class that decends from that class has this ability.
Unstable Version/1.2.9/IrrLib.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRLIB_H
#define IRRLIB_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
#include <irrlicht.h>
#include <time.h>
/* We have to include Irrlichts libs */
#include "Irr3D.h"
#include "IrrColor.h"
#include "IrrLibGUI.h"
#include "IrrEventReciever.h"
#include "Irr2D.h"
#include "IrrLibBase.h"
#include "IrrData.h"
typedef irr::core::dimension2d<irr::s32> PixelSize;
/*struct IrrObj {
int eventid;
int objectid;
};*/
//Start class
class IrrLib: public IrrLibBase {
private:
/* Create an Irrlicht device as private because the class should handle
All irrlicht interaction */
irr::IrrlichtDevice *device;
// Tells Irrlicht what driver to use
//video::E_DRIVER_TYPE driverType;
/*
Get a pointer to the video driver and the SceneManager so that
we do not always have to write device->getVideoDriver() and
device->getSceneManager().
*/
irr::video::IVideoDriver* driver;
irr::scene::ISceneManager* smgr;
irr::gui::IGUIEnvironment* env;
/*
Get a pointer to the 'mesh' aka the level.
Note: This is for Quake3 levels, ie bsp maps.
*/
irr::scene::IAnimatedMesh* mesh;
irr::scene::ISceneNode* node;
irr::scene::ISceneNode * tempNode; //use this to store nodeNew's data so we can resize it
irr::scene::ICameraSceneNode * cam;
char key;
void IrrLib::Init();
/*friend class IrrColor;
friend class Irr2DLib;
friend class Sphere;*/
friend class IrrEventReciever;
irr::u32 tick;
irr::ITimer* timer;
public:
//IrrSphere Sphere; //This has to be public to be able to access the Sphere class
/* IrrSphere is now in Irr3D class */
//Prehaps put this into a IrrLib3D class?
Irr3D Irr3DLib;
IrrColor Color; //Color class...not much of a class but lets keep it OO
Irr2D Irr2DLib; //1/2 variable to be labeled like this due to variables not able to begin with a number
IrrLibGUI GUI;
IrrEventReciever IrrEvent;
IrrLib::IrrLib();
//IrrLib::IrrLib(MastEventReceiver & receiver);
IrrLib::IrrLib(irr::video::E_DRIVER_TYPE drivertype, irr::core::dimension2d<irr::s32> & res, irr::u32 bits, bool fullscreen, bool stencilbuffer, bool vsync);
IrrLib::IrrLib(int drivertype, int width, int height, int bits, bool fullscreen, bool stencilbuffer, bool vsync);
IrrLib::~IrrLib(); //Our moms wont clean up after us!
void IrrLib::ReadArchive(std::string file);
void IrrLib::LoadQ3Level(std::string q3level);
void IrrLib::MapPos(int x, int y, int z); //I think this moves the actual camera?
void IrrLib::MapPos();
void IrrLib::AddFPSCam();
void IrrLib::AddFPSCam(irr::f32 x, irr::f32 y, irr::f32 z);
void IrrLib::VisibleCursor(bool tf);
int IrrLib::GetFPSCount();
bool IrrLib::DeviceIsRunning();
bool IrrLib::IsActiveWindow();
void IrrLib::BeginScene();
void IrrLib::BeginScene(irr::video::SColor color);
//void IrrLib::BeginScene(irr::video::SColor * color);
void IrrLib::BeginScene(bool usebackBuffer, bool usezBuffer, irr::video::SColor color);
//TODO: Add one more for human readable colors and hex colors!
void IrrLib::DrawAll();
void IrrLib::EndScene();
void IrrLib::SetWindowCaption(irr::core::stringw str);
irr::core::stringw IrrLib::GetDriverName();
//TODO: Make function to turn stringw to string and visa versa
void IrrLib::EndIrrlicht(); //Renamed from KillIrrlicht to EndIrrlicht
//TODO: Add logging
void IrrLib::KeyPress(char key);
char IrrLib::KeyPressed();
irr::f32 getX();
irr::f32 getY();
irr::f32 getZ();
bool CheckGameLoop();
bool CheckGameLoop(irr::u32 ms);
void Exit();
PixelSize GetScreenSize();
//void EndGameLoop();
//template <class T> std::string to_string (T t);
};
#endif
Unstable Version/1.2.9/IrrLibBase.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <irrlicht.h>
#include "IrrLibBase.h"
#include <strings.h>
#include <sstream>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
/*
* Code from http://articles.techrepublic.com.com/5100-22-5079969.html#
*
struct str_stream
{
std::stringstream & underlying_stream() const
{ return m_streamOut; }
operator std::string() const
{
return m_streamOut.str();
}
private:
mutable std::stringstream m_streamOut;
};
template< class type>
inline const str_stream & operator<< ( const str_stream & out, const type & value)
{
out.underlying_stream() << value;
return out;
}
template<class type> std::string to_string( const type & value)
{
std::ostringstream streamOut;
streamOut << value;
return streamOut.str();
}
* End code copy
*/
void IrrLibBase::SetDriver(IVideoDriver* driver) //can be overloaded
{
this->driver = driver;
}
void IrrLibBase::SetSmgr(ISceneManager* smgr)
{
this->smgr = smgr;
}
std::string IrrLibBase::wchar_to_stdstring (const wchar_t* wc)
{
//cout << "Starting conversion";
//wcstombs(tmp, in, 255);
char c[255];
for(int t = 0; wc[t] != '\0'; t++)
c[t] = (char)wc[t];
/*for(int t = 0; c[t] != '\0'; t++)
wc[t] = c[t];*/
std::stringstream ss;
ss << c;
//cout << "Conversion OK";
return ss.str();
}
std::string IrrLibBase::int_to_string (int t)
{
std::stringstream ss;
ss << t;
return ss.str();
}
std::string IrrLibBase::stringw_to_stdstring(irr::core::stringw sw)
{
std::stringstream ss;
ss << sw.c_str();
return ss.str();
}
irr::core::stringw IrrLibBase::stdstring_to_stringw(std::string ss)
{
stringw tmpw(ss.c_str());
return tmpw;
}
void IrrLibBase::SetDevice(irr::IrrlichtDevice *device)
{
this->device = device;
}
void IrrLibBase::init()
{
}
Unstable Version/1.2.9/IrrLibBase.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRLIBBASE_H
#define IRRLIBBASE_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
class IrrLibBase {
protected:
irr::video::IVideoDriver* driver;
irr::scene::ISceneManager* smgr;
irr::IrrlichtDevice *device;
public:
//template<class type> std::string to_string( const type & value);
irr::core::dimension2d<irr::s32> irrpixels;
void IrrLibBase::SetDriver(irr::video::IVideoDriver* driver);
void IrrLibBase::SetSmgr(irr::scene::ISceneManager* smgr);
void SetDevice(irr::IrrlichtDevice *device);
std::string int_to_string (int t);
std::string stringw_to_stdstring(irr::core::stringw sw);
irr::core::stringw stdstring_to_stringw(std::string ss);
std::string wchar_to_stdstring (const wchar_t* wc);
void init();
};
#endif
Unstable Version/1.2.9/IrrLibGUI.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <strings.h>
#include <irrlicht.h>
#include <vector>
#include <sstream>
#include "IrrLib.h"
#include "IrrData.h"
#include "IrrLibGUI.h"
#include "IrrLibBase.h"
#include <stdlib.h>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
template<class type> std::string to_string( const type & value)
{
std::ostringstream streamOut;
streamOut << value;
return streamOut.str();
}
IrrLibGUI::IrrLibGUI()
{
//NA does it need to do anything at init?
this->nStaticText = 0;
this->nButton = 0;
this->nButtonid = 100;
this->nListBoxid = 200;
this->nListBox = 0;
//this->nListBoxid = 300;
//this->arrStaticText = new IGUIStaticText[10];
//this->env = this->device->getGUIEnvironment(); //NA yes we do!
}
IrrLibGUI::~IrrLibGUI()
{
//NA Do we have to delete anything?
}
void IrrLibGUI::SetEnv(IGUIEnvironment* env)
{
this->env = env;
//env->addButton(rect<s32>(10,210,110,210 + 32), 0, 109, L"Quit", L"Exits Program");
}
int IrrLibGUI::addButton(const core::rect< s32 > & rectangle, IGUIElement *parent, s32 id, const wchar_t * text, const wchar_t * tooltiptext)
{
arrButton.push_back(this->env->addButton(rectangle, parent, id, text, tooltiptext));
++nButton;
++nButtonid;
return nButtonid - 1;
}
IrrObj IrrLibGUI::addListBox(const irr::core::rect< irr::s32 > &rectangle, IGUIElement * parent)
{
irr::gui::IGUIListBox* tmp = this->env->addListBox(rectangle, parent, nListBoxid);
arrListBox.push_back(tmp);
//we introduce a new datatype; IrroObj
IrrObj ret;
ret.eventid = nListBoxid;
ret.objectid = nListBox;
++nListBox;
++nListBoxid;
return ret;
}
IrrObj IrrLibGUI::AddListBox(int x1, int y1, int x2, int y2, IGUIElement * parent)
{
return addListBox(rect<s32>(x1, y1, x2, y2), parent);
}
IrrObj IrrLibGUI::AddListBox(const irr::core::rect< irr::s32 > &rectangle, IGUIElement * parent)
{
return addListBox(rectangle, parent);
}
void IrrLibGUI::AddStringToListBox(int nLbox, std::string text)
{
this->arrListBox[nLbox]->addItem(stdstring_to_stringw(text).c_str());
//this->arrListBox[0]->addItem(L"TEST");
}
std::string IrrLibGUI::getSelectListString(int lstbox)
{
//stringc tmp = this->arrListBox[lstbox]->getListItem(this->arrListBox[lstbox]->getSelected());
s32 selected = this->arrListBox[lstbox]->getSelected();
//const wchar_t* tmp = this->arrListBox[lstbox]->getListItem(selected);
//irr::core::stringw tmp;
char out[255];
//tmp = this->arrListBox[lstbox]->getText();
irr::core::stringc tmp(arrListBox[lstbox]->getListItem(arrListBox[lstbox]->getSelected()));
//cout << tmp.c_str() << endl;
//wcstombs(out, tmp, tmp.length());
//cout << tmp[0] << endl;
// std::stringstream ss;
//for (int i = 0; i < tmp.size(); ++i)
//ss << tmp.c_str();
std::string ret = tmp.c_str();
return ret;
}
void IrrLibGUI::Clear()
{
this->env->clear();
}
void IrrLibGUI::DrawAll()
{
this->env->drawAll();
}
int IrrLibGUI::AddToStaticArray(irr::gui::IGUIStaticText * addme)
{
//arrStaticText[nStaticText] = addme;
arrStaticText.push_back(addme);
this->nStaticText++;
this->nButtonid++;
return this->nStaticText;
}
void IrrLibGUI::AddStaticText()
{
//rect<s32>(20,30,300,80),
this->env->addStaticText(L"Powered by IrrLib.", rect<s32>(20,30,300,80), true);
}
int IrrLibGUI::AddStaticText(std::string message)
{
irr::gui::IGUIStaticText * addthis;
stringw tmpw(message.c_str());
addthis = this->env->addStaticText(tmpw.c_str(), rect<s32>(20,30,300,80), true);
return AddToStaticArray(addthis);
}
int IrrLibGUI::AddStaticText(std::string message, int x1, int y1, int x2, int y2)
{
irr::gui::IGUIStaticText * addthis;
stringw tmpw(message.c_str());
addthis = this->env->addStaticText(tmpw.c_str(), rect<s32>(x1,y1,x2,y2), true);
return AddToStaticArray(addthis);
}
int IrrLibGUI::AddStaticText(std::string message, int x1, int y1, int x2, int y2, bool border, bool wordwrap)
{
irr::gui::IGUIStaticText * addthis;
stringw tmpw(message.c_str());
addthis = this->env->addStaticText(tmpw.c_str(), rect<s32>(x1,y1,x2,y2), border, wordwrap);
return AddToStaticArray(addthis);
}
int IrrLibGUI::AddStaticText(std::string message, int x1, int y1, int x2, int y2, bool border, bool wordwrap, int id, bool fillbackground)
{
irr::gui::IGUIStaticText * addthis;
stringw tmpw(message.c_str());
addthis = this->env->addStaticText(tmpw.c_str(), rect<s32>(x1,y1,x2,y2), border, wordwrap, 0, id, fillbackground);
return AddToStaticArray(addthis);
}
int IrrLibGUI::AddStaticText(std::string message, const core::rect< s32 > &rectangle)
{
irr::gui::IGUIStaticText * addthis;
stringw tmpw(message.c_str());
addthis = this->env->addStaticText(tmpw.c_str(), rectangle);
return AddToStaticArray(addthis);
}
int IrrLibGUI::AddStaticText(std::string message, const core::rect< s32 > &rectangle, bool border, bool wordwrap)
{
irr::gui::IGUIStaticText * addthis;
stringw tmpw(message.c_str());
addthis = this->env->addStaticText(tmpw.c_str(), rectangle, border, wordwrap);
return AddToStaticArray(addthis);
}
int IrrLibGUI::AddStaticText(std::string message, const core::rect< s32 > &rectangle, bool border, bool wordwrap, int id, bool fillbackground)
{
irr::gui::IGUIStaticText * addthis;
stringw tmpw(message.c_str());
addthis = this->env->addStaticText(tmpw.c_str(), rectangle, border, wordwrap, 0, id, fillbackground);
return AddToStaticArray(addthis);
}
void IrrLibGUI::ChangeStaticText(int nstatictext, std::string message)
{
stringw tmpw(message.c_str());
this->arrStaticText[this->nStaticText-1]->setText(tmpw.c_str());
}
void IrrLibGUI::ChangeFont(std::string fontfile)
{
IGUISkin* skin = this->env->getSkin();
IGUIFont* font = this->env->getFont(fontfile.c_str());
if (font)
skin->setFont(font);
}
int IrrLibGUI::AddButton(std::string text, int x1, int y1, int x2, int y2, std::string tooltiptext = "")
{
return addButton(rect<s32>(x1, y1, x2, y2), 0, nButtonid, stdstring_to_stringw(text).c_str(), stdstring_to_stringw(tooltiptext).c_str());
}
int IrrLibGUI::AddButton(std::string text, core::rect<s32> & rect, std::string tooltiptext = "")
{
return addButton(rect, 0, nButtonid, stdstring_to_stringw(text).c_str(), stdstring_to_stringw(tooltiptext).c_str());
}
Unstable Version/1.2.9/IrrLibGUI.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRLIBGUI_H
#define IRRLIBGUI_H
#include <iostream>
#include <strings.h>
#include <irrlicht.h>
#include "IrrLib.h"
#include "IrrData.h"
#include "IrrLibBase.h"
class IrrLibGUI: public IrrLibBase {
private:
irr::gui::IGUISkin* skin;
irr::gui::IGUIFont* font;
irr::gui::IGUIEnvironment* env;
//TODO: Create an array storing all messages
int nStaticText;
//irr::gui::IGUIStaticText* arrStaticText[10];
int nButton;
int nButtonid;
int nListBox;
int nListBoxid;
std::vector<irr::gui::IGUIStaticText*> arrStaticText;
std::vector<irr::gui::IGUIButton*> arrButton;
std::vector<irr::gui::IGUIListBox*> arrListBox;
int AddToStaticArray(irr::gui::IGUIStaticText * addme);
int addButton(const irr::core::rect< irr::s32 > & rectangle, irr::gui::IGUIElement *parent = 0, irr::s32 id = 0, const wchar_t * text = 0, const wchar_t * tooltiptext = 0); //TODO: Clean this up!
IrrObj addListBox(const irr::core::rect< irr::s32 > &rectangle, irr::gui::IGUIElement * parent);
public:
IrrLibGUI();
~IrrLibGUI();
void SetEnv(irr::gui::IGUIEnvironment* env);
void Clear();
void DrawAll();
//irr::gui::IGUIStaticText* IrrLibGUI::AddStaticText(); //NA eh a default text adder why not?
/* This is bad coding, we do not want to return an irrlicht object, we want to return a standard datatype because this class handles the GUI elements, not the user. */
void AddStaticText(); //NA eh a default text adder why not?
int AddStaticText(std::string message);
int AddStaticText(std::string message, int x1, int y1, int x2, int y2);
int AddStaticText(std::string message, int x1, int y1, int x2, int y2, bool border, bool wordwrap);
int AddStaticText(std::string message, int x1, int y1, int x2, int y2, bool border, bool wordwrap, int id, bool fillbackground);
int AddStaticText(std::string message, const irr::core::rect< irr::s32 > &rectangle);
int AddStaticText(std::string message, const irr::core::rect< irr::s32 > &rectangle, bool border, bool wordwrap);
int AddStaticText(std::string message, const irr::core::rect< irr::s32 > &rectangle, bool border, bool wordwrap, int id, bool fillbackground);
int AddButton(std::string text, int x1, int y1, int x2, int y2, std::string tooltiptext);
int AddButton(std::string text, irr::core::rect<irr::s32> & rect, std::string tooltiptext); //TODO: Add move functions
IrrObj AddListBox(int x1, int y1, int x2, int y2, irr::gui::IGUIElement * parent = 0);
IrrObj AddListBox(const irr::core::rect< irr::s32 > &rectangle, irr::gui::IGUIElement * parent = 0);
void AddStringToListBox(int nLbox, std::string text);
void ChangeStaticText(int nstatictext, std::string message);
void ChangeFont(std::string fontfile);
std::string getSelectListString(int lstbox);
};
#endif
Unstable Version/1.2.9/IrrSphere.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include "IrrLib.h"
#include "IrrSphere.h"
#include <irrlicht.h>
#include <strings.h>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
void IrrSphere::SetSmgr(irr::scene::ISceneManager* smgr){
this->smgr = smgr;
}
void IrrSphere::SetDriver(irr::video::IVideoDriver* driver){
this->driver = driver;
}
int IrrSphere::CreateNewSphereNode(int x, int y, int z, std::string texture, bool light){
//TODO: Resize after 10, and add 10 more to the mix!
//this->nodeNew[this->numNodes] = this->smgr->addSphereSceneNode();
//this->sphereNodes[this->numNodes]->setPosition(core::vector3df(x,y,z));
//this->sphereNodes[this->numNodes]->setMaterialTexture(0, this->driver->getTexture(texture.c_str()));
//this->sphereNodes[this->numNodes]->setMaterialFlag(video::EMF_LIGHTING, light);
nodeNew = this->smgr->addSphereSceneNode();
nodeNew->setPosition(core::vector3df(x,y,z));
nodeNew->setMaterialTexture(0, this->driver->getTexture(texture.c_str()));
nodeNew->setMaterialFlag(video::EMF_LIGHTING, light);
sphereNodes.push_back(nodeNew);
this->numNodes++;
return this->numNodes--;
/*this->node = this->smgr->addSphereSceneNode();
this->node->setPosition(core::vector3df(x,y,z));
this->node->setMaterialTexture(0, this->driver->getTexture(texture.c_str()));
this->node->setMaterialFlag(video::EMF_LIGHTING, light);*/
}
irr::core::vector3df IrrSphere::GetSphereVector(int sphere){
//We are converting to vectors, under construction NA
//return this->nodeNew[sphere]->getPosition();
return this->sphereNodes[sphere]->getPosition();
}
void IrrSphere::SetSphereVector(int sphere, irr::core::vector3df v){
this->sphereNodes[sphere]->setPosition(v);
}
IrrSphere::IrrSphere(){
this->numNodes = 0;
}
IrrSphere::~IrrSphere(){
/*for(int i = 0; i < numNodes; ++i)
delete this->nodeNew[i];
delete this->nodeNew;*/
//We are using vectors now, no more memory clowing business NA
}
Unstable Version/1.2.9/IrrSphere.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRSPHERE_H
#define IRRSPHERE_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
#include <vector>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
//#include "IrrLib.h"
class IrrSphere
{
private:
//irr::scene::ISceneNode* nodeNew[10];
irr::scene::ISceneNode* nodeNew;
std::vector<irr::scene::ISceneNode*> sphereNodes;
int numNodes;
irr::scene::ISceneManager* smgr;
irr::video::IVideoDriver* driver;
public:
void IrrSphere::SetDriver(irr::video::IVideoDriver* driver);
void IrrSphere::SetSmgr(irr::scene::ISceneManager* smgr);
int IrrSphere::CreateNewSphereNode(int x, int y, int z, std::string texture, bool light); //this is going to take my advanced C++ skillz!
irr::core::vector3df IrrSphere::GetSphereVector(int sphere);
void IrrSphere::SetSphereVector(int sphere, irr::core::vector3df v);
IrrSphere::IrrSphere();
//IrrSphere::IrrSphere(IrrLib*);
IrrSphere::~IrrSphere();
};
#endif
Unstable Version/1.2.9/IrrSprite.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <irrlicht.h>
#include <strings.h>
#include "IrrLib.h"
//Libraries we create go here
//#include "IrrSphere.h"
#include "IrrColor.h"
#include "IrrSprite.h"
//#include "Irr2D.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
IrrSprite::IrrSprite()
{
//do stuff
}
IrrSprite::~IrrSprite()
{
//delete stuff
}
void IrrSprite::SetDriver(irr::video::IVideoDriver* driver)
{
this->driver = driver;
}
void IrrSprite::SetSmgr(irr::scene::ISceneManager* smgr)
{
this->smgr = smgr;
}
Unstable Version/1.2.9/IrrSprite.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRSPRITE_H
#define IRRSPRITE_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
//#include "IrrSphere.h"
#include "IrrColor.h"
//#include "Irr2D.h"
//#include "IrrSprite.h"
//Start class
class IrrSprite {
private:
irr::video::IVideoDriver* driver;
irr::scene::ISceneManager* smgr;
public:
IrrSprite::IrrSprite();
IrrSprite::~IrrSprite();
void IrrSprite::SetDriver(irr::video::IVideoDriver* driver);
void IrrSprite::SetSmgr(irr::scene::ISceneManager* smgr);
// I forgot a semicolon here....and it wasn't compling
//Thats 1 bad thing about OOP if there is an error you don't know where the @#$@# the problem is!
};
#endif
Unstable Version/1.2.9/README
1
2
3
4
5
6
7
8
9
10
11
12
13
Irrlicht Library Wrapper
Created by Nathan Adams
Version 1.2.9
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
Please leave all files intact if you redistrubte this software.
How to use:
Add all the files to your Irrlicht project, you could compile it into a DLL if you wanted too, but for now just add all the files to your project.
Then inside your complier add the directory that you have the IrrLib files and use #include "IrrLib.h" to refrence it, and you are good to go!
Unstable Version/1.2b/Irr2D.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Version 1.1
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include "IrrLib.h"
//#include "IrrSphere.h" //You probably aren't going to be using 3D objects in a 2D environment!
#include "Irr2D.h"
#include <irrlicht.h>
#include <strings.h>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
Irr2D::Irr2D(){
this->numTextures = 0;
}
Irr2D::~Irr2D(){
for(int i = 0; i < numTextures; ++i)
delete this->textures[i];
delete this->textures;
}
void Irr2D::SetSmgr(irr::scene::ISceneManager* smgr){
this->smgr = smgr;
}
void Irr2D::SetDriver(irr::video::IVideoDriver* driver){
this->driver = driver;
}
void Irr2D::LoadTexturemap(std::string file){
this->texturemap = driver->getTexture(file.c_str());
}
int Irr2D::LoadTexture(std::string file){
this->textures[this->numTextures] = driver->getTexture(file.c_str());
this->numTextures++;
return numTextures--;
}
Unstable Version/1.2b/Irr2D.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Version 1.1
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRR2D_H
#define IRR2D_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
#include "IrrLib.h"
class Irr2D {
private:
irr::scene::ISceneManager* smgr;
irr::video::IVideoDriver* driver;
irr::video::ITexture* texturemap;
int numTextures;
irr::video::ITexture* textures[10];
public:
Irr2D::Irr2D();
Irr2D::~Irr2D();
void Irr2D::SetDriver(irr::video::IVideoDriver* driver);
void Irr2D::SetSmgr(irr::scene::ISceneManager* smgr);
void Irr2D::LoadTexturemap(std::string file);
int Irr2D::LoadTexture(std::string file);
void Irr2D::DrawImage(int texture, const irr::core::position2d<irr::s32> & destPos);
void Irr2D::DrawImage(const irr::core::position2d<irr::s32> & destPos, const irr::core::rect<irr::s32> & sourceRect, const irr::core::rect<irr::s32> * clipRect, irr::video::SColor color, bool useAlphaChannelOfTexture);
void Irr2D::DrawLine(const irr::core::position2d<irr::s32> & start, const irr::core::position2d<irr::s32> & end, irr::video::SColor color);
};
#endif
Unstable Version/1.2b/IrrColor.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Version 1.1
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <irrlicht.h>
#include <strings.h>
#include "IrrLib.h"
#include "IrrColor.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
void IrrColor::test(){
//do nothing
}
SColor IrrColor::returnColor(std::string color){
int nColor = -1;
if (color == "red")
nColor = 1;
else if (color == "green")
nColor = 2;
else if (color == "blue")
nColor = 3;
else if (color == "dark green")
nColor = 4;
else if (color == "pink")
nColor = 5;
else if (color == "grey")
nColor = 6;
switch (nColor){
case 1:
return SColor(255, 255, 0, 0);
break;
case 2:
return SColor(255, 0, 255, 0);
break;
case 3:
return SColor(255, 0, 0, 255);
break;
case 4:
return SColor(255, 0, 50, 0);
break;
case 5:
return SColor(255, 255, 10, 255);
break;
case 6:
return SColor(255,200,200,200);
break;
default:
return SColor(255,200,200,200);
break;
}// TODO: Make this function modular
}
Unstable Version/1.2b/IrrColor.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Version 1.1
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRCOLOR_H
#define IRRCOLOR_H
#include <iostream>
#include <strings.h>
#include "irrlicht.h"
#include "IrrLib.h"
class IrrColor {
private:
//who knows?
public:
void IrrColor::test();
irr::video::SColor IrrColor::returnColor(std::string color);
};
#endif
Unstable Version/1.2b/IrrLib.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Version 1.1
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <irrlicht.h>
#include <strings.h>
#include "IrrLib.h"
//Libraries we create go here
#include "IrrSphere.h"
#include "IrrColor.h"
#include "Irr2D.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
//TODO: Create own class for handling inputs!
/*IrrLib::IrrLib(MastEventReceiver & receiver){
this->device = createDevice(EDT_SOFTWARE, dimension2d<s32>(640, 480), 16, false, false, false, &receiver);
if (this->device == 0)
exit(1);
IrrLib::Init();
}*/
IrrLib::IrrLib(){
this->device = createDevice(EDT_SOFTWARE, dimension2d<s32>(640, 480), 16, false, false, false, 0);
if (this->device == 0)
exit(1);
IrrLib::Init();
}
IrrLib::IrrLib(video::E_DRIVER_TYPE drivertype, core::dimension2d<s32> & res, u32 bits, bool fullscreen, bool stencilbuffer, bool vsync){
//MyEventReceiver receiver;
this->device = createDevice(drivertype, res, bits, fullscreen, stencilbuffer, vsync, 0);
if (this->device == 0)
exit(1);
IrrLib::Init();
}
IrrLib::IrrLib(int nDrivertype, int width, int height, int bits, bool fullscreen, bool stencilbuffer, bool vsync){
//MyEventReceiver receiver;
video::E_DRIVER_TYPE drivertype;
switch (nDrivertype){
case 0: //TODO: finish this switch case
drivertype = EDT_NULL;
break;
case 1:
drivertype = EDT_SOFTWARE;
break;
case 2:
drivertype = EDT_BURNINGSVIDEO;
break;
case 3:
drivertype = EDT_OPENGL;
break;
case 4:
drivertype = EDT_DIRECT3D8;
//TODO: Find how to detect if DX is complied into Irrlicht
//TODO: Find how to detecht for linux
break;
case 5:
drivertype = EDT_DIRECT3D9;
break;
default:
drivertype = EDT_SOFTWARE;
break;
}
this->device = createDevice(drivertype, dimension2d<s32>(width, height), bits, fullscreen, stencilbuffer, vsync, 0);
if (this->device == 0)
exit(1);
IrrLib::Init();
}
IrrLib::~IrrLib (){ //Our moms wont clean up after us!
//Although I'm sure Irrlicht does this for us already, its always a good idea to check!
/*if (this->device != NULL)
delete this->device;
if (this->driver != NULL)
delete this->driver;
if (this->smgr != NULL)
delete this->smgr;
if (this->mesh != NULL)
delete this->mesh;
if (this->node != NULL)
delete this->node;*/ //it seems Irrlicht picks up after us...
//however we created newNodes, now we need to delete it!
}
void IrrLib::Init(){
//this->numNodes = 0;
//this->nodeNew = new ISceneNode[10];
this->driver = this->device->getVideoDriver();
this->smgr = this->device->getSceneManager();
Sphere.SetSmgr(this->smgr);
Sphere.SetDriver(this->driver);
Irr2DLib.SetSmgr(this->smgr);
Irr2DLib.SetDriver(this->driver);
}
void IrrLib::ReadArchive(std::string file){
this->device->getFileSystem()->addZipFileArchive(file.c_str());
}
void IrrLib::LoadQ3Level(std::string q3level){
this->mesh = this->smgr->getMesh(q3level.c_str());
this->node = 0;
if (this->mesh)
this->node = this->smgr->addOctTreeSceneNode(this->mesh->getMesh(0), 0, -1, 128);
}
void IrrLib::NodePos(int x, int y, int z){
if (this->node)
this->node->setPosition(core::vector3df(x, y, z));
}
void IrrLib::NodePos(){
if (this->node)
this->node->setPosition(core::vector3df(0, 0, 0));
}
void IrrLib::AddFPSCam(){
this->cam = this->smgr->addCameraSceneNodeFPS();
}
void IrrLib::AddFPSCam(f32 x, f32 y, f32 z)
{
this->cam = this->smgr->addCameraSceneNodeFPS();
this->cam->setPosition(irr::core::vector3df(x, y, z));
}
void IrrLib::VisibleCursor(bool tf){
if (tf == false)
this->device->getCursorControl()->setVisible(false);
else
this->device->getCursorControl()->setVisible(true);
}
int IrrLib::GetFPSCount(){
return this->driver->getFPS();
}
bool IrrLib::DeviceIsRunning(){
return this->device->run();
}
bool IrrLib::IsActiveWindow(){
return this->device->isWindowActive();
}
void IrrLib::BeginScene(){
this->driver->beginScene(true, true, video::SColor(0,200,200,200));
}
void IrrLib::BeginScene(irr::video::SColor color){
this->driver->beginScene(true, true, color);
}
void IrrLib::BeginScene(bool usebackBuffer, bool usezBuffer, irr::video::SColor color){
this->driver->beginScene(usebackBuffer, usezBuffer, color);
}
void IrrLib::DrawAll(){
this->smgr->drawAll();
//this->device->getGUIEnvironment()->drawAll();
}
void IrrLib::EndScene(){
this->driver->endScene();
}
void IrrLib::SetWindowCaption(stringw str){
this->device->setWindowCaption(str.c_str());
}
irr::core::stringw IrrLib::GetDriverName(){
return this->driver->getName();
}
void IrrLib::EndIrrlicht(){
this->device->drop();
}
void IrrLib::KeyPress(char key){
this->key = key;
}
char IrrLib::KeyPressed(){
return key;
}
Unstable Version/1.2b/IrrLib.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Version 1.1
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRLIB_H
#define IRRLIB_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
#include "IrrSphere.h"
#include "IrrColor.h"
#include "Irr2D.h"
//Start class
class IrrLib {
private:
/* Create an Irrlicht device as private because the class should handle
All irrlicht interaction */
irr::IrrlichtDevice *device;
// Tells Irrlicht what driver to use
//video::E_DRIVER_TYPE driverType;
/*
Get a pointer to the video driver and the SceneManager so that
we do not always have to write device->getVideoDriver() and
device->getSceneManager().
*/
irr::video::IVideoDriver* driver;
irr::scene::ISceneManager* smgr;
/*
Get a pointer to the 'mesh' aka the level.
Note: This is for Quake3 levels, ie bsp maps.
*/
irr::scene::IAnimatedMesh* mesh;
irr::scene::ISceneNode* node;
irr::scene::ISceneNode * tempNode; //use this to store nodeNew's data so we can resize it
irr::scene::ICameraSceneNode * cam;
char key;
void IrrLib::Init();
public:
IrrSphere Sphere; //This has to be public to be able to access the Sphere class
//Prehaps put this into a IrrLib3D class?
IrrColor Color; //Color class...not much of a class but lets keep it OO
Irr2D Irr2DLib; //1/2 variable to be labeled like this due to variables not able to begin with a number
IrrLib::IrrLib();
//IrrLib::IrrLib(MastEventReceiver & receiver);
IrrLib::IrrLib(irr::video::E_DRIVER_TYPE drivertype, irr::core::dimension2d<irr::s32> & res, irr::u32 bits, bool fullscreen, bool stencilbuffer, bool vsync);
IrrLib::IrrLib(int drivertype, int width, int height, int bits, bool fullscreen, bool stencilbuffer, bool vsync);
IrrLib::~IrrLib(); //Our moms wont clean up after us!
void IrrLib::ReadArchive(std::string file);
void IrrLib::LoadQ3Level(std::string q3level);
void IrrLib::NodePos(int x, int y, int z); //I think this moves the actual camera?
void IrrLib::NodePos();
void IrrLib::AddFPSCam();
void IrrLib::AddFPSCam(irr::f32 x, irr::f32 y, irr::f32 z);
void IrrLib::VisibleCursor(bool tf);
int IrrLib::GetFPSCount();
bool IrrLib::DeviceIsRunning();
bool IrrLib::IsActiveWindow();
void IrrLib::BeginScene();
void IrrLib::BeginScene(irr::video::SColor color);
void IrrLib::BeginScene(bool usebackBuffer, bool usezBuffer, irr::video::SColor color);
//TODO: Add one more for human readable colors and hex colors!
void IrrLib::DrawAll();
void IrrLib::EndScene();
void IrrLib::SetWindowCaption(irr::core::stringw str);
irr::core::stringw IrrLib::GetDriverName();
//TODO: Make function to turn stringw to string and visa versa
void IrrLib::EndIrrlicht(); //Renamed from KillIrrlicht to EndIrrlicht
//TODO: Add logging
void IrrLib::KeyPress(char key);
char IrrLib::KeyPressed();
};
#endif
Unstable Version/1.2b/IrrSphere.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Version 1.1
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include "IrrLib.h"
#include "IrrSphere.h"
#include <irrlicht.h>
#include <strings.h>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
void IrrSphere::SetSmgr(irr::scene::ISceneManager* smgr){
this->smgr = smgr;
}
void IrrSphere::SetDriver(irr::video::IVideoDriver* driver){
this->driver = driver;
}
int IrrSphere::CreateNewSphereNode(int x, int y, int z, std::string texture, bool light){
//TODO: Resize after 10, and add 10 more to the mix!
this->nodeNew[this->numNodes] = this->smgr->addSphereSceneNode();
this->nodeNew[this->numNodes]->setPosition(core::vector3df(x,y,z));
this->nodeNew[this->numNodes]->setMaterialTexture(0, this->driver->getTexture(texture.c_str()));
this->nodeNew[this->numNodes]->setMaterialFlag(video::EMF_LIGHTING, light);
this->numNodes++;
return this->numNodes--;
/*this->node = this->smgr->addSphereSceneNode();
this->node->setPosition(core::vector3df(x,y,z));
this->node->setMaterialTexture(0, this->driver->getTexture(texture.c_str()));
this->node->setMaterialFlag(video::EMF_LIGHTING, light);*/
}
irr::core::vector3df IrrSphere::GetSphereVector(int sphere){
return this->nodeNew[sphere]->getPosition();
}
void IrrSphere::SetSphereVector(int sphere, irr::core::vector3df v){
this->nodeNew[sphere]->setPosition(v);
}
IrrSphere::IrrSphere(){
this->numNodes = 0;
}
IrrSphere::~IrrSphere(){
for(int i = 0; i < numNodes; ++i)
delete this->nodeNew[i];
delete this->nodeNew;
}
Unstable Version/1.2b/IrrSphere.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Version 1.1
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRSPHERE_H
#define IRRSPHERE_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
#include "IrrLib.h"
class IrrSphere
{
private:
irr::scene::ISceneNode* nodeNew[10];
int numNodes;
irr::scene::ISceneManager* smgr;
irr::video::IVideoDriver* driver;
public:
void IrrSphere::SetDriver(irr::video::IVideoDriver* driver);
void IrrSphere::SetSmgr(irr::scene::ISceneManager* smgr);
int IrrSphere::CreateNewSphereNode(int x, int y, int z, std::string texture, bool light); //this is going to take my advanced C++ skillz!
irr::core::vector3df IrrSphere::GetSphereVector(int sphere);
void IrrSphere::SetSphereVector(int sphere, irr::core::vector3df v);
IrrSphere::IrrSphere();
IrrSphere::~IrrSphere();
};
#endif
Unstable Version/1.3.0/CHANGES
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
Version 1.2
+ Added a Irr3DLib class that will control all 3D objects
+ Also Added a Irr2D class that works on the same concept.
+ IrrSphere is now owned by Irr3DLib
+ Updated the examples using the latest code
Version 1.2.2
+ Added IrrEventReciever to handle all input
- Still under work
+ Fixed some misc coding bugs
+ Added template class
+ Added sprite class
+ Added GUI class
Version 1.2.3
+ IrrEventReciver now works as advertised
+ Baseclass is now being used
+ A couple somewhat-useful functions
+ int_to_string
+ stringw_to_stdstring
+ stdstring_to_stringw
+ GUI elements
+ Static text is working
+ Under construction for a data type class
Version 1.2.4
+ Implmented color codes accessiable through the class
+ IrrLib.Color.RED (ect)
Version 1.2.5
+ Implmented mouse events
+ IrrLib.IrrEvent.getMouseX();
+ IrrLib.IrrEvent.getMouseY();
+ Using vectors instead of static arrays
+ Side note: Was going to use dynamic arrays, but C++ has vectors which are 10x better.
+ Added a default exit for when you hit esc
+ Use IrrLib.IrrEvent.SetEscExit(false) to turn that off for your software
+ Use IrrLib.IrrEvent.SetEscExit(true) to turn it back on
+ Every stable version will now include a windows DLL.
+ Possible Linux .so file in the future.
Version 1.2.6
+ Added a IrrEvent for buttons
+ IrrLib.IrrEvent.checkButtonState();
+ See example for use
+ Added an AddButton function
+ IrrLib.GUI.AddButton(..);
+ See example for use
+ Problems with making the DLL
+ reasearching
Version 1.2.7
+ Fixed DLL Problem
+ Added an enum example to example 1
+ Added more examples
+ Added example 9
+ Added left click handling (see example 9)
+ Added AddLines function to Irr2D
+ DrawLines function in Irr2D will draw the lines you add
Version 1.2.9
+ Added Listbox GUI object
+ Added a new datatype IrrObj
+ Contains 2 ints, 1 for object id and 1 for event id
+ Added a IrrData.h file
Unstable Version/1.3.0/CREDITS
1
2
3
4
5
6
7
8
IrrLib
Created by
Nathan Adams
Denzel Morris
From #irrlicht
Acid
wacom
Unstable Version/1.3.0/Irr2D.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
//#include "IrrLib.h"
//#include "IrrSphere.h" //You probably aren't going to be using 3D objects in a 2D environment!
#include <irrlicht.h>
#include <strings.h>
#include "Irr2D.h"
#include "IrrSprite.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
Irr2D::Irr2D(){
this->numTextures = 0;
this->numLines = 0;
//NA Should we set textures to new
}
Irr2D::~Irr2D(){
/*for(int i = 0; i < numTextures; ++i)
delete this->textures[i];
delete this->textures;*/
//No more dynamic memory business yay! NA
}
void Irr2D::SetSmgr(irr::scene::ISceneManager* smgr){
this->smgr = smgr;
Sprite.SetSmgr(smgr);
}
void Irr2D::SetDriver(irr::video::IVideoDriver* driver){
this->driver = driver;
Sprite.SetDriver(driver);
}
void Irr2D::LoadTexturemap(std::string file){
this->texturemap = driver->getTexture(file.c_str());
}
int Irr2D::LoadTexture(std::string file){
//this->textures[this->numTextures] = driver->getTexture(file.c_str());
textures.push_back(driver->getTexture(file.c_str()));
this->numTextures++;
return numTextures--;
}
void Irr2D::DrawLine(irr::core::position2d<irr::s32>& start, irr::core::position2d<irr::s32>& end, irr::video::SColor& color)
{
this->driver->draw2DLine(start, end, color);
}
void Irr2D::AddLines(irr::core::position2d<irr::s32>& start, irr::core::position2d<irr::s32>& end, irr::video::SColor& color)
{
this->start.push_back(start);
this->end.push_back(end);
this->color.push_back(color);
this->numLines++;
}
void Irr2D::DrawLines()
{
for(int i = 0; i < numLines; ++i)
this->driver->draw2DLine(this->start[i], this->end[i], this->color[i]);
}
Unstable Version/1.3.0/Irr2D.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRR2D_H
#define IRR2D_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
#include <vector>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
//#include "IrrLib.h"
#include "IrrSprite.h"
class Irr2D {
private:
irr::scene::ISceneManager* smgr;
irr::video::IVideoDriver* driver;
irr::video::ITexture* texturemap;
int numTextures;
//irr::video::ITexture* textures[10];
std::vector<irr::video::ITexture*> textures;
std::vector<irr::core::position2d<irr::s32> > start;
std::vector<irr::core::position2d<irr::s32> > end;
std::vector<irr::video::SColor> color;
int numLines;
public:
//Irr2D::Irr2D();
IrrSprite Sprite;
Irr2D::Irr2D();
Irr2D::~Irr2D();
void Irr2D::SetDriver(irr::video::IVideoDriver* driver);
void Irr2D::SetSmgr(irr::scene::ISceneManager* smgr);
void Irr2D::LoadTexturemap(std::string file);
int Irr2D::LoadTexture(std::string file);
void Irr2D::DrawImage(int texture, const irr::core::position2d<irr::s32> & destPos);
void Irr2D::DrawImage(const irr::core::position2d<irr::s32> & destPos, const irr::core::rect<irr::s32> & sourceRect, const irr::core::rect<irr::s32> * clipRect, irr::video::SColor color, bool useAlphaChannelOfTexture);
void Irr2D::DrawLine(irr::core::position2d<irr::s32>& start, irr::core::position2d<irr::s32>& end, irr::video::SColor& color);
void Irr2D::DrawLines();
void Irr2D::AddLines(irr::core::position2d<irr::s32>& start, irr::core::position2d<irr::s32>& end, irr::video::SColor& color);
};
#endif
Unstable Version/1.3.0/Irr3D.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <strings.h>
//#include "IrrLib.h"
//Libraries we create go here
#include "IrrSphere.h"
//#include "IrrColor.h"
#include "Irr3D.h"
#include <irrlicht.h>
//#include "Irr2D.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
void Irr3D::SetDriver(irr::video::IVideoDriver* driver) //so much for copying and pasting code from the header file
{
this->driver = driver;
Sphere.SetDriver(driver);
}
void Irr3D::SetSmgr(irr::scene::ISceneManager* smgr)
{
this->smgr = smgr;
Sphere.SetSmgr(smgr);
}
Irr3D::Irr3D()
{
//do stuff here!
}
Irr3D::~Irr3D()
{
//delete stuff here!
}
Unstable Version/1.3.0/Irr3D.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRR3D_H
#define IRR3D_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
#include "IrrSphere.h"
//#include "IrrColor.h"
//#include "Irr3D.h"
//#include "Irr2D.h" This is a 3D class not 2D
/* However due to Irrlciht's nature mixing 2D with 3D is possible */
//Start class
class Irr3D {
private:
irr::video::IVideoDriver* driver;
irr::scene::ISceneManager* smgr;
public:
IrrSphere Sphere;
Irr3D::Irr3D();
Irr3D::~Irr3D();
void Irr3D::SetDriver(irr::video::IVideoDriver* driver);
void Irr3D::SetSmgr(irr::scene::ISceneManager* smgr);
};
#endif
Unstable Version/1.3.0/IrrColor.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <irrlicht.h>
#include <strings.h>
//#include "IrrLib.h"
#include "IrrColor.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
void IrrColor::Init(){
/*SColor * temp;
temp = new SColor(alpha, 255, 0, 0);
this->RED = temp;
delete temp;*/
this->RED = new SColor(alpha, 255, 0, 0);
this->ORANGE = new SColor(alpha, 255, 165, 0);
this->YELLOW = new SColor(alpha, 255, 255, 0);
this->GREEN = new SColor(alpha, 0, 255, 0);
this->BLUE = new SColor(alpha, 0, 0, 255);
this->DARK_GREEN = new SColor(alpha, 0, 100, 0);
this->PINK = new SColor(alpha, 255, 192, 203);
this->GREY = new SColor(alpha, 190, 190, 190);
this->WHITE = new SColor(alpha, 0, 0, 0);
this->BLACK = new SColor(alpha, 0, 0, 0);
}
IrrColor::~IrrColor(){
delete this->RED;
delete this->ORANGE;
delete this->YELLOW;
delete this->GREEN;
delete this->BLUE;
delete this->DARK_GREEN;
delete this->PINK;
delete this->GREY;
delete this->WHITE;
delete this->BLACK;
}
IrrColor::IrrColor(){
this->alpha = 255;
Init();
}
IrrColor::IrrColor(irr::u32 alpha){
this->alpha = alpha;
Init();
}
int IrrColor::getAlpha(){
return this->alpha;
}
void IrrColor::setAlpha(int alpha){
this->alpha = alpha;
}
SColor IrrColor::returnColor(std::string color){
int nColor = -1;
if (color == "red")
nColor = 1;
else if (color == "green")
nColor = 2;
else if (color == "blue")
nColor = 3;
else if (color == "dark green")
nColor = 4;
else if (color == "pink")
nColor = 5;
else if (color == "grey")
nColor = 6;
switch (nColor){
case 1:
return SColor(255, 255, 0, 0);
break;
case 2:
return SColor(255, 0, 255, 0);
break;
case 3:
return SColor(255, 0, 0, 255);
break;
case 4:
return SColor(255, 0, 50, 0);
break;
case 5:
return SColor(255, 255, 10, 255);
break;
case 6:
return SColor(255,200,200,200);
break;
default:
return SColor(255,200,200,200);
break;
}// TODO: Make this function modular
}
Unstable Version/1.3.0/IrrColor.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRCOLOR_H
#define IRRCOLOR_H
#include <iostream>
#include <strings.h>
#include "irrlicht.h"
//#include "IrrLib.h"
class IrrColor {
private:
irr::u32 alpha;
void Init();
//who knows?
public:
//irr::video::SColor(alpha, 255, 0, 0);
const irr::video::SColor* RED;
const irr::video::SColor* ORANGE;
const irr::video::SColor* YELLOW;
const irr::video::SColor* GREEN;
const irr::video::SColor* BLUE;
const irr::video::SColor* DARK_GREEN;
const irr::video::SColor* PINK;
const irr::video::SColor* GREY;
const irr::video::SColor* WHITE;
const irr::video::SColor* BLACK;
/*const ORANGE = irr::video::SColor(alpha, 255, 165, 0);
const YELLOW = irr::video::SColor(alpha, 255, 255, 0);
const GREEN = irr::video::SColor(alpha, 0, 255, 0);
const BLUE = irr::video::SColor(alpha, 0, 0, 255);
const DARK_GREEN = irr::video::SColor(alpha, 0, 100, 0);
const PINK = irr::video::SColor(alpha, 255, 192, 203);
const GREY = irr::video::Scolor(alpha, 190, 190, 190);*/
//void IrrColor::test();
IrrColor();
IrrColor(irr::u32 alpha);
~IrrColor();
int getAlpha();
void setAlpha(int alpha);
irr::video::SColor IrrColor::returnColor(std::string color);
};
#endif
Unstable Version/1.3.0/IrrData.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#ifndef IRRDATA_H
#define IRRDATA_H
typedef irr::core::dimension2d<irr::s32> PixelSize;
struct pixels {
int width;
int height;
}; //possible future use in 2D objects when specifying the properties of an object draw
struct IrrObj {
int eventid;
int objectid;
};
struct _mouse {
int x;
int y;
};
#endif
Unstable Version/1.3.0/IrrEventReciever.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include "IrrEventReciever.h"
//#include "IrrLib.h"
#include <irrlicht.h>
#include <iostream>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
/*void IrrEventReciever::setIrrLib(IrrLib& IrrLib)
{
this.callingIrrLib = IrrLib;
}*/
IrrEventReciever::IrrEventReciever()
{
this->escexit = true;
this->mouse.x = 0;
this->mouse.y = 0;
}
bool IrrEventReciever::OnEvent(SEvent event)
{
// A button was clicked
if (event.EventType == irr::EET_GUI_EVENT)
{
s32 id = event.GUIEvent.Caller->getID();
switch(event.GUIEvent.EventType){
case EGET_BUTTON_CLICKED:
//cout << id << endl;
buttonStates.push_back(id);
break;
case EGET_LISTBOX_CHANGED:
//s32 id = event.GUIEvent.Caller->getID();
listStates.push_back(id);
break;
case EGET_LISTBOX_SELECTED_AGAIN:
listStates.push_back(id);
break;
default:
break;
}
}
/*if (event.EventType == irr::EGET_SCROLL_BAR_CHANGED)
{
}*/
if (event.EventType == irr::EET_KEY_INPUT_EVENT) {
if (!event.KeyInput.PressedDown){
this->keyStates[event.KeyInput.Key] = false;
//cout << "Key was not hit " << this->keyStates[event.KeyInput.Key] << endl;
}
else{
if(event.KeyInput.Key == KEY_ESCAPE && escexit)
this->device->closeDevice();
this->keyStates[event.KeyInput.Key] = true;
//cout << "Key was hit: " << event.KeyInput.Key << " " << this->keyStates[event.KeyInput.Key] << endl;
}
}
if (event.EventType == EET_MOUSE_INPUT_EVENT){
if (event.MouseInput.Event == EMIE_MOUSE_MOVED){
this->mouse.x = event.MouseInput.X;
this->mouse.y = event.MouseInput.Y;
}
if (event.MouseInput.Event == EMIE_LMOUSE_PRESSED_DOWN)
this->mouseStates[0] = true;
if (event.MouseInput.Event == EMIE_LMOUSE_LEFT_UP)
this->mouseStates[0] = false;
}
return false;
}
void IrrEventReciever::SetEscExit(bool onoff)
{
this->escexit = onoff;
}
int IrrEventReciever::getMouseX()
{
return this->mouse.x;
}
int IrrEventReciever::getMouseY()
{
return this->mouse.y;
}
int IrrEventReciever::getButtonState()
{
if(!this->buttonStates.empty()){
int id;
id = buttonStates.back();
this->buttonStates.pop_back();
return id;
}
else
return -1;
}
int IrrEventReciever::getRevButtonState()
{
if(!this->buttonStates.empty()){
int id = buttonStates.front();
this->buttonStates.erase(buttonStates.begin());
return id;
}
else
return -1;
}
void IrrEventReciever::clearButtonState()
{
this->buttonStates.clear();
}
int IrrEventReciever::checkButtonState()
{
if(!this->buttonStates.empty())
return this->buttonStates.back();
else
return -1;
}
void IrrEventReciever::delLastButtonStat()
{
if(!this->buttonStates.empty())
this->buttonStates.pop_back();
}
bool IrrEventReciever::isButtonStateEmpty()
{
return this->buttonStates.empty();
}
int IrrEventReciever::checkListState()
{
if(!this->listStates.empty())
return this->listStates.back();
else
return -1;
}
void IrrEventReciever::delLastListStat()
{
if(!this->listStates.empty())
this->listStates.pop_back();
}
Unstable Version/1.3.0/IrrEventReciever.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRREVENTRECIEVER_H
#define IRREVENTRECIEVER_H
//#include "IrrLib.h"
#include <vector>
#include <irrlicht.h>
#include "IrrLibBase.h"
#include "IrrData.h"
#include <stdlib.h>
class IrrEventReciever : public irr::IEventReceiver, public IrrLibBase
{
private:
//IrrLib callingIrrLib;
_mouse mouse;
bool escexit;
std::vector<int> buttonStates;
std::vector<int> listStates;
public:
bool mouseStates[1];
IrrEventReciever();
int getMouseX();
int getMouseY();
bool keyStates[irr::KEY_KEY_CODES_COUNT];
//void setIrrLib(IrrLib& IrrLib)
virtual bool OnEvent(irr::SEvent event);
void SetEscExit(bool onoff);
int getButtonState();
int getRevButtonState();
void clearButtonState();
int checkButtonState();
void delLastButtonStat();
bool isButtonStateEmpty(); //is there still stuff in the vector to be done? NA
int checkListState();
void delLastListStat();
};
#endif
Unstable Version/1.3.0/IrrLib.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <irrlicht.h>
#include <strings.h>
#include <sstream>
#include <time.h>
#include "IrrLib.h"
//Libraries we create go here
//#include "IrrSphere.h"
#include "IrrColor.h"
//#include "Irr2D.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
//TODO: Create own class for handling inputs!
/*IrrLib::IrrLib(MastEventReceiver & receiver){
this->device = createDevice(EDT_SOFTWARE, dimension2d<s32>(640, 480), 16, false, false, false, &receiver);
if (this->device == 0)
exit(1);
IrrLib::Init();
}*/
IrrLib::IrrLib(){
this->device = createDevice(EDT_SOFTWARE, dimension2d<s32>(640, 480), 16, false, false, false, &this->IrrEvent);
if (this->device == 0)
exit(1);
IrrLib::Init();
}
IrrLib::IrrLib(video::E_DRIVER_TYPE drivertype, core::dimension2d<s32> & res, u32 bits, bool fullscreen, bool stencilbuffer, bool vsync){
//MyEventReceiver receiver;
this->device = createDevice(drivertype, res, bits, fullscreen, stencilbuffer, vsync, &this->IrrEvent);
if (this->device == 0)
exit(1);
IrrLib::Init();
}
IrrLib::IrrLib(int nDrivertype, int width, int height, int bits, bool fullscreen, bool stencilbuffer, bool vsync){
//MyEventReceiver receiver;
video::E_DRIVER_TYPE drivertype;
switch (nDrivertype){
case 0: //TODO: finish this switch case
drivertype = EDT_NULL;
break;
case 1:
drivertype = EDT_SOFTWARE;
break;
case 2:
drivertype = EDT_BURNINGSVIDEO;
break;
case 3:
drivertype = EDT_OPENGL;
break;
case 4:
drivertype = EDT_DIRECT3D8;
//*Note: It seems as Microsoft has stoped supporting DX 8.1, so you can not compile it into Irrlicht engine anymore
//TODO: Find how to detect if DX is complied into Irrlicht
//TODO: Find how to detecht for linux
break;
case 5:
drivertype = EDT_DIRECT3D9;
break;
default:
drivertype = EDT_SOFTWARE;
break;
}
this->device = createDevice(drivertype, dimension2d<s32>(width, height), bits, fullscreen, stencilbuffer, vsync, &this->IrrEvent);
if (this->device == 0)
exit(1);
IrrLib::Init();
}
IrrLib::~IrrLib (){ //Our moms wont clean up after us!
//Although I'm sure Irrlicht does this for us already, its always a good idea to check!
/*if (this->device != NULL)
delete this->device;
if (this->driver != NULL)
delete this->driver;
if (this->smgr != NULL)
delete this->smgr;
if (this->mesh != NULL)
delete this->mesh;
if (this->node != NULL)
delete this->node;*/ //it seems Irrlicht picks up after us...
//however we created newNodes, now we need to delete it!
}
void IrrLib::Init(){
//this->numNodes = 0;
//this->nodeNew = new ISceneNode[10];
//this->env->addStaticText(L"Transparent Control:", rect<s32>(20,30,300,80), true);
this->env = this->device->getGUIEnvironment();
this->driver = this->device->getVideoDriver();
this->smgr = this->device->getSceneManager();
Irr3DLib.SetSmgr(this->smgr);
Irr3DLib.SetDriver(this->driver);
Irr2DLib.SetSmgr(this->smgr);
Irr2DLib.SetDriver(this->driver);
GUI.SetEnv(this->env);
IrrEvent.SetDevice(this->device);
this->timer = this->device->getTimer();
tick = this->timer->getRealTime();
}
void IrrLib::ReadArchive(std::string file){
this->device->getFileSystem()->addZipFileArchive(file.c_str());
}
void IrrLib::LoadQ3Level(std::string q3level){
this->mesh = this->smgr->getMesh(q3level.c_str());
this->node = 0;
if (this->mesh)
this->node = this->smgr->addOctTreeSceneNode(this->mesh->getMesh(0), 0, -1, 128);
}
void IrrLib::MapPos(int x, int y, int z){
if (this->node)
this->node->setPosition(core::vector3df(x, y, z));
}
void IrrLib::MapPos(){
if (this->node)
this->node->setPosition(core::vector3df(0, 0, 0));
}
void IrrLib::AddFPSCam(){
this->cam = this->smgr->addCameraSceneNodeFPS();
}
void IrrLib::AddFPSCam(f32 x, f32 y, f32 z)
{
this->cam = this->smgr->addCameraSceneNodeFPS();
this->cam->setPosition(irr::core::vector3df(x, y, z));
}
void IrrLib::VisibleCursor(bool tf){
if (tf == false)
this->device->getCursorControl()->setVisible(false);
else
this->device->getCursorControl()->setVisible(true);
}
int IrrLib::GetFPSCount(){
return this->driver->getFPS();
}
bool IrrLib::DeviceIsRunning(){
return this->device->run();
}
bool IrrLib::IsActiveWindow(){
return this->device->isWindowActive();
}
void IrrLib::BeginScene(){
this->driver->beginScene(true, true, video::SColor(0,200,200,200));
}
void IrrLib::BeginScene(irr::video::SColor color){
this->driver->beginScene(true, true, color);
}
void IrrLib::BeginScene(bool usebackBuffer, bool usezBuffer, irr::video::SColor color){
this->driver->beginScene(usebackBuffer, usezBuffer, color);
}
void IrrLib::DrawAll(){
//position2d<int> start(50, 50);
//position2d<int> end(100,100);
// SColor whitecolor(255,255,255,255);
//driver->draw2DLine(start, end, whitecolor);
this->smgr->drawAll();
this->env->drawAll();
//this->device->getGUIEnvironment()->drawAll();
}
void IrrLib::EndScene(){
this->driver->endScene();
}
void IrrLib::SetWindowCaption(stringw str){
this->device->setWindowCaption(str.c_str());
}
irr::core::stringw IrrLib::GetDriverName(){
return this->driver->getName();
}
void IrrLib::EndIrrlicht(){
if(this->device != NULL){
this->device->drop();
this->device = NULL;
}
}
void IrrLib::KeyPress(char key){
this->key = key;
}
char IrrLib::KeyPressed(){
return key;
}
irr::f32 IrrLib::getX(){
return this->smgr->getActiveCamera()->getPosition().X;
}
irr::f32 IrrLib::getY(){
return this->smgr->getActiveCamera()->getPosition().Y;
}
irr::f32 IrrLib::getZ(){
return this->smgr->getActiveCamera()->getPosition().Z;
}
bool IrrLib::CheckGameLoop(){
u32 now;
now = this->timer->getRealTime();
if ((now - this->tick) >= 30){
//this->tick == time (NULL);
return true;
} else {
return false;
}
}
bool IrrLib::CheckGameLoop(u32 ms){
u32 now;
now = this->timer->getRealTime();
if ((now - this->tick) >= ms){
this->tick = now;
return true;
} else {
return false;
}
}
void IrrLib::Exit()
{
this->device->closeDevice();
}
PixelSize IrrLib::GetScreenSize()
{
return this->driver->getScreenSize();
/*pixels returnres;
returnres.width = screenres.Width;
returnres.height = screenres.Height;
return returnres;*/
}
//template <class T> std::string IrrLib::to_string (T t)
/*std::string IrrLib::int_to_string (int t)
{
std::stringstream ss;
ss << t;
return ss.str();
}*/
// This is in the base class now, every class that decends from that class has this ability.
Unstable Version/1.3.0/IrrLib.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRLIB_H
#define IRRLIB_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
#include <irrlicht.h>
#include <time.h>
/* We have to include Irrlichts libs */
#include "Irr3D.h"
#include "IrrColor.h"
#include "IrrLibGUI.h"
#include "IrrEventReciever.h"
#include "Irr2D.h"
#include "IrrLibBase.h"
#include "IrrData.h"
/*struct IrrObj {
int eventid;
int objectid;
};*/
//Start class
class IrrLib: public IrrLibBase {
private:
/* Create an Irrlicht device as private because the class should handle
All irrlicht interaction */
irr::IrrlichtDevice *device;
// Tells Irrlicht what driver to use
//video::E_DRIVER_TYPE driverType;
/*
Get a pointer to the video driver and the SceneManager so that
we do not always have to write device->getVideoDriver() and
device->getSceneManager().
*/
irr::video::IVideoDriver* driver;
irr::scene::ISceneManager* smgr;
irr::gui::IGUIEnvironment* env;
/*
Get a pointer to the 'mesh' aka the level.
Note: This is for Quake3 levels, ie bsp maps.
*/
irr::scene::IAnimatedMesh* mesh;
irr::scene::ISceneNode* node;
irr::scene::ISceneNode * tempNode; //use this to store nodeNew's data so we can resize it
irr::scene::ICameraSceneNode * cam;
char key;
void IrrLib::Init();
/*friend class IrrColor;
friend class Irr2DLib;
friend class Sphere;*/
friend class IrrEventReciever;
irr::u32 tick;
irr::ITimer* timer;
public:
//IrrSphere Sphere; //This has to be public to be able to access the Sphere class
/* IrrSphere is now in Irr3D class */
//Prehaps put this into a IrrLib3D class?
Irr3D Irr3DLib;
IrrColor Color; //Color class...not much of a class but lets keep it OO
Irr2D Irr2DLib; //1/2 variable to be labeled like this due to variables not able to begin with a number
IrrLibGUI GUI;
IrrEventReciever IrrEvent;
IrrLib::IrrLib();
//IrrLib::IrrLib(MastEventReceiver & receiver);
IrrLib::IrrLib(irr::video::E_DRIVER_TYPE drivertype, irr::core::dimension2d<irr::s32> & res, irr::u32 bits, bool fullscreen, bool stencilbuffer, bool vsync);
IrrLib::IrrLib(int drivertype, int width, int height, int bits, bool fullscreen, bool stencilbuffer, bool vsync);
IrrLib::~IrrLib(); //Our moms wont clean up after us!
void IrrLib::ReadArchive(std::string file);
void IrrLib::LoadQ3Level(std::string q3level);
void IrrLib::MapPos(int x, int y, int z); //I think this moves the actual camera?
void IrrLib::MapPos();
void IrrLib::AddFPSCam();
void IrrLib::AddFPSCam(irr::f32 x, irr::f32 y, irr::f32 z);
void IrrLib::VisibleCursor(bool tf);
int IrrLib::GetFPSCount();
bool IrrLib::DeviceIsRunning();
bool IrrLib::IsActiveWindow();
void IrrLib::BeginScene();
void IrrLib::BeginScene(irr::video::SColor color);
//void IrrLib::BeginScene(irr::video::SColor * color);
void IrrLib::BeginScene(bool usebackBuffer, bool usezBuffer, irr::video::SColor color);
//TODO: Add one more for human readable colors and hex colors!
void IrrLib::DrawAll();
void IrrLib::EndScene();
void IrrLib::SetWindowCaption(irr::core::stringw str);
irr::core::stringw IrrLib::GetDriverName();
//TODO: Make function to turn stringw to string and visa versa
void IrrLib::EndIrrlicht(); //Renamed from KillIrrlicht to EndIrrlicht
//TODO: Add logging
void IrrLib::KeyPress(char key);
char IrrLib::KeyPressed();
irr::f32 getX();
irr::f32 getY();
irr::f32 getZ();
bool CheckGameLoop();
bool CheckGameLoop(irr::u32 ms);
void Exit();
PixelSize GetScreenSize();
//void EndGameLoop();
//template <class T> std::string to_string (T t);
};
#endif
Unstable Version/1.3.0/IrrLibBase.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <irrlicht.h>
#include "IrrLibBase.h"
#include <strings.h>
#include <sstream>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
/*
* Code from http://articles.techrepublic.com.com/5100-22-5079969.html#
*
struct str_stream
{
std::stringstream & underlying_stream() const
{ return m_streamOut; }
operator std::string() const
{
return m_streamOut.str();
}
private:
mutable std::stringstream m_streamOut;
};
template< class type>
inline const str_stream & operator<< ( const str_stream & out, const type & value)
{
out.underlying_stream() << value;
return out;
}
template<class type> std::string to_string( const type & value)
{
std::ostringstream streamOut;
streamOut << value;
return streamOut.str();
}
* End code copy
*/
void IrrLibBase::SetDriver(IVideoDriver* driver) //can be overloaded
{
this->driver = driver;
}
void IrrLibBase::SetSmgr(ISceneManager* smgr)
{
this->smgr = smgr;
}
std::string IrrLibBase::wchar_to_stdstring (const wchar_t* wc)
{
//cout << "Starting conversion";
//wcstombs(tmp, in, 255);
char c[255];
for(int t = 0; wc[t] != '\0'; t++)
c[t] = (char)wc[t];
/*for(int t = 0; c[t] != '\0'; t++)
wc[t] = c[t];*/
std::stringstream ss;
ss << c;
//cout << "Conversion OK";
return ss.str();
}
std::string IrrLibBase::int_to_string (int t)
{
std::stringstream ss;
ss << t;
return ss.str();
}
std::string IrrLibBase::stringw_to_stdstring(irr::core::stringw sw)
{
std::stringstream ss;
ss << sw.c_str();
return ss.str();
}
irr::core::stringw IrrLibBase::stdstring_to_stringw(std::string ss)
{
stringw tmpw(ss.c_str());
return tmpw;
}
void IrrLibBase::SetDevice(irr::IrrlichtDevice *device)
{
this->device = device;
}
void IrrLibBase::init()
{
}
Unstable Version/1.3.0/IrrLibBase.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRLIBBASE_H
#define IRRLIBBASE_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
class IrrLibBase {
protected:
irr::video::IVideoDriver* driver;
irr::scene::ISceneManager* smgr;
irr::IrrlichtDevice *device;
public:
//template<class type> std::string to_string( const type & value);
irr::core::dimension2d<irr::s32> irrpixels;
void IrrLibBase::SetDriver(irr::video::IVideoDriver* driver);
void IrrLibBase::SetSmgr(irr::scene::ISceneManager* smgr);
void SetDevice(irr::IrrlichtDevice *device);
std::string int_to_string (int t);
std::string stringw_to_stdstring(irr::core::stringw sw);
irr::core::stringw stdstring_to_stringw(std::string ss);
std::string wchar_to_stdstring (const wchar_t* wc);
void init();
};
#endif
Unstable Version/1.3.0/IrrLibGUI.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <strings.h>
#include <irrlicht.h>
#include <vector>
#include <sstream>
#include "IrrLib.h"
#include "IrrData.h"
#include "IrrLibGUI.h"
#include "IrrLibBase.h"
#include <stdlib.h>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
template<class type> std::string to_string( const type & value)
{
std::ostringstream streamOut;
streamOut << value;
return streamOut.str();
}
IrrLibGUI::IrrLibGUI()
{
//NA does it need to do anything at init?
this->nStaticText = 0;
this->nButton = 0;
this->nButtonid = 100;
this->nListBoxid = 200;
this->nListBox = 0;
//this->nListBoxid = 300;
//this->arrStaticText = new IGUIStaticText[10];
//this->env = this->device->getGUIEnvironment(); //NA yes we do!
}
IrrLibGUI::~IrrLibGUI()
{
//NA Do we have to delete anything?
}
void IrrLibGUI::SetEnv(IGUIEnvironment* env)
{
this->env = env;
//env->addButton(rect<s32>(10,210,110,210 + 32), 0, 109, L"Quit", L"Exits Program");
}
int IrrLibGUI::addButton(const core::rect< s32 > & rectangle, IGUIElement *parent, s32 id, const wchar_t * text, const wchar_t * tooltiptext)
{
arrButton.push_back(this->env->addButton(rectangle, parent, id, text, tooltiptext));
++nButton;
++nButtonid;
return nButtonid - 1;
}
IrrObj IrrLibGUI::addListBox(const irr::core::rect< irr::s32 > &rectangle, IGUIElement * parent)
{
irr::gui::IGUIListBox* tmp = this->env->addListBox(rectangle, parent, nListBoxid);
arrListBox.push_back(tmp);
//we introduce a new datatype; IrroObj
IrrObj ret;
ret.eventid = nListBoxid;
ret.objectid = nListBox;
++nListBox;
++nListBoxid;
return ret;
}
IrrObj IrrLibGUI::AddListBox(int x1, int y1, int x2, int y2, IGUIElement * parent)
{
return addListBox(rect<s32>(x1, y1, x2, y2), parent);
}
IrrObj IrrLibGUI::AddListBox(const irr::core::rect< irr::s32 > &rectangle, IGUIElement * parent)
{
return addListBox(rectangle, parent);
}
void IrrLibGUI::AddStringToListBox(int nLbox, std::string text)
{
this->arrListBox[nLbox]->addItem(stdstring_to_stringw(text).c_str());
//this->arrListBox[0]->addItem(L"TEST");
}
std::string IrrLibGUI::getSelectListString(IrrObj lstbox)
{
//stringc tmp = this->arrListBox[lstbox]->getListItem(this->arrListBox[lstbox]->getSelected());
s32 selected = this->arrListBox[lstbox.objectid]->getSelected();
//const wchar_t* tmp = this->arrListBox[lstbox]->getListItem(selected);
//irr::core::stringw tmp;
char out[255];
//tmp = this->arrListBox[lstbox]->getText();
irr::core::stringc tmp(arrListBox[lstbox.objectid]->getListItem(arrListBox[lstbox.objectid]->getSelected()));
//cout << tmp.c_str() << endl;
//wcstombs(out, tmp, tmp.length());
//cout << tmp[0] << endl;
// std::stringstream ss;
//for (int i = 0; i < tmp.size(); ++i)
//ss << tmp.c_str();
std::string ret = tmp.c_str();
return ret;
}
void IrrLibGUI::Clear()
{
this->env->clear();
}
void IrrLibGUI::DrawAll()
{
this->env->drawAll();
}
int IrrLibGUI::AddToStaticArray(irr::gui::IGUIStaticText * addme)
{
//arrStaticText[nStaticText] = addme;
arrStaticText.push_back(addme);
this->nStaticText++;
this->nButtonid++;
return this->nStaticText;
}
void IrrLibGUI::AddStaticText()
{
//rect<s32>(20,30,300,80),
this->env->addStaticText(L"Powered by IrrLib.", rect<s32>(20,30,300,80), true);
}
int IrrLibGUI::AddStaticText(std::string message)
{
irr::gui::IGUIStaticText * addthis;
stringw tmpw(message.c_str());
addthis = this->env->addStaticText(tmpw.c_str(), rect<s32>(20,30,300,80), true);
return AddToStaticArray(addthis);
}
int IrrLibGUI::AddStaticText(std::string message, int x1, int y1, int x2, int y2)
{
irr::gui::IGUIStaticText * addthis;
stringw tmpw(message.c_str());
addthis = this->env->addStaticText(tmpw.c_str(), rect<s32>(x1,y1,x2,y2), true);
return AddToStaticArray(addthis);
}
int IrrLibGUI::AddStaticText(std::string message, int x1, int y1, int x2, int y2, bool border, bool wordwrap)
{
irr::gui::IGUIStaticText * addthis;
stringw tmpw(message.c_str());
addthis = this->env->addStaticText(tmpw.c_str(), rect<s32>(x1,y1,x2,y2), border, wordwrap);
return AddToStaticArray(addthis);
}
int IrrLibGUI::AddStaticText(std::string message, int x1, int y1, int x2, int y2, bool border, bool wordwrap, int id, bool fillbackground)
{
irr::gui::IGUIStaticText * addthis;
stringw tmpw(message.c_str());
addthis = this->env->addStaticText(tmpw.c_str(), rect<s32>(x1,y1,x2,y2), border, wordwrap, 0, id, fillbackground);
return AddToStaticArray(addthis);
}
int IrrLibGUI::AddStaticText(std::string message, const core::rect< s32 > &rectangle)
{
irr::gui::IGUIStaticText * addthis;
stringw tmpw(message.c_str());
addthis = this->env->addStaticText(tmpw.c_str(), rectangle);
return AddToStaticArray(addthis);
}
int IrrLibGUI::AddStaticText(std::string message, const core::rect< s32 > &rectangle, bool border, bool wordwrap)
{
irr::gui::IGUIStaticText * addthis;
stringw tmpw(message.c_str());
addthis = this->env->addStaticText(tmpw.c_str(), rectangle, border, wordwrap);
return AddToStaticArray(addthis);
}
int IrrLibGUI::AddStaticText(std::string message, const core::rect< s32 > &rectangle, bool border, bool wordwrap, int id, bool fillbackground)
{
irr::gui::IGUIStaticText * addthis;
stringw tmpw(message.c_str());
addthis = this->env->addStaticText(tmpw.c_str(), rectangle, border, wordwrap, 0, id, fillbackground);
return AddToStaticArray(addthis);
}
void IrrLibGUI::ChangeStaticText(int nstatictext, std::string message)
{
stringw tmpw(message.c_str());
this->arrStaticText[this->nStaticText-1]->setText(tmpw.c_str());
}
void IrrLibGUI::ChangeFont(std::string fontfile)
{
IGUISkin* skin = this->env->getSkin();
IGUIFont* font = this->env->getFont(fontfile.c_str());
if (font)
skin->setFont(font);
}
int IrrLibGUI::AddButton(std::string text, int x1, int y1, int x2, int y2, std::string tooltiptext = "")
{
return addButton(rect<s32>(x1, y1, x2, y2), 0, nButtonid, stdstring_to_stringw(text).c_str(), stdstring_to_stringw(tooltiptext).c_str());
}
int IrrLibGUI::AddButton(std::string text, core::rect<s32> & rect, std::string tooltiptext = "")
{
return addButton(rect, 0, nButtonid, stdstring_to_stringw(text).c_str(), stdstring_to_stringw(tooltiptext).c_str());
}
Unstable Version/1.3.0/IrrLibGUI.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRLIBGUI_H
#define IRRLIBGUI_H
#include <iostream>
#include <strings.h>
#include <irrlicht.h>
#include "IrrLib.h"
#include "IrrData.h"
#include "IrrLibBase.h"
class IrrLibGUI: public IrrLibBase {
private:
irr::gui::IGUISkin* skin;
irr::gui::IGUIFont* font;
irr::gui::IGUIEnvironment* env;
//TODO: Create an array storing all messages
int nStaticText;
//irr::gui::IGUIStaticText* arrStaticText[10];
int nButton;
int nButtonid;
int nListBox;
int nListBoxid;
std::vector<irr::gui::IGUIStaticText*> arrStaticText;
std::vector<irr::gui::IGUIButton*> arrButton;
std::vector<irr::gui::IGUIListBox*> arrListBox;
int AddToStaticArray(irr::gui::IGUIStaticText * addme);
int addButton(const irr::core::rect< irr::s32 > & rectangle, irr::gui::IGUIElement *parent = 0, irr::s32 id = 0, const wchar_t * text = 0, const wchar_t * tooltiptext = 0); //TODO: Clean this up!
IrrObj addListBox(const irr::core::rect< irr::s32 > &rectangle, irr::gui::IGUIElement * parent);
public:
IrrLibGUI();
~IrrLibGUI();
void SetEnv(irr::gui::IGUIEnvironment* env);
void Clear();
void DrawAll();
//irr::gui::IGUIStaticText* IrrLibGUI::AddStaticText(); //NA eh a default text adder why not?
/* This is bad coding, we do not want to return an irrlicht object, we want to return a standard datatype because this class handles the GUI elements, not the user. */
void AddStaticText(); //NA eh a default text adder why not?
int AddStaticText(std::string message);
int AddStaticText(std::string message, int x1, int y1, int x2, int y2);
int AddStaticText(std::string message, int x1, int y1, int x2, int y2, bool border, bool wordwrap);
int AddStaticText(std::string message, int x1, int y1, int x2, int y2, bool border, bool wordwrap, int id, bool fillbackground);
int AddStaticText(std::string message, const irr::core::rect< irr::s32 > &rectangle);
int AddStaticText(std::string message, const irr::core::rect< irr::s32 > &rectangle, bool border, bool wordwrap);
int AddStaticText(std::string message, const irr::core::rect< irr::s32 > &rectangle, bool border, bool wordwrap, int id, bool fillbackground);
int AddButton(std::string text, int x1, int y1, int x2, int y2, std::string tooltiptext);
int AddButton(std::string text, irr::core::rect<irr::s32> & rect, std::string tooltiptext); //TODO: Add move functions
IrrObj AddListBox(int x1, int y1, int x2, int y2, irr::gui::IGUIElement * parent = 0);
IrrObj AddListBox(const irr::core::rect< irr::s32 > &rectangle, irr::gui::IGUIElement * parent = 0);
void AddStringToListBox(int nLbox, std::string text);
void ChangeStaticText(int nstatictext, std::string message);
void ChangeFont(std::string fontfile);
std::string getSelectListString(IrrObj lstbox);
//std::string getSelectListString(int lstbox);
};
#endif
Unstable Version/1.3.0/IrrSphere.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include "IrrLib.h"
#include "IrrSphere.h"
#include <irrlicht.h>
#include <strings.h>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
void IrrSphere::SetSmgr(irr::scene::ISceneManager* smgr){
this->smgr = smgr;
}
void IrrSphere::SetDriver(irr::video::IVideoDriver* driver){
this->driver = driver;
}
int IrrSphere::CreateNewSphereNode(int x, int y, int z, std::string texture, bool light){
//TODO: Resize after 10, and add 10 more to the mix!
//this->nodeNew[this->numNodes] = this->smgr->addSphereSceneNode();
//this->sphereNodes[this->numNodes]->setPosition(core::vector3df(x,y,z));
//this->sphereNodes[this->numNodes]->setMaterialTexture(0, this->driver->getTexture(texture.c_str()));
//this->sphereNodes[this->numNodes]->setMaterialFlag(video::EMF_LIGHTING, light);
nodeNew = this->smgr->addSphereSceneNode();
nodeNew->setPosition(core::vector3df(x,y,z));
nodeNew->setMaterialTexture(0, this->driver->getTexture(texture.c_str()));
nodeNew->setMaterialFlag(video::EMF_LIGHTING, light);
sphereNodes.push_back(nodeNew);
this->numNodes++;
return this->numNodes--;
/*this->node = this->smgr->addSphereSceneNode();
this->node->setPosition(core::vector3df(x,y,z));
this->node->setMaterialTexture(0, this->driver->getTexture(texture.c_str()));
this->node->setMaterialFlag(video::EMF_LIGHTING, light);*/
}
irr::core::vector3df IrrSphere::GetSphereVector(int sphere){
//We are converting to vectors, under construction NA
//return this->nodeNew[sphere]->getPosition();
return this->sphereNodes[sphere]->getPosition();
}
void IrrSphere::SetSphereVector(int sphere, irr::core::vector3df v){
this->sphereNodes[sphere]->setPosition(v);
}
IrrSphere::IrrSphere(){
this->numNodes = 0;
}
IrrSphere::~IrrSphere(){
/*for(int i = 0; i < numNodes; ++i)
delete this->nodeNew[i];
delete this->nodeNew;*/
//We are using vectors now, no more memory clowing business NA
}
Unstable Version/1.3.0/IrrSphere.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRSPHERE_H
#define IRRSPHERE_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
#include <vector>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
//#include "IrrLib.h"
class IrrSphere
{
private:
//irr::scene::ISceneNode* nodeNew[10];
irr::scene::ISceneNode* nodeNew;
std::vector<irr::scene::ISceneNode*> sphereNodes;
int numNodes;
irr::scene::ISceneManager* smgr;
irr::video::IVideoDriver* driver;
public:
void IrrSphere::SetDriver(irr::video::IVideoDriver* driver);
void IrrSphere::SetSmgr(irr::scene::ISceneManager* smgr);
int IrrSphere::CreateNewSphereNode(int x, int y, int z, std::string texture, bool light); //this is going to take my advanced C++ skillz!
irr::core::vector3df IrrSphere::GetSphereVector(int sphere);
void IrrSphere::SetSphereVector(int sphere, irr::core::vector3df v);
IrrSphere::IrrSphere();
//IrrSphere::IrrSphere(IrrLib*);
IrrSphere::~IrrSphere();
};
#endif
Unstable Version/1.3.0/IrrSprite.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <irrlicht.h>
#include <strings.h>
#include "IrrLib.h"
//Libraries we create go here
//#include "IrrSphere.h"
#include "IrrColor.h"
#include "IrrSprite.h"
//#include "Irr2D.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
IrrSprite::IrrSprite()
{
//do stuff
}
IrrSprite::~IrrSprite()
{
//delete stuff
}
void IrrSprite::SetDriver(irr::video::IVideoDriver* driver)
{
this->driver = driver;
}
void IrrSprite::SetSmgr(irr::scene::ISceneManager* smgr)
{
this->smgr = smgr;
}
Unstable Version/1.3.0/IrrSprite.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRSPRITE_H
#define IRRSPRITE_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
//#include "IrrSphere.h"
#include "IrrColor.h"
//#include "Irr2D.h"
//#include "IrrSprite.h"
//Start class
class IrrSprite {
private:
irr::video::IVideoDriver* driver;
irr::scene::ISceneManager* smgr;
public:
IrrSprite::IrrSprite();
IrrSprite::~IrrSprite();
void IrrSprite::SetDriver(irr::video::IVideoDriver* driver);
void IrrSprite::SetSmgr(irr::scene::ISceneManager* smgr);
// I forgot a semicolon here....and it wasn't compling
//Thats 1 bad thing about OOP if there is an error you don't know where the @#$@# the problem is!
};
#endif
Unstable Version/1.3.0/README
1
2
3
4
5
6
7
8
9
10
11
12
13
Irrlicht Library Wrapper
Created by Nathan Adams
Version 1.2.9
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
Please leave all files intact if you redistrubte this software.
How to use:
Add all the files to your Irrlicht project, you could compile it into a DLL if you wanted too, but for now just add all the files to your project.
Then inside your complier add the directory that you have the IrrLib files and use #include "IrrLib.h" to refrence it, and you are good to go!
Unstable Version/1.3.1/Changes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
Version 1.2
+ Added a Irr3DLib class that will control all 3D objects
+ Also Added a Irr2D class that works on the same concept.
+ IrrSphere is now owned by Irr3DLib
+ Updated the examples using the latest code
Version 1.2.2
+ Added IrrEventReciever to handle all input
- Still under work
+ Fixed some misc coding bugs
+ Added template class
+ Added sprite class
+ Added GUI class
Version 1.2.3
+ IrrEventReciver now works as advertised
+ Baseclass is now being used
+ A couple somewhat-useful functions
+ int_to_string
+ stringw_to_stdstring
+ stdstring_to_stringw
+ GUI elements
+ Static text is working
+ Under construction for a data type class
Version 1.2.4
+ Implmented color codes accessiable through the class
+ IrrLib.Color.RED (ect)
Version 1.2.5
+ Implmented mouse events
+ IrrLib.IrrEvent.getMouseX();
+ IrrLib.IrrEvent.getMouseY();
+ Using vectors instead of static arrays
+ Side note: Was going to use dynamic arrays, but C++ has vectors which are 10x better.
+ Added a default exit for when you hit esc
+ Use IrrLib.IrrEvent.SetEscExit(false) to turn that off for your software
+ Use IrrLib.IrrEvent.SetEscExit(true) to turn it back on
+ Every stable version will now include a windows DLL.
+ Possible Linux .so file in the future.
Version 1.2.6
+ Added a IrrEvent for buttons
+ IrrLib.IrrEvent.checkButtonState();
+ See example for use
+ Added an AddButton function
+ IrrLib.GUI.AddButton(..);
+ See example for use
+ Problems with making the DLL
+ reasearching
Version 1.2.7
+ Fixed DLL Problem
+ Added an enum example to example 1
+ Added more examples
+ Added example 9
+ Added left click handling (see example 9)
+ Added AddLines function to Irr2D
+ DrawLines function in Irr2D will draw the lines you add
Version 1.2.9
+ Added Listbox GUI object
+ Added a new datatype IrrObj
+ Contains 2 ints, 1 for object id and 1 for event id
+ Added a IrrData.h file
Version 1.3.0
+ Changed String class use to Irrlicht's type Strings
Version 1.3.1
+ Added support for newest Irrlict version
Unstable Version/1.3.1/Credits
1
2
3
4
5
6
7
8
IrrLib
Created by
Nathan Adams
Denzel Morris
From #irrlicht
Acid
wacom
Unstable Version/1.3.1/Irr2d.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
//#include "IrrLib.h"
//#include "IrrSphere.h" //You probably aren't going to be using 3D objects in a 2D environment!
#include <irrlicht.h>
#include <strings.h>
#include "Irr2D.h"
#include "IrrSprite.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
Irr2D::Irr2D(){
this->numTextures = 0;
this->numLines = 0;
this->nImages = 0;
//NA Should we set textures to new
}
Irr2D::~Irr2D(){
/*for(int i = 0; i < numTextures; ++i)
delete this->textures[i];
delete this->textures;*/
//No more dynamic memory business yay! NA
//All handled by vectors!
}
/*void Irr2D::SetSmgr(irr::scene::ISceneManager* smgr){
this->smgr = smgr;
Sprite.SetSmgr(smgr);
}
void Irr2D::SetDriver(irr::video::IVideoDriver* driver){
this->driver = driver;
Sprite.SetDriver(driver);
}*/
IrrObj Irr2D::LoadTexturemap(stringc file){
this->texturemap = driver->getTexture(file.c_str());
}
IrrObj Irr2D::LoadTexture(stringc file){
//this->textures[this->numTextures] = driver->getTexture(file.c_str());
textures.push_back(driver->getTexture(file.c_str()));
this->numTextures++;
IrrObj ret;
ret.eventid = 0;
ret.objectid = numTextures--;
return ret;
}
void Irr2D::DrawLine(IrrPos& start, IrrPos& end, irr::video::SColor& color)
{
this->driver->draw2DLine(start, end, color);
}
void Irr2D::AddLines(IrrPos& start, IrrPos& end, irr::video::SColor& color)
{
this->start.push_back(start);
this->end.push_back(end);
this->color.push_back(color);
this->numLines++;
}
void Irr2D::DrawLines()
{
for(int i = 0; i < numLines; ++i)
this->driver->draw2DLine(this->start[i], this->end[i], this->color[i]);
}
IrrObj Irr2D::LoadIrrImage(irr::core::stringc file)
{
images.push_back(this->driver->getTexture(file.c_str()));
IrrObj ret;
ret.objectid = nImages;
ret.eventid = 0;
this->nImages++;
return ret;
}
void Irr2D::DrawImage(IrrObj img)
{
irr::core::position2d<irr::s32> destPos(img.x, img.y);
this->driver->draw2DImage(images[img.objectid], destPos);
}
bool Irr2D::Collision(IrrObj obj1, IrrObj obj2)
{
int x1 = obj1.x;
int y1 = obj1.y;
}
Unstable Version/1.3.1/Irr2d.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRR2D_H
#define IRR2D_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
#include <vector>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
//#include "IrrLib.h"
#include "IrrData.h"
#include "IrrSprite.h"
class Irr2D: public IrrLibBase {
private:
//irr::scene::ISceneManager* smgr;
//irr::video::IVideoDriver* driver;
//Inherited from IrrLibBase
irr::video::ITexture* texturemap;
int numTextures;
//irr::video::ITexture* textures[10];
std::vector<irr::video::ITexture*> textures;
std::vector<irr::core::position2d<irr::s32> > start;
std::vector<irr::core::position2d<irr::s32> > end;
std::vector<irr::video::SColor> color;
std::vector<irr::video::ITexture*> images;
int numLines;
int nImages;
public:
//Irr2D::Irr2D();
IrrSprite Sprite;
Irr2D::Irr2D();
Irr2D::~Irr2D();
//void Irr2D::SetDriver(irr::video::IVideoDriver* driver);
//void Irr2D::SetSmgr(irr::scene::ISceneManager* smgr);
//Inherited from irrlibbase
IrrObj Irr2D::LoadTexturemap(irr::core::stringc file);
IrrObj Irr2D::LoadTexture(irr::core::stringc file);
//Has been renamed from LoadImage to LoadIrrImage due to conflict with windows API
IrrObj Irr2D::LoadIrrImage(irr::core::stringc file);
//void Irr2D::DrawImage(int texture, const irr::core::position2d<irr::s32> & destPos);
//void Irr2D::DrawImage(IrrObj& img, irr::core::position2d<irr::s32>& destPos);
void Irr2D::DrawImage(IrrObj img);
//void Irr2D::MoveImage(IrrObj img, irr::core::dimension2d<irr::s32> destPos);
//void Irr2D::MoveImage(IrrObj img, int x, int y);
//void Irr2D::DrawImage(const irr::core::position2d<irr::s32> & destPos, const irr::core::rect<irr::s32> & sourceRect, const irr::core::rect<irr::s32> * clipRect, irr::video::SColor color, bool useAlphaChannelOfTexture);
//void Irr2D::DrawImage(const irr::core::position2d<irr::s32> & destPos, const irr::core::rect<irr::s32> & sourceRect, const irr::core::rect<irr::s32> * clipRect, irr::video::SColor color, bool useAlphaChannelOfTexture);
//void Irr2D::DrawLine(irr::core::position2d<irr::s32>& start, irr::core::position2d<irr::s32>& end, irr::video::SColor& color);
void Irr2D::DrawLine(IrrPos& start, IrrPos& end, irr::video::SColor& color);
void Irr2D::DrawLines();
//void Irr2D::AddLines(irr::core::position2d<irr::s32>& start, irr::core::position2d<irr::s32>& end, irr::video::SColor& color);
void Irr2D::AddLines(IrrPos& start, IrrPos & end, irr::video::SColor& color);
bool Irr2D::Collision(IrrObj obj1, IrrObj obj2);
//IrrObj Irr2D::LoadImageA(irr::core::stringc file);
};
#endif
Unstable Version/1.3.1/Irr3d.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <strings.h>
//#include "IrrLib.h"
//Libraries we create go here
#include "IrrSphere.h"
//#include "IrrColor.h"
#include "Irr3D.h"
#include <irrlicht.h>
//#include "Irr2D.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
/*void Irr3D::SetDriver(irr::video::IVideoDriver* driver) //so much for copying and pasting code from the header file
{
this->driver = driver;
Sphere.SetDriver(driver);
}
void Irr3D::SetSmgr(irr::scene::ISceneManager* smgr)
{
this->smgr = smgr;
Sphere.SetSmgr(smgr);
}*/
Irr3D::Irr3D()
{
//do stuff here!
}
Irr3D::~Irr3D()
{
//delete stuff here!
}
Unstable Version/1.3.1/Irr3d.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRR3D_H
#define IRR3D_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
#include "IrrSphere.h"
//#include "IrrColor.h"
//#include "Irr3D.h"
//#include "Irr2D.h" This is a 3D class not 2D
/* However due to Irrlciht's nature mixing 2D with 3D is possible */
//Start class
class Irr3D: public IrrLibBase {
private:
//irr::video::IVideoDriver* driver;
//irr::scene::ISceneManager* smgr;
public:
IrrSphere Sphere;
Irr3D::Irr3D();
Irr3D::~Irr3D();
//void Irr3D::SetDriver(irr::video::IVideoDriver* driver);
//void Irr3D::SetSmgr(irr::scene::ISceneManager* smgr);
};
#endif
Unstable Version/1.3.1/IrrEventReciever.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include "IrrEventReciever.h"
#include "IrrData.h"
//#include "IrrLib.h"
#include <irrlicht.h>
#include <iostream>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
/*void IrrEventReciever::setIrrLib(IrrLib& IrrLib)
{
this.callingIrrLib = IrrLib;
}*/
IrrEventReciever::IrrEventReciever()
{
this->escexit = true;
this->mouse.x = 0;
this->mouse.y = 0;
for(int i = 0; i < irr::KEY_KEY_CODES_COUNT; i++)
keyStates[i] = false;
}
#if IRRVER == 131
bool IrrEventReciever::OnEvent(SEvent event)
#else
bool IrrEventReciever::OnEvent(const SEvent &event)
#endif
{
// A button was clicked
if (event.EventType == irr::EET_GUI_EVENT)
{
s32 id = event.GUIEvent.Caller->getID();
switch(event.GUIEvent.EventType){
case EGET_BUTTON_CLICKED:
//cout << id << endl;
buttonStates.push_back(id);
break;
case EGET_LISTBOX_CHANGED:
//s32 id = event.GUIEvent.Caller->getID();
listStates.push_back(id);
break;
case EGET_LISTBOX_SELECTED_AGAIN:
listStates.push_back(id);
break;
default:
break;
}
}
/*if (event.EventType == irr::EGET_SCROLL_BAR_CHANGED)
{
}*/
if (event.EventType == irr::EET_KEY_INPUT_EVENT) {
if (!event.KeyInput.PressedDown){
this->keyStates[event.KeyInput.Key] = false;
//cout << "Key was not hit " << this->keyStates[event.KeyInput.Key] << endl;
}
else{
if(event.KeyInput.Key == KEY_ESCAPE && escexit)
this->device->closeDevice();
this->keyStates[event.KeyInput.Key] = true;
//cout << "Key was hit: " << event.KeyInput.Key << " " << this->keyStates[event.KeyInput.Key] << endl;
}
}
if (event.EventType == EET_MOUSE_INPUT_EVENT){
if (event.MouseInput.Event == EMIE_MOUSE_MOVED){
this->mouse.x = event.MouseInput.X;
this->mouse.y = event.MouseInput.Y;
}
if (event.MouseInput.Event == EMIE_LMOUSE_PRESSED_DOWN)
this->mouseStates[0] = true;
if (event.MouseInput.Event == EMIE_LMOUSE_LEFT_UP)
this->mouseStates[0] = false;
}
return false;
}
void IrrEventReciever::SetEscExit(bool onoff)
{
this->escexit = onoff;
}
int IrrEventReciever::getMouseX()
{
return this->mouse.x;
}
int IrrEventReciever::getMouseY()
{
return this->mouse.y;
}
int IrrEventReciever::getButtonState()
{
if(!this->buttonStates.empty()){
int id;
id = buttonStates.back();
this->buttonStates.pop_back();
return id;
}
else
return -1;
}
int IrrEventReciever::getRevButtonState()
{
if(!this->buttonStates.empty()){
int id = buttonStates.front();
this->buttonStates.erase(buttonStates.begin());
return id;
}
else
return -1;
}
void IrrEventReciever::clearButtonState()
{
this->buttonStates.clear();
}
int IrrEventReciever::checkButtonState(IrrObj obj)
{
if(!this->buttonStates.empty()){
int tmp = this->buttonStates.back();
if (tmp == obj.eventid)
{
this->delLastButtonState();
return 1;
}
else
{
return 0;
}
}
else
{
return -1;
}
}
void IrrEventReciever::delLastButtonState()
{
if(!this->buttonStates.empty())
this->buttonStates.pop_back();
}
bool IrrEventReciever::isButtonStateEmpty()
{
return this->buttonStates.empty();
}
int IrrEventReciever::checkListState(IrrObj obj)
{
if(!this->listStates.empty())
{
int tmp = this->listStates.back();
//cout << tmp << endl;
if (tmp == obj.eventid)
{
this->delLastListState();
return 1;
}
else
{
return 0;
}
}
else
{
return 0;
}
}
void IrrEventReciever::delLastListState()
{
if(!this->listStates.empty())
this->listStates.pop_back();
}
Unstable Version/1.3.1/IrrEventReciever.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRREVENTRECIEVER_H
#define IRREVENTRECIEVER_H
//#include "IrrLib.h"
#include <vector>
#include <irrlicht.h>
#include "IrrLibBase.h"
#include "IrrData.h"
#include <stdlib.h>
class IrrEventReciever : public irr::IEventReceiver, public IrrLibBase
{
private:
//IrrLib callingIrrLib;
_mouse mouse;
bool escexit;
std::vector<int> buttonStates;
std::vector<int> listStates;
public:
bool mouseStates[1];
IrrEventReciever();
int getMouseX();
int getMouseY();
bool keyStates[irr::KEY_KEY_CODES_COUNT];
//void setIrrLib(IrrLib& IrrLib)
#if IRRVER == 131
virtual bool OnEvent(irr::SEvent event);
#else
virtual bool OnEvent(const irr::SEvent &event);
#endif
void SetEscExit(bool onoff);
int getButtonState();
int getRevButtonState();
void clearButtonState();
int checkButtonState(IrrObj obj);
void delLastButtonState();
bool isButtonStateEmpty(); //is there still stuff in the vector to be done? NA
int checkListState(IrrObj obj);
void delLastListState();
};
#endif
Unstable Version/1.3.1/IrrLibBase.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <irrlicht.h>
#include "IrrLibBase.h"
#include <strings.h>
#include <sstream>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
/*
* Code from http://articles.techrepublic.com.com/5100-22-5079969.html#
*
struct str_stream
{
std::stringstream & underlying_stream() const
{ return m_streamOut; }
operator std::string() const
{
return m_streamOut.str();
}
private:
mutable std::stringstream m_streamOut;
};
template< class type>
inline const str_stream & operator<< ( const str_stream & out, const type & value)
{
out.underlying_stream() << value;
return out;
}
template<class type> std::string to_string( const type & value)
{
std::ostringstream streamOut;
streamOut << value;
return streamOut.str();
}
* End code copy
*/
void IrrLibBase::SetDriver(IVideoDriver* driver) //can be overloaded
{
this->driver = driver;
}
void IrrLibBase::SetSmgr(ISceneManager* smgr)
{
this->smgr = smgr;
}
std::string IrrLibBase::wchar_to_stdstring (const wchar_t* wc)
{
//cout << "Starting conversion";
//wcstombs(tmp, in, 255);
char c[255];
for(int t = 0; wc[t] != '\0'; t++)
c[t] = (char)wc[t];
/*for(int t = 0; c[t] != '\0'; t++)
wc[t] = c[t];*/
std::stringstream ss;
ss << c;
//cout << "Conversion OK";
return ss.str();
}
std::string IrrLibBase::int_to_string (int t)
{
std::stringstream ss;
ss << t;
return ss.str();
}
std::string IrrLibBase::stringw_to_stdstring(irr::core::stringw sw)
{
std::stringstream ss;
ss << sw.c_str();
return ss.str();
}
irr::core::stringw IrrLibBase::stdstring_to_stringw(std::string ss)
{
stringw tmpw(ss.c_str());
return tmpw;
}
void IrrLibBase::SetDevice(irr::IrrlichtDevice *device)
{
this->device = device;
}
void IrrLibBase::init()
{
}
/*irr::core::stringw int_to_stringw(int t)
{
std::stringstream ss;
ss << t;
//stringw ret(ss.str());
return ret;
}*/
Unstable Version/1.3.1/IrrLibBase.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRLIBBASE_H
#define IRRLIBBASE_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
class IrrLibBase {
protected:
irr::video::IVideoDriver* driver;
irr::scene::ISceneManager* smgr;
irr::IrrlichtDevice *device;
public:
//template<class type> std::string to_string( const type & value);
irr::core::dimension2d<irr::s32> irrpixels;
void IrrLibBase::SetDriver(irr::video::IVideoDriver* driver);
void IrrLibBase::SetSmgr(irr::scene::ISceneManager* smgr);
void SetDevice(irr::IrrlichtDevice *device);
std::string int_to_string (int t);
std::string stringw_to_stdstring(irr::core::stringw sw);
irr::core::stringw stdstring_to_stringw(std::string ss);
std::string wchar_to_stdstring (const wchar_t* wc);
//irr::core::stringw int_to_stringw(int t);
void init();
};
#endif
Unstable Version/1.3.1/IrrLibGUI.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <strings.h>
#include <irrlicht.h>
#include <vector>
#include <sstream>
#include "IrrLib.h"
#include "IrrData.h"
#include "IrrLibGUI.h"
#include "IrrLibBase.h"
#include <stdlib.h>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
template<class type> std::string to_string( const type & value)
{
std::ostringstream streamOut;
streamOut << value;
return streamOut.str();
}
IrrLibGUI::IrrLibGUI()
{
//NA does it need to do anything at init?
this->nStaticText = 0;
this->nButton = 0;
this->nButtonid = 100;
this->nListBoxid = 200;
this->nListBox = 0;
//this->nListBoxid = 300;
//this->arrStaticText = new IGUIStaticText[10];
//this->env = this->device->getGUIEnvironment(); //NA yes we do!
}
IrrLibGUI::~IrrLibGUI()
{
//NA Do we have to delete anything?
}
void IrrLibGUI::SetEnv(IGUIEnvironment* env)
{
this->env = env;
//env->addButton(rect<s32>(10,210,110,210 + 32), 0, 109, L"Quit", L"Exits Program");
}
IrrObj IrrLibGUI::addButton(const core::rect< s32 > & rectangle, IGUIElement *parent, s32 id, const wchar_t * text, const wchar_t * tooltiptext)
{
arrButton.push_back(this->env->addButton(rectangle, parent, id, text, tooltiptext));
++nButton;
++nButtonid;
IrrObj ret;
ret.objectid = --nButtonid;
return ret;
}
IrrObj IrrLibGUI::addListBox(const irr::core::rect< irr::s32 > &rectangle, IGUIElement * parent)
{
irr::gui::IGUIListBox* tmp = this->env->addListBox(rectangle, parent, nListBoxid);
arrListBox.push_back(tmp);
//we introduce a new datatype; IrroObj
IrrObj ret;
ret.eventid = nListBoxid;
ret.objectid = nListBox;
++nListBox;
++nListBoxid;
return ret;
}
IrrObj IrrLibGUI::AddListBox(int x1, int y1, int x2, int y2, IGUIElement * parent)
{
return addListBox(rect<s32>(x1, y1, x2, y2), parent);
}
IrrObj IrrLibGUI::AddListBox(const irr::core::rect< irr::s32 > &rectangle, IGUIElement * parent)
{
return addListBox(rectangle, parent);
}
void IrrLibGUI::AddStringToListBox(IrrObj nLbox, stringw text)
{
this->arrListBox[nLbox.objectid]->addItem(text.c_str());
//this->arrListBox[0]->addItem(L"TEST");
}
std::string IrrLibGUI::getSelectListString(IrrObj lstbox)
{
//stringc tmp = this->arrListBox[lstbox]->getListItem(this->arrListBox[lstbox]->getSelected());
//s32 selected = this->arrListBox[lstbox.objectid]->getSelected();
//const wchar_t* tmp = this->arrListBox[lstbox]->getListItem(selected);
//irr::core::stringw tmp;
//char out[255];
//tmp = this->arrListBox[lstbox]->getText();
irr::core::stringc tmp(arrListBox[lstbox.objectid]->getListItem(arrListBox[lstbox.objectid]->getSelected()));
//cout << tmp.c_str() << endl;
//wcstombs(out, tmp, tmp.length());
//cout << tmp[0] << endl;
// std::stringstream ss;
//for (int i = 0; i < tmp.size(); ++i)
//ss << tmp.c_str();
std::string ret = tmp.c_str();
return ret;
}
void IrrLibGUI::Clear()
{
this->env->clear();
}
void IrrLibGUI::DrawAll()
{
this->env->drawAll();
}
IrrObj IrrLibGUI::AddToStaticArray(irr::gui::IGUIStaticText * addme)
{
//arrStaticText[nStaticText] = addme;
arrStaticText.push_back(addme);
this->nStaticText++;
this->nButtonid++;
IrrObj ret;
ret.objectid = this->nStaticText;
return ret;
}
void IrrLibGUI::AddStaticText()
{
//rect<s32>(20,30,300,80),
this->env->addStaticText(L"Powered by IrrLib.", rect<s32>(20,30,300,80), true);
}
IrrObj IrrLibGUI::AddStaticText(stringw message)
{
irr::gui::IGUIStaticText * addthis;
addthis = this->env->addStaticText(message.c_str(), rect<s32>(20,30,300,80), true);
return AddToStaticArray(addthis);
}
IrrObj IrrLibGUI::AddStaticText(stringw message, int x1, int y1, int x2, int y2)
{
irr::gui::IGUIStaticText * addthis;
addthis = this->env->addStaticText(message.c_str(), rect<s32>(x1,y1,x2,y2), true);
return AddToStaticArray(addthis);
}
IrrObj IrrLibGUI::AddStaticText(stringw message, int x1, int y1, int x2, int y2, bool border, bool wordwrap)
{
irr::gui::IGUIStaticText * addthis;
addthis = this->env->addStaticText(message.c_str(), rect<s32>(x1,y1,x2,y2), border, wordwrap);
return AddToStaticArray(addthis);
}
IrrObj IrrLibGUI::AddStaticText(stringw message, int x1, int y1, int x2, int y2, bool border, bool wordwrap, int id, bool fillbackground)
{
irr::gui::IGUIStaticText * addthis;
addthis = this->env->addStaticText(message.c_str(), rect<s32>(x1,y1,x2,y2), border, wordwrap, 0, id, fillbackground);
return AddToStaticArray(addthis);
}
IrrObj IrrLibGUI::AddStaticText(stringw message, const core::rect< s32 > &rectangle)
{
irr::gui::IGUIStaticText * addthis;
addthis = this->env->addStaticText(message.c_str(), rectangle);
return AddToStaticArray(addthis);
}
IrrObj IrrLibGUI::AddStaticText(stringw message, const core::rect< s32 > &rectangle, bool border, bool wordwrap)
{
irr::gui::IGUIStaticText * addthis;
addthis = this->env->addStaticText(message.c_str(), rectangle, border, wordwrap);
return AddToStaticArray(addthis);
}
IrrObj IrrLibGUI::AddStaticText(stringw message, const core::rect< s32 > &rectangle, bool border, bool wordwrap, int id, bool fillbackground)
{
irr::gui::IGUIStaticText * addthis;
addthis = this->env->addStaticText(message.c_str(), rectangle, border, wordwrap, 0, id, fillbackground);
return AddToStaticArray(addthis);
}
void IrrLibGUI::ChangeStaticText(IrrObj nstatictext, stringw message)
{
//this->arrStaticText[this->nStaticText.objectid-1]->setText(message.c_str());
this->arrStaticText[nstatictext.objectid]->setText(message.c_str());
}
void IrrLibGUI::ChangeFont(stringc fontfile)
{
IGUISkin* skin = this->env->getSkin();
IGUIFont* font = this->env->getFont(fontfile.c_str());
if (font)
skin->setFont(font);
}
IrrObj IrrLibGUI::AddButton(stringw text, int x1, int y1, int x2, int y2, stringw tooltiptext = "")
{
return addButton(rect<s32>(x1, y1, x2, y2), 0, nButtonid, text.c_str(), tooltiptext.c_str());
}
IrrObj IrrLibGUI::AddButton(stringw text, core::rect<s32> & rect, stringw tooltiptext = "")
{
return addButton(rect, 0, nButtonid, text.c_str(), tooltiptext.c_str());
}
Unstable Version/1.3.1/IrrLibGUI.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRLIBGUI_H
#define IRRLIBGUI_H
#include <iostream>
#include <strings.h>
#include <irrlicht.h>
#include "IrrLib.h"
#include "IrrData.h"
#include "IrrLibBase.h"
class IrrLibGUI: public IrrLibBase {
private:
irr::gui::IGUISkin* skin;
irr::gui::IGUIFont* font;
irr::gui::IGUIEnvironment* env;
//TODO: Create an array storing all messages
int nStaticText;
//irr::gui::IGUIStaticText* arrStaticText[10];
int nButton;
int nButtonid;
int nListBox;
int nListBoxid;
std::vector<irr::gui::IGUIStaticText*> arrStaticText;
std::vector<irr::gui::IGUIButton*> arrButton;
std::vector<irr::gui::IGUIListBox*> arrListBox;
IrrObj AddToStaticArray(irr::gui::IGUIStaticText * addme);
IrrObj addButton(const irr::core::rect< irr::s32 > & rectangle, irr::gui::IGUIElement *parent = 0, irr::s32 id = 0, const wchar_t * text = 0, const wchar_t * tooltiptext = 0); //TODO: Clean this up!
IrrObj addListBox(const irr::core::rect< irr::s32 > &rectangle, irr::gui::IGUIElement * parent);
public:
IrrLibGUI();
~IrrLibGUI();
void SetEnv(irr::gui::IGUIEnvironment* env);
void Clear();
void DrawAll();
//irr::gui::IGUIStaticText* IrrLibGUI::AddStaticText(); //NA eh a default text adder why not?
/* This is bad coding, we do not want to return an irrlicht object, we want to return a standard datatype because this class handles the GUI elements, not the user. */
void AddStaticText(); //NA eh a default text adder why not?
IrrObj AddStaticText(irr::core::stringw message);
IrrObj AddStaticText(irr::core::stringw message, int x1, int y1, int x2, int y2);
IrrObj AddStaticText(irr::core::stringw message, int x1, int y1, int x2, int y2, bool border, bool wordwrap);
IrrObj AddStaticText(irr::core::stringw message, int x1, int y1, int x2, int y2, bool border, bool wordwrap, int id, bool fillbackground);
IrrObj AddStaticText(irr::core::stringw message, const irr::core::rect< irr::s32 > &rectangle);
IrrObj AddStaticText(irr::core::stringw message, const irr::core::rect< irr::s32 > &rectangle, bool border, bool wordwrap);
IrrObj AddStaticText(irr::core::stringw message, const irr::core::rect< irr::s32 > &rectangle, bool border, bool wordwrap, int id, bool fillbackground);
IrrObj AddButton(irr::core::stringw text, int x1, int y1, int x2, int y2, irr::core::stringw tooltiptext);
IrrObj AddButton(irr::core::stringw text, irr::core::rect<irr::s32> & rect, irr::core::stringw tooltiptext); //TODO: Add move functions
IrrObj AddListBox(int x1, int y1, int x2, int y2, irr::gui::IGUIElement * parent = 0);
IrrObj AddListBox(const irr::core::rect< irr::s32 > &rectangle, irr::gui::IGUIElement * parent = 0);
void AddStringToListBox(IrrObj nLbox, irr::core::stringw text);
void ChangeStaticText(IrrObj nstatictext, irr::core::stringw message);
void ChangeFont(irr::core::stringc fontfile);
std::string getSelectListString(IrrObj lstbox);
//irr::core::stringw getSelectListString(int lstbox);
};
#endif
Unstable Version/1.3.1/IrrSphere.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include "IrrLib.h"
#include "IrrSphere.h"
#include <irrlicht.h>
#include <strings.h>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
/*void IrrSphere::SetSmgr(irr::scene::ISceneManager* smgr){
this->smgr = smgr;
}
void IrrSphere::SetDriver(irr::video::IVideoDriver* driver){
this->driver = driver;
}*/
IrrObj IrrSphere::CreateNewSphereNode(int x, int y, int z, stringc texture, bool light){
//this->nodeNew[this->numNodes] = this->smgr->addSphereSceneNode();
//this->sphereNodes[this->numNodes]->setPosition(core::vector3df(x,y,z));
//this->sphereNodes[this->numNodes]->setMaterialTexture(0, this->driver->getTexture(texture.c_str()));
//this->sphereNodes[this->numNodes]->setMaterialFlag(video::EMF_LIGHTING, light);
IrrObj ret;
nodeNew = this->smgr->addSphereSceneNode();
nodeNew->setPosition(core::vector3df(x,y,z));
nodeNew->setMaterialTexture(0, this->driver->getTexture(texture.c_str()));
nodeNew->setMaterialFlag(video::EMF_LIGHTING, light);
sphereNodes.push_back(nodeNew);
this->numNodes++;
ret.objectid = this->numNodes--;
return ret;
/*this->node = this->smgr->addSphereSceneNode();
this->node->setPosition(core::vector3df(x,y,z));
this->node->setMaterialTexture(0, this->driver->getTexture(texture.c_str()));
this->node->setMaterialFlag(video::EMF_LIGHTING, light);*/
}
irr::core::vector3df IrrSphere::GetSphereVector(int sphere){
//We are converting to vectors, under construction NA
//return this->nodeNew[sphere]->getPosition();
return this->sphereNodes[sphere]->getPosition();
}
void IrrSphere::SetSphereVector(int sphere, irr::core::vector3df v){
this->sphereNodes[sphere]->setPosition(v);
}
IrrSphere::IrrSphere(){
this->numNodes = 0;
}
IrrSphere::~IrrSphere(){
/*for(int i = 0; i < numNodes; ++i)
delete this->nodeNew[i];
delete this->nodeNew;*/
//We are using vectors now, no more memory clowing business NA
}
Unstable Version/1.3.1/IrrSphere.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRSPHERE_H
#define IRRSPHERE_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
#include <vector>
/* We have to include Irrlichts libs */
#include "IrrLibBase.h"
#include "IrrData.h"
#include <irrlicht.h>
//#include "IrrLib.h"
class IrrSphere: public IrrLibBase
{
private:
//irr::scene::ISceneNode* nodeNew[10];
irr::scene::ISceneNode* nodeNew;
std::vector<irr::scene::ISceneNode*> sphereNodes;
int numNodes;
//irr::scene::ISceneManager* smgr;
//irr::video::IVideoDriver* driver;
public:
//void IrrSphere::SetDriver(irr::video::IVideoDriver* driver);
//void IrrSphere::SetSmgr(irr::scene::ISceneManager* smgr);
IrrObj IrrSphere::CreateNewSphereNode(int x, int y, int z, irr::core::stringc texture, bool light); //this is going to take my advanced C++ skillz!
irr::core::vector3df IrrSphere::GetSphereVector(int sphere);
void IrrSphere::SetSphereVector(int sphere, irr::core::vector3df v);
IrrSphere::IrrSphere();
//IrrSphere::IrrSphere(IrrLib*);
IrrSphere::~IrrSphere();
};
#endif
Unstable Version/1.3.1/IrrSprite.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <irrlicht.h>
#include <strings.h>
#include "IrrLib.h"
//Libraries we create go here
//#include "IrrSphere.h"
#include "IrrColor.h"
#include "IrrSprite.h"
//#include "Irr2D.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
IrrSprite::IrrSprite()
{
//do stuff
}
IrrSprite::~IrrSprite()
{
//delete stuff
}
/*void IrrSprite::SetDriver(irr::video::IVideoDriver* driver)
{
this->driver = driver;
}
void IrrSprite::SetSmgr(irr::scene::ISceneManager* smgr)
{
this->smgr = smgr;
}*/
Unstable Version/1.3.1/IrrSprite.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRSPRITE_H
#define IRRSPRITE_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
//#include "IrrSphere.h"
#include "IrrLibBase.h"
#include "IrrColor.h"
//#include "Irr2D.h"
//#include "IrrSprite.h"
//Start class
class IrrSprite: public IrrLibBase {
private:
//irr::video::IVideoDriver* driver;
//irr::scene::ISceneManager* smgr;
public:
IrrSprite::IrrSprite();
IrrSprite::~IrrSprite();
/*void IrrSprite::SetDriver(irr::video::IVideoDriver* driver);
void IrrSprite::SetSmgr(irr::scene::ISceneManager* smgr);*/
// I forgot a semicolon here....and it wasn't compling
//Thats 1 bad thing about OOP if there is an error you don't know where the @#$@# the problem is!
};
#endif
Unstable Version/1.3.1/Irrcolor.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <irrlicht.h>
#include <strings.h>
//#include "IrrLib.h"
#include "IrrColor.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
void IrrColor::Init(){
/*SColor * temp;
temp = new SColor(alpha, 255, 0, 0);
this->RED = temp;
delete temp;*/
this->RED = new SColor(alpha, 255, 0, 0);
this->ORANGE = new SColor(alpha, 255, 165, 0);
this->YELLOW = new SColor(alpha, 255, 255, 0);
this->GREEN = new SColor(alpha, 0, 255, 0);
this->BLUE = new SColor(alpha, 0, 0, 255);
this->DARK_GREEN = new SColor(alpha, 0, 100, 0);
this->PINK = new SColor(alpha, 255, 192, 203);
this->GREY = new SColor(alpha, 190, 190, 190);
this->WHITE = new SColor(alpha, 0, 0, 0);
this->BLACK = new SColor(alpha, 0, 0, 0);
}
IrrColor::~IrrColor(){
delete this->RED;
delete this->ORANGE;
delete this->YELLOW;
delete this->GREEN;
delete this->BLUE;
delete this->DARK_GREEN;
delete this->PINK;
delete this->GREY;
delete this->WHITE;
delete this->BLACK;
}
IrrColor::IrrColor(){
this->alpha = 255;
Init();
}
IrrColor::IrrColor(irr::u32 alpha){
this->alpha = alpha;
Init();
}
int IrrColor::getAlpha(){
return this->alpha;
}
void IrrColor::setAlpha(int alpha){
this->alpha = alpha;
}
SColor IrrColor::returnColor(stringw color){
int nColor = -1;
if (color == "red")
nColor = 1;
else if (color == "green")
nColor = 2;
else if (color == "blue")
nColor = 3;
else if (color == "dark green")
nColor = 4;
else if (color == "pink")
nColor = 5;
else if (color == "grey")
nColor = 6;
switch (nColor){
case 1:
return SColor(255, 255, 0, 0);
break;
case 2:
return SColor(255, 0, 255, 0);
break;
case 3:
return SColor(255, 0, 0, 255);
break;
case 4:
return SColor(255, 0, 50, 0);
break;
case 5:
return SColor(255, 255, 10, 255);
break;
case 6:
return SColor(255,200,200,200);
break;
default:
return SColor(255,200,200,200);
break;
}// TODO: Make this function modular
}
Unstable Version/1.3.1/Irrcolor.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRCOLOR_H
#define IRRCOLOR_H
#include <iostream>
#include <strings.h>
#include "irrlicht.h"
//#include "IrrLib.h"
class IrrColor {
private:
irr::u32 alpha;
void Init();
//who knows?
public:
//irr::video::SColor(alpha, 255, 0, 0);
const irr::video::SColor* RED;
const irr::video::SColor* ORANGE;
const irr::video::SColor* YELLOW;
const irr::video::SColor* GREEN;
const irr::video::SColor* BLUE;
const irr::video::SColor* DARK_GREEN;
const irr::video::SColor* PINK;
const irr::video::SColor* GREY;
const irr::video::SColor* WHITE;
const irr::video::SColor* BLACK;
/*const ORANGE = irr::video::SColor(alpha, 255, 165, 0);
const YELLOW = irr::video::SColor(alpha, 255, 255, 0);
const GREEN = irr::video::SColor(alpha, 0, 255, 0);
const BLUE = irr::video::SColor(alpha, 0, 0, 255);
const DARK_GREEN = irr::video::SColor(alpha, 0, 100, 0);
const PINK = irr::video::SColor(alpha, 255, 192, 203);
const GREY = irr::video::Scolor(alpha, 190, 190, 190);*/
//void IrrColor::test();
IrrColor();
IrrColor(irr::u32 alpha);
~IrrColor();
int getAlpha();
void setAlpha(int alpha);
irr::video::SColor returnColor(irr::core::stringw color);
};
#endif
Unstable Version/1.3.1/Irrdata.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#ifndef IRRDATA_H
#define IRRDATA_H
#include <irrlicht.h>
typedef irr::core::dimension2d<irr::s32> PixelSize;
typedef irr::core::position2d<irr::s32> IrrPos;
struct pixels {
int width;
int height;
}; //possible future use in 2D objects when specifying the properties of an object draw
struct IrrObj {
int eventid;
int objectid;
int x;
int y;
};
struct _mouse {
int x;
int y;
};
#endif
Unstable Version/1.3.1/Irrlib.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <irrlicht.h>
#include <strings.h>
#include <sstream>
#include <time.h>
#include "IrrLib.h"
//Libraries we create go here
//#include "IrrSphere.h"
#include "IrrColor.h"
//#include "Irr2D.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
/*IrrLib::IrrLib(MastEventReceiver & receiver){
this->device = createDevice(EDT_SOFTWARE, dimension2d<s32>(640, 480), 16, false, false, false, &receiver);
if (this->device == 0)
exit(1);
IrrLib::Init();
}*/
IrrLib::IrrLib(){
this->device = createDevice(EDT_SOFTWARE, dimension2d<s32>(640, 480), 16, false, false, false, &this->IrrEvent);
if (this->device == 0)
exit(1);
IrrLib::Init();
}
IrrLib::IrrLib(video::E_DRIVER_TYPE drivertype, core::dimension2d<s32> & res, u32 bits, bool fullscreen, bool stencilbuffer, bool vsync){
//MyEventReceiver receiver;
this->device = createDevice(drivertype, res, bits, fullscreen, stencilbuffer, vsync, &this->IrrEvent);
if (this->device == 0)
exit(1);
IrrLib::Init();
}
IrrLib::IrrLib(int nDrivertype, int width, int height, int bits, bool fullscreen, bool stencilbuffer, bool vsync){
//MyEventReceiver receiver;
video::E_DRIVER_TYPE drivertype;
switch (nDrivertype){
case 0: //TODO: finish this switch case
drivertype = EDT_NULL;
break;
case 1:
drivertype = EDT_SOFTWARE;
break;
case 2:
drivertype = EDT_BURNINGSVIDEO;
break;
case 3:
drivertype = EDT_OPENGL;
break;
case 4:
#if DX8 == 1
drivertype = EDT_DIRECT3D8;
#else
drivertype = EDT_OPENGL;
#endif
//*Note: It seems as Microsoft has stoped supporting DX 8.1, so you can not compile it into Irrlicht engine anymore
//TODO: Find how to detect if DX is complied into Irrlicht
//TODO: Find how to detecht for linux
break;
case 5:
#if DX9 == 1
drivertype = EDT_DIRECT3D9;
#else
drivertype = EDT_OPENGL;
#endif
break;
default:
drivertype = EDT_SOFTWARE;
break;
}
this->device = createDevice(drivertype, dimension2d<s32>(width, height), bits, fullscreen, stencilbuffer, vsync, &this->IrrEvent);
if (this->device == 0)
exit(1);
IrrLib::Init();
}
IrrLib::~IrrLib (){ //Our moms wont clean up after us!
//Although I'm sure Irrlicht does this for us already, its always a good idea to check!
/*if (this->device != NULL)
delete this->device;
if (this->driver != NULL)
delete this->driver;
if (this->smgr != NULL)
delete this->smgr;
if (this->mesh != NULL)
delete this->mesh;
if (this->node != NULL)
delete this->node;*/ //it seems Irrlicht picks up after us...
//however we created newNodes, now we need to delete it!
}
void IrrLib::Init(){
//this->numNodes = 0;
//this->nodeNew = new ISceneNode[10];
//this->env->addStaticText(L"Transparent Control:", rect<s32>(20,30,300,80), true);
this->env = this->device->getGUIEnvironment();
this->driver = this->device->getVideoDriver();
this->smgr = this->device->getSceneManager();
Irr3DLib.SetSmgr(this->smgr);
Irr3DLib.SetDriver(this->driver);
Irr2DLib.SetSmgr(this->smgr);
Irr2DLib.SetDriver(this->driver);
GUI.SetEnv(this->env);
IrrEvent.SetDevice(this->device);
this->timer = this->device->getTimer();
tick = this->timer->getRealTime();
}
void IrrLib::ReadArchive(stringc file){
this->device->getFileSystem()->addZipFileArchive(file.c_str());
}
void IrrLib::LoadQ3Level(stringc q3level){
this->mesh = this->smgr->getMesh(q3level.c_str());
this->node = 0;
if (this->mesh)
this->node = this->smgr->addOctTreeSceneNode(this->mesh->getMesh(0), 0, -1, 128);
}
void IrrLib::MapPos(int x, int y, int z){
if (this->node)
this->node->setPosition(core::vector3df(x, y, z));
}
void IrrLib::MapPos(){
if (this->node)
this->node->setPosition(core::vector3df(0, 0, 0));
}
void IrrLib::AddFPSCam(){
this->cam = this->smgr->addCameraSceneNodeFPS();
}
void IrrLib::AddFPSCam(f32 x, f32 y, f32 z)
{
this->cam = this->smgr->addCameraSceneNodeFPS();
this->cam->setPosition(irr::core::vector3df(x, y, z));
}
void IrrLib::VisibleCursor(bool tf){
if (tf == false)
this->device->getCursorControl()->setVisible(false);
else
this->device->getCursorControl()->setVisible(true);
}
int IrrLib::GetFPSCount(){
return this->driver->getFPS();
}
bool IrrLib::DeviceIsRunning(){
return this->device->run();
}
bool IrrLib::IsActiveWindow(){
return this->device->isWindowActive();
}
void IrrLib::BeginScene(){
this->driver->beginScene(true, true, video::SColor(0,200,200,200));
}
void IrrLib::BeginScene(irr::video::SColor color){
this->driver->beginScene(true, true, color);
}
void IrrLib::BeginScene(bool usebackBuffer, bool usezBuffer, irr::video::SColor color){
this->driver->beginScene(usebackBuffer, usezBuffer, color);
}
void IrrLib::DrawAll(){
//position2d<int> start(50, 50);
//position2d<int> end(100,100);
// SColor whitecolor(255,255,255,255);
//driver->draw2DLine(start, end, whitecolor);
this->smgr->drawAll();
this->env->drawAll();
//this->device->getGUIEnvironment()->drawAll();
}
void IrrLib::EndScene(){
this->driver->endScene();
}
void IrrLib::SetWindowCaption(stringw str){
this->device->setWindowCaption(str.c_str());
}
irr::core::stringw IrrLib::GetDriverName(){
return this->driver->getName();
}
void IrrLib::EndIrrlicht(){
if(this->device != NULL){
this->device->drop();
this->device = NULL;
}
}
void IrrLib::KeyPress(char key){
this->key = key;
}
char IrrLib::KeyPressed(){
return key;
}
irr::f32 IrrLib::getX(){
return this->smgr->getActiveCamera()->getPosition().X;
}
irr::f32 IrrLib::getY(){
return this->smgr->getActiveCamera()->getPosition().Y;
}
irr::f32 IrrLib::getZ(){
return this->smgr->getActiveCamera()->getPosition().Z;
}
bool IrrLib::CheckGameLoop(){
u32 now;
now = this->timer->getRealTime();
if ((now - this->tick) >= 30){
//this->tick == time (NULL);
return true;
} else {
return false;
}
}
bool IrrLib::CheckGameLoop(u32 ms){
u32 now;
now = this->timer->getRealTime();
if ((now - this->tick) >= ms){
this->tick = now;
return true;
} else {
return false;
}
}
void IrrLib::Exit()
{
this->device->closeDevice();
}
PixelSize IrrLib::GetScreenSize()
{
return this->driver->getScreenSize();
/*pixels returnres;
returnres.width = screenres.Width;
returnres.height = screenres.Height;
return returnres;*/
}
//template <class T> std::string IrrLib::to_string (T t)
/*std::string IrrLib::int_to_string (int t)
{
std::stringstream ss;
ss << t;
return ss.str();
}*/
// This is in the base class now, every class that decends from that class has this ability.
Unstable Version/1.3.1/Irrlib.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Denzel Morris
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRLIB_H
#define IRRLIB_H
#ifndef IRRVER
#define IRRVER 14
//2 Versions
// 14 or 131
//Different version due to different implmenation of eventreciever
#endif
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
#include <irrlicht.h>
#include <time.h>
/* We have to include Irrlichts libs */
#include "Irr3D.h"
#include "IrrColor.h"
#include "IrrLibGUI.h"
#include "IrrEventReciever.h"
#include "Irr2D.h"
#include "IrrLibBase.h"
#include "IrrData.h"
/*struct IrrObj {
int eventid;
int objectid;
};*/
//Start class
class IrrLib: public IrrLibBase {
private:
/* Create an Irrlicht device as private because the class should handle
All irrlicht interaction */
//irr::IrrlichtDevice *device;
//In IrrLibBase
// Tells Irrlicht what driver to use
//video::E_DRIVER_TYPE driverType;
/*
Get a pointer to the video driver and the SceneManager so that
we do not always have to write device->getVideoDriver() and
device->getSceneManager().
*/
/*irr::video::IVideoDriver* driver;
irr::scene::ISceneManager* smgr;*/
//In IrrLibBase
irr::gui::IGUIEnvironment* env;
/*
Get a pointer to the 'mesh' aka the level.
Note: This is for Quake3 levels, ie bsp maps.
*/
irr::scene::IAnimatedMesh* mesh;
irr::scene::ISceneNode* node;
irr::scene::ISceneNode * tempNode; //use this to store nodeNew's data so we can resize it
irr::scene::ICameraSceneNode * cam;
char key;
void IrrLib::Init();
/*friend class IrrColor;
friend class Irr2DLib;
friend class Sphere;*/
//friend class IrrEventReciever;
irr::u32 tick;
irr::ITimer* timer;
public:
//IrrSphere Sphere; //This has to be public to be able to access the Sphere class
/* IrrSphere is now in Irr3D class */
//Prehaps put this into a IrrLib3D class?
Irr3D Irr3DLib;
IrrColor Color; //Color class...not much of a class but lets keep it OO
Irr2D Irr2DLib; //1/2 variable to be labeled like this due to variables not able to begin with a number
IrrLibGUI GUI;
IrrEventReciever IrrEvent;
IrrLib::IrrLib();
//IrrLib::IrrLib(MastEventReceiver & receiver);
IrrLib::IrrLib(irr::video::E_DRIVER_TYPE drivertype, irr::core::dimension2d<irr::s32> & res, irr::u32 bits, bool fullscreen, bool stencilbuffer, bool vsync);
IrrLib::IrrLib(int drivertype, int width, int height, int bits, bool fullscreen, bool stencilbuffer, bool vsync);
IrrLib::~IrrLib(); //Our moms wont clean up after us!
void IrrLib::ReadArchive(irr::core::stringc file);
void IrrLib::LoadQ3Level(irr::core::stringc q3level);
void IrrLib::MapPos(int x, int y, int z); //I think this moves the actual camera?
void IrrLib::MapPos();
void IrrLib::AddFPSCam();
void IrrLib::AddFPSCam(irr::f32 x, irr::f32 y, irr::f32 z);
void IrrLib::VisibleCursor(bool tf);
int IrrLib::GetFPSCount();
bool IrrLib::DeviceIsRunning();
bool IrrLib::IsActiveWindow();
void IrrLib::BeginScene();
void IrrLib::BeginScene(irr::video::SColor color);
//void IrrLib::BeginScene(irr::video::SColor * color);
void IrrLib::BeginScene(bool usebackBuffer, bool usezBuffer, irr::video::SColor color);
//TODO: Add one more for human readable colors and hex colors!
void IrrLib::DrawAll();
void IrrLib::EndScene();
void IrrLib::SetWindowCaption(irr::core::stringw str);
irr::core::stringw IrrLib::GetDriverName();
//TODO: Make function to turn stringw to string and visa versa
void IrrLib::EndIrrlicht(); //Renamed from KillIrrlicht to EndIrrlicht
//TODO: Add logging
void IrrLib::KeyPress(char key);
char IrrLib::KeyPressed();
irr::f32 getX();
irr::f32 getY();
irr::f32 getZ();
bool CheckGameLoop();
bool CheckGameLoop(irr::u32 ms);
void Exit();
PixelSize GetScreenSize();
//void EndGameLoop();
//template <class T> std::string to_string (T t);
};
#endif
Unstable Version/1.3.1/Readme
1
2
3
4
5
6
7
8
9
10
11
12
13
Irrlicht Library Wrapper
Created by Nathan Adams
Version 1.2.9
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
Please leave all files intact if you redistrubte this software.
How to use:
Add all the files to your Irrlicht project, you could compile it into a DLL if you wanted too, but for now just add all the files to your project.
Then inside your complier add the directory that you have the IrrLib files and use #include "IrrLib.h" to refrence it, and you are good to go!
Unstable Version/1.3.2/CHANGES
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
Version 1.2
+ Added a Irr3DLib class that will control all 3D objects
+ Also Added a Irr2D class that works on the same concept.
+ IrrSphere is now owned by Irr3DLib
+ Updated the examples using the latest code
Version 1.2.2
+ Added IrrEventReciever to handle all input
- Still under work
+ Fixed some misc coding bugs
+ Added template class
+ Added sprite class
+ Added GUI class
Version 1.2.3
+ IrrEventReciver now works as advertised
+ Baseclass is now being used
+ A couple somewhat-useful functions
+ int_to_string
+ stringw_to_stdstring
+ stdstring_to_stringw
+ GUI elements
+ Static text is working
+ Under construction for a data type class
Version 1.2.4
+ Implmented color codes accessiable through the class
+ IrrLib.Color.RED (ect)
Version 1.2.5
+ Implmented mouse events
+ IrrLib.IrrEvent.getMouseX();
+ IrrLib.IrrEvent.getMouseY();
+ Using vectors instead of static arrays
+ Side note: Was going to use dynamic arrays, but C++ has vectors which are 10x better.
+ Added a default exit for when you hit esc
+ Use IrrLib.IrrEvent.SetEscExit(false) to turn that off for your software
+ Use IrrLib.IrrEvent.SetEscExit(true) to turn it back on
+ Every stable version will now include a windows DLL.
+ Possible Linux .so file in the future.
Version 1.2.6
+ Added a IrrEvent for buttons
+ IrrLib.IrrEvent.checkButtonState();
+ See example for use
+ Added an AddButton function
+ IrrLib.GUI.AddButton(..);
+ See example for use
+ Problems with making the DLL
+ reasearching
Version 1.2.7
+ Fixed DLL Problem
+ Added an enum example to example 1
+ Added more examples
+ Added example 9
+ Added left click handling (see example 9)
+ Added AddLines function to Irr2D
+ DrawLines function in Irr2D will draw the lines you add
Version 1.2.9
+ Added Listbox GUI object
+ Added a new datatype IrrObj
+ Contains 2 ints, 1 for object id and 1 for event id
+ Added a IrrData.h file
Version 1.3.0
+ Changed String class use to Irrlicht's type Strings
Version 1.3.1
+ Added support for newest Irrlict version
Version 1.3.2
+ Added Newton Physics engine
- Deleted Irr2D::Collision as this will be now handled by the physics engine
+ Added a few functions for Collision
+ Added a new object Irr3DObj
+ Has several functions that allow you to work easily with 3D objects including moving them and setting the texture.
+ You can now detect collision between 2 3D objects and output them to the screen
+ Example code: http://pastethis.net/?code=49
+ Changed the way IrrColor colors work
+ Changed internally handling of some global variables
+ Added some static variables
+ Irrlicht Device is now static in IrrLib class
+ Some variables that deal with Physics are static
+ Updated copyright
+
Unstable Version/1.3.2/CREDITS
1
2
3
4
5
6
7
8
9
10
IrrLib
Created by
Nathan Adams
From #irrlicht
Acid
wacom
From Irrlicht Forums
Denzel Morris
Unstable Version/1.3.2/Irr2D.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Copyright (C) 2008
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
//#include "IrrLib.h"
//#include "IrrSphere.h" //You probably aren't going to be using 3D objects in a 2D environment!
#include <irrlicht.h>
#include <strings.h>
#include "Irr2D.h"
#include "IrrSprite.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
Irr2D::Irr2D(){
this->numTextures = 0;
this->numLines = 0;
this->nImages = 0;
//NA Should we set textures to new
}
Irr2D::~Irr2D(){
/*for(int i = 0; i < numTextures; ++i)
delete this->textures[i];
delete this->textures;*/
//No more dynamic memory business yay! NA
//All handled by vectors!
}
/*void Irr2D::SetSmgr(irr::scene::ISceneManager* smgr){
this->smgr = smgr;
Sprite.SetSmgr(smgr);
}
void Irr2D::SetDriver(irr::video::IVideoDriver* driver){
this->driver = driver;
Sprite.SetDriver(driver);
}*/
IrrObj Irr2D::LoadTexturemap(stringc file){
this->texturemap = driver->getTexture(file.c_str());
}
IrrObj Irr2D::LoadTexture(stringc file){
//this->textures[this->numTextures] = driver->getTexture(file.c_str());
textures.push_back(driver->getTexture(file.c_str()));
this->numTextures++;
IrrObj ret;
ret.eventid = 0;
ret.objectid = numTextures--;
return ret;
}
void Irr2D::DrawLine(IrrPos& start, IrrPos& end, irr::video::SColor color)
{
this->driver->draw2DLine(start, end, color);
}
void Irr2D::AddLines(IrrPos& start, IrrPos& end, irr::video::SColor color)
{
this->start.push_back(start);
this->end.push_back(end);
this->color.push_back(color);
this->numLines++;
}
void Irr2D::DrawLines()
{
for(int i = 0; i < numLines; ++i)
this->driver->draw2DLine(this->start[i], this->end[i], this->color[i]);
}
IrrObj Irr2D::LoadIrrImage(irr::core::stringc file)
{
images.push_back(this->driver->getTexture(file.c_str()));
IrrObj ret;
ret.objectid = nImages;
ret.eventid = 0;
this->nImages++;
return ret;
}
void Irr2D::DrawImage(IrrObj img)
{
irr::core::position2d<irr::s32> destPos(img.x, img.y);
this->driver->draw2DImage(images[img.objectid], destPos);
}
void Irr2D::Draw2DObj(irr::core::stringc file)
{
//NewtonObj tmp;
//tmp.irr_node = smgr->addMeshSceneNode(smgr->getMesh(file.c_str())->getMesh(0));
//IMeshSceneNode* temp;
objects.push_back(smgr->addMeshSceneNode(smgr->getMesh(file.c_str())->getMesh(0)));
objects.push_back(smgr->addMeshSceneNode(smgr->getMesh(file.c_str())->getMesh(0)));
objects[0]->setPosition(vector3df(-5,0,0));
objects[0]->getMaterial(0).EmissiveColor.set(255,0,255,5);
}
/*bool Irr2D::Collision(IrrObj obj1, IrrObj obj2)
{
int x1 = obj1.x;
int y1 = obj1.y;
}*/
Unstable Version/1.3.2/Irr2D.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Copyright (C) 2008
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRR2D_H
#define IRR2D_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
#include <vector>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
//#include "IrrLib.h"
#include "IrrData.h"
#include "IrrSprite.h"
class Irr2D: public IrrLibBase {
private:
//irr::scene::ISceneManager* smgr;
//irr::video::IVideoDriver* driver;
//Inherited from IrrLibBase
irr::video::ITexture* texturemap;
int numTextures;
//irr::video::ITexture* textures[10];
std::vector<irr::video::ITexture*> textures;
std::vector<irr::core::position2d<irr::s32> > start;
std::vector<irr::core::position2d<irr::s32> > end;
std::vector<irr::video::SColor> color;
std::vector<irr::video::ITexture*> images;
std::vector<irr::scene::IMeshSceneNode*> objects;
int numLines;
int nImages;
public:
//Irr2D::Irr2D();
IrrSprite Sprite;
Irr2D::Irr2D();
Irr2D::~Irr2D();
//void Irr2D::SetDriver(irr::video::IVideoDriver* driver);
//void Irr2D::SetSmgr(irr::scene::ISceneManager* smgr);
//Inherited from irrlibbase
IrrObj Irr2D::LoadTexturemap(irr::core::stringc file);
IrrObj Irr2D::LoadTexture(irr::core::stringc file);
//Has been renamed from LoadImage to LoadIrrImage due to conflict with windows API
IrrObj Irr2D::LoadIrrImage(irr::core::stringc file);
//void Irr2D::DrawImage(int texture, const irr::core::position2d<irr::s32> & destPos);
//void Irr2D::DrawImage(IrrObj& img, irr::core::position2d<irr::s32>& destPos);
void Irr2D::DrawImage(IrrObj img);
void Irr2D::Draw2DObj(irr::core::stringc file);
//void Irr2D::MoveImage(IrrObj img, irr::core::dimension2d<irr::s32> destPos);
//void Irr2D::MoveImage(IrrObj img, int x, int y);
//void Irr2D::DrawImage(const irr::core::position2d<irr::s32> & destPos, const irr::core::rect<irr::s32> & sourceRect, const irr::core::rect<irr::s32> * clipRect, irr::video::SColor color, bool useAlphaChannelOfTexture);
//void Irr2D::DrawImage(const irr::core::position2d<irr::s32> & destPos, const irr::core::rect<irr::s32> & sourceRect, const irr::core::rect<irr::s32> * clipRect, irr::video::SColor color, bool useAlphaChannelOfTexture);
//void Irr2D::DrawLine(irr::core::position2d<irr::s32>& start, irr::core::position2d<irr::s32>& end, irr::video::SColor& color);
void Irr2D::DrawLine(IrrPos& start, IrrPos& end, irr::video::SColor color);
void Irr2D::DrawLines();
//void Irr2D::AddLines(irr::core::position2d<irr::s32>& start, irr::core::position2d<irr::s32>& end, irr::video::SColor& color);
void Irr2D::AddLines(IrrPos& start, IrrPos & end, irr::video::SColor color);
//bool Irr2D::Collision(IrrObj obj1, IrrObj obj2);
//IrrObj Irr2D::LoadImageA(irr::core::stringc file);
};
#endif
Unstable Version/1.3.2/Irr3D.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Copyright (C) 2008
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <strings.h>
//#include "IrrLib.h"
//Libraries we create go here
#include "IrrSphere.h"
//#include "IrrColor.h"
#include "Irr3D.h"
#include <irrlicht.h>
//#include "Irr2D.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
/*void Irr3D::SetDriver(irr::video::IVideoDriver* driver) //so much for copying and pasting code from the header file
{
this->driver = driver;
Sphere.SetDriver(driver);
}
void Irr3D::SetSmgr(irr::scene::ISceneManager* smgr)
{
this->smgr = smgr;
Sphere.SetSmgr(smgr);
}*/
Irr3D::Irr3D()
{
//do stuff here!
}
Irr3D::~Irr3D()
{
//delete stuff here!
}
Unstable Version/1.3.2/Irr3D.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Copyright (C) 2008
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRR3D_H
#define IRR3D_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
#include "IrrSphere.h"
//#include "IrrColor.h"
//#include "Irr3D.h"
//#include "Irr2D.h" This is a 3D class not 2D
/* However due to Irrlciht's nature mixing 2D with 3D is possible */
//Start class
class Irr3D: public IrrLibBase {
private:
//irr::video::IVideoDriver* driver;
//irr::scene::ISceneManager* smgr;
public:
IrrSphere Sphere;
Irr3D::Irr3D();
Irr3D::~Irr3D();
//void Irr3D::SetDriver(irr::video::IVideoDriver* driver);
//void Irr3D::SetSmgr(irr::scene::ISceneManager* smgr);
};
#endif
Unstable Version/1.3.2/Irr3DObj.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Copyright (C) 2008
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <irrlicht.h>
#include <strings.h>
#include <newton.h>
#include "Irr3DObj.h"
#include "IrrData.h"
#include "IrrPhysics.h"
#include "IrrLib.h"
#include "IrrFunctions.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
Irr3DObj::Irr3DObj()
{
this->col.a = 0;
this->col.b = 0;
this->col.g = 0;
this->col.r = 0;
}
Irr3DObj::Irr3DObj(Irr3DObjColor col)
{
this->col.a = col.a;
this->col.b = col.b;
this->col.g = col.g;
this->col.r = col.r;
}
/*Irr3DObj::Irr3DObj(IrrLib &irr, Irr3DObjColor col)
{
this->col.a = col.a;
this->col.r = col.r;
this->col.g = col.g;
this->col.b = col.b;
}*/
IMeshSceneNode* Irr3DObj::getSceneNode()
{
return this->irr_node;
}
NewtonCollision* Irr3DObj::getNewtonCollision()
{
return this->nwtn_collision;
}
void Irr3DObj::setTexture(irr::core::stringc strng)
{
this->texture = strng;
}
void Irr3DObj::Move(Irr3DPos pos)
{
this->irr_node->setPosition(vector3df(pos.x, pos.y, pos.z));
}
void Irr3DObj::addToScene()
{
if (this->texture == "")
{
cout << "Material not set for this object" << endl;
return;
}
ISceneManager* smgr = IrrLib::device->getSceneManager();
//this->irr_node = this->device->getSceneManager->addMeshSceneNode(this->device->getSceneManager->getMesh(this->texture.c_str())->getMesh(0));
this->irr_node = smgr->addMeshSceneNode(smgr->getMesh(this->texture.c_str())->getMesh(0));
this->irr_node->getMaterial(0).EmissiveColor.set(this->col.a, this->col.r, this->col.g, this->col.b);
//cout << col.a << endl;
this->nwtn_collision = CreateCollisionFromMesh(IrrPhysics::nworld, this->irr_node->getMesh());
}
Unstable Version/1.3.2/Irr3DObj.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Copyright (C) 2008
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef Irr3DObj_H
#define Irr3DObj_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
//#include <strings.h>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
#include <newton.h>
#include "IrrData.h"
//class IrrLib;
#include "IrrLib.h"
class Irr3DObj: public IrrLibBase {
private:
IrrLib * Irrlicht;
irr::scene::IMeshSceneNode *irr_node;
NewtonCollision *nwtn_collision;
irr::core::stringc texture;
Irr3DObjColor col;
public:
Irr3DObj::Irr3DObj(Irr3DObjColor col);
Irr3DObj::Irr3DObj();
void Irr3DObj::Move(Irr3DPos pos);
//Irr3DObj::Irr3DObj(IrrLib &irr, Irr3DObjColor col);
//Irr3DObj::~Irr3DObj();
void addToScene();
void createNewObj();
void setTexture(irr::core::stringc strng);
void setPosition(Irr3DPos pos);
void setPosition(irr::u32 x, irr::u32 y, irr::u32 z);
irr::scene::IMeshSceneNode* getSceneNode();
NewtonCollision* getNewtonCollision();
};
#endif
Unstable Version/1.3.2/IrrColor.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Copyright (C) 2008
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <irrlicht.h>
#include <strings.h>
//#include "IrrLib.h"
#include "IrrColor.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
void IrrColor::Init(){
/*SColor * temp;
temp = new SColor(alpha, 255, 0, 0);
this->RED = temp;
delete temp;*/
this->RED = SColor(alpha, 255, 0, 0);
this->ORANGE = SColor(alpha, 255, 165, 0);
this->YELLOW = SColor(alpha, 255, 255, 0);
this->GREEN = SColor(alpha, 0, 255, 0);
this->BLUE = SColor(alpha, 0, 0, 255);
this->DARK_GREEN = SColor(alpha, 0, 100, 0);
this->PINK = SColor(alpha, 255, 192, 203);
this->GREY = SColor(alpha, 190, 190, 190);
this->WHITE = SColor(alpha, 0, 0, 0);
this->BLACK = SColor(alpha, 0, 0, 0);
}
IrrColor::~IrrColor(){
/*delete this->RED;
delete this->ORANGE;
delete this->YELLOW;
delete this->GREEN;
delete this->BLUE;
delete this->DARK_GREEN;
delete this->PINK;
delete this->GREY;
delete this->WHITE;
delete this->BLACK;*/
}
IrrColor::IrrColor(){
this->alpha = 255;
Init();
}
IrrColor::IrrColor(irr::u32 alpha){
this->alpha = alpha;
Init();
}
int IrrColor::getAlpha(){
return this->alpha;
}
void IrrColor::setAlpha(int alpha){
this->alpha = alpha;
}
SColor IrrColor::returnColor(stringw color){
int nColor = -1;
if (color == "red")
nColor = 1;
else if (color == "green")
nColor = 2;
else if (color == "blue")
nColor = 3;
else if (color == "dark green")
nColor = 4;
else if (color == "pink")
nColor = 5;
else if (color == "grey")
nColor = 6;
switch (nColor){
case 1:
return SColor(255, 255, 0, 0);
break;
case 2:
return SColor(255, 0, 255, 0);
break;
case 3:
return SColor(255, 0, 0, 255);
break;
case 4:
return SColor(255, 0, 50, 0);
break;
case 5:
return SColor(255, 255, 10, 255);
break;
case 6:
return SColor(255,200,200,200);
break;
default:
return SColor(255,200,200,200);
break;
}// TODO: Make this function modular
}
Unstable Version/1.3.2/IrrColor.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Copyright (C) 2008
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRCOLOR_H
#define IRRCOLOR_H
#include <iostream>
#include <strings.h>
#include "irrlicht.h"
//#include "IrrLib.h"
class IrrColor {
private:
irr::u32 alpha;
void Init();
//who knows?
public:
//irr::video::SColor(alpha, 255, 0, 0);
irr::video::SColor RED;
irr::video::SColor ORANGE;
irr::video::SColor YELLOW;
irr::video::SColor GREEN;
irr::video::SColor BLUE;
irr::video::SColor DARK_GREEN;
irr::video::SColor PINK;
irr::video::SColor GREY;
irr::video::SColor WHITE;
irr::video::SColor BLACK;
/*const ORANGE = irr::video::SColor(alpha, 255, 165, 0);
const YELLOW = irr::video::SColor(alpha, 255, 255, 0);
const GREEN = irr::video::SColor(alpha, 0, 255, 0);
const BLUE = irr::video::SColor(alpha, 0, 0, 255);
const DARK_GREEN = irr::video::SColor(alpha, 0, 100, 0);
const PINK = irr::video::SColor(alpha, 255, 192, 203);
const GREY = irr::video::Scolor(alpha, 190, 190, 190);*/
//void IrrColor::test();
IrrColor();
IrrColor(irr::u32 alpha);
~IrrColor();
int getAlpha();
void setAlpha(int alpha);
irr::video::SColor returnColor(irr::core::stringw color);
};
#endif
Unstable Version/1.3.2/IrrData.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#ifndef IRRDATA_H
#define IRRDATA_H
#include <irrlicht.h>
typedef irr::core::dimension2d<irr::s32> PixelSize;
typedef irr::core::position2d<irr::s32> IrrPos;
//typedef irr::core::position3d<irr::s32> Irr3DPos;
struct Irr3DPos {
int x;
int y;
int z;
};
struct pixels {
int width;
int height;
}; //possible future use in 2D objects when specifying the properties of an object draw
struct IrrObj {
int eventid;
int objectid;
int x;
int y;
};
struct Collision {
int nHits;
bool hit;
};
struct _mouse {
int x;
int y;
};
struct Irr3DObjColor {
irr::u32 r;
irr::u32 g;
irr::u32 b;
irr::u32 a;
};
struct IrrOpt {
bool lighting;
irr::core::stringc t;
};
struct IrrMatFlags {
};
#endif
Unstable Version/1.3.2/IrrEventReciever.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Copyright (C) 2008
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include "IrrEventReciever.h"
#include "IrrData.h"
#include "IrrLib.h"
//#include "IrrLib.h"
#include <irrlicht.h>
#include <iostream>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
/*void IrrEventReciever::setIrrLib(IrrLib& IrrLib)
{
this.callingIrrLib = IrrLib;
}*/
IrrEventReciever::IrrEventReciever()
{
this->escexit = true;
this->mouse.x = 0;
this->mouse.y = 0;
for(int i = 0; i < irr::KEY_KEY_CODES_COUNT; i++)
keyStates[i] = false;
this->device = IrrLib::device;
}
#if IRRVER == 131
bool IrrEventReciever::OnEvent(SEvent event)
#else
bool IrrEventReciever::OnEvent(const SEvent &event)
#endif
{
// A button was clicked
if (event.EventType == irr::EET_GUI_EVENT)
{
s32 id = event.GUIEvent.Caller->getID();
switch(event.GUIEvent.EventType){
case EGET_BUTTON_CLICKED:
//cout << id << endl;
buttonStates.push_back(id);
break;
case EGET_LISTBOX_CHANGED:
//s32 id = event.GUIEvent.Caller->getID();
listStates.push_back(id);
break;
case EGET_LISTBOX_SELECTED_AGAIN:
listStates.push_back(id);
break;
default:
break;
}
}
/*if (event.EventType == irr::EGET_SCROLL_BAR_CHANGED)
{
}*/
if (event.EventType == irr::EET_KEY_INPUT_EVENT) {
if (!event.KeyInput.PressedDown){
this->keyStates[event.KeyInput.Key] = false;
//cout << "Key was not hit " << this->keyStates[event.KeyInput.Key] << endl;
}
else{
if(event.KeyInput.Key == KEY_ESCAPE && escexit)
IrrLib::device->closeDevice();
this->keyStates[event.KeyInput.Key] = true;
//cout << "Key was hit: " << event.KeyInput.Key << " " << this->keyStates[event.KeyInput.Key] << endl;
}
}
if (event.EventType == EET_MOUSE_INPUT_EVENT){
if (event.MouseInput.Event == EMIE_MOUSE_MOVED){
this->mouse.x = event.MouseInput.X;
this->mouse.y = event.MouseInput.Y;
}
if (event.MouseInput.Event == EMIE_LMOUSE_PRESSED_DOWN)
this->mouseStates[0] = true;
if (event.MouseInput.Event == EMIE_LMOUSE_LEFT_UP)
this->mouseStates[0] = false;
}
return false;
}
void IrrEventReciever::SetEscExit(bool onoff)
{
this->escexit = onoff;
}
int IrrEventReciever::getMouseX()
{
return this->mouse.x;
}
int IrrEventReciever::getMouseY()
{
return this->mouse.y;
}
int IrrEventReciever::getButtonState()
{
if(!this->buttonStates.empty()){
int id;
id = buttonStates.back();
this->buttonStates.pop_back();
return id;
}
else
return -1;
}
int IrrEventReciever::getRevButtonState()
{
if(!this->buttonStates.empty()){
int id = buttonStates.front();
this->buttonStates.erase(buttonStates.begin());
return id;
}
else
return -1;
}
void IrrEventReciever::clearButtonState()
{
this->buttonStates.clear();
}
int IrrEventReciever::checkButtonState(IrrObj obj)
{
if(!this->buttonStates.empty()){
int tmp = this->buttonStates.back();
if (tmp == obj.eventid)
{
this->delLastButtonState();
return 1;
}
else
{
return 0;
}
}
else
{
return -1;
}
}
void IrrEventReciever::delLastButtonState()
{
if(!this->buttonStates.empty())
this->buttonStates.pop_back();
}
bool IrrEventReciever::isButtonStateEmpty()
{
return this->buttonStates.empty();
}
int IrrEventReciever::checkListState(IrrObj obj)
{
if(!this->listStates.empty())
{
int tmp = this->listStates.back();
//cout << tmp << endl;
if (tmp == obj.eventid)
{
this->delLastListState();
return 1;
}
else
{
return 0;
}
}
else
{
return 0;
}
}
void IrrEventReciever::delLastListState()
{
if(!this->listStates.empty())
this->listStates.pop_back();
}
Unstable Version/1.3.2/IrrEventReciever.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Copyright (C) 2008
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRREVENTRECIEVER_H
#define IRREVENTRECIEVER_H
//#include "IrrLib.h"
#include <vector>
#include <irrlicht.h>
#include "IrrLibBase.h"
#include "IrrData.h"
#include <stdlib.h>
class IrrEventReciever : public irr::IEventReceiver, public IrrLibBase
{
private:
//IrrLib callingIrrLib;
_mouse mouse;
bool escexit;
std::vector<int> buttonStates;
std::vector<int> listStates;
irr::IrrlichtDevice *device;
public:
//IrrEventReciever();
bool mouseStates[1];
IrrEventReciever();
int getMouseX();
int getMouseY();
bool keyStates[irr::KEY_KEY_CODES_COUNT];
//void setIrrLib(IrrLib& IrrLib)
#if IRRVER == 131
virtual bool OnEvent(irr::SEvent event);
#else
virtual bool OnEvent(const irr::SEvent &event);
#endif
void SetEscExit(bool onoff);
int getButtonState();
int getRevButtonState();
void clearButtonState();
int checkButtonState(IrrObj obj);
void delLastButtonState();
bool isButtonStateEmpty(); //is there still stuff in the vector to be done? NA
int checkListState(IrrObj obj);
void delLastListState();
};
#endif
Unstable Version/1.3.2/IrrFunctions.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
#include "IrrFunctions.h"
#include "Irr3DObj.h"
#include <newton.h>
#include <irrlicht.h>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
int CheckForCollision(NewtonWorld *nWorld, Irr3DObj *obj_A, Irr3DObj *obj_B)
{
//Matrix to store irr_node position
matrix4 mat_A,mat_B;
//Copy position
mat_A.makeIdentity();
mat_B.makeIdentity();
mat_A.setTranslation(obj_A->getSceneNode()->getPosition());
mat_B.setTranslation(obj_B->getSceneNode()->getPosition());
const int nContacts = 2;
float contacts[3 * nContacts];
float normals[3 * nContacts];
float penetration[ nContacts ];
//Check for collision between collision meshes,
// returns number of contact points
int nHits = NewtonCollisionCollide( nWorld,nContacts,
obj_A->getNewtonCollision(), (float*)&mat_A[0],
obj_B->getNewtonCollision(), (float*)&mat_B[0],
contacts,
normals,
penetration);
//Collision detected if nHits > 0
/*if( nHits > 0)
return true;
return false;*/
return nHits;
}
//Function to create a NewtonCollision from irrlicht mesh with tree optimization
NewtonCollision * CreateTreeCollisionFromMesh(NewtonWorld *nWorld, IMesh *irr_mesh )
{
//Create new (tree optimized) collision mesh
NewtonCollision *collision_obj = NewtonCreateTreeCollision(nWorld ,NULL);
//Begin collision mesh construction
NewtonTreeCollisionBeginBuild(collision_obj);
int nMeshBuffer = 0; //Mesh Buffer count
int v_index[3] = {0,0,0}; //vertex indices
IMeshBuffer *mesh_buffer = NULL;
float array[9]; //Array to store 3 vertices
//Get (irr_)mesh buffers and copy face by face to collision mesh
for( nMeshBuffer=0 ; nMeshBuffer < irr_mesh->getMeshBufferCount() ; nMeshBuffer++ )
{
mesh_buffer = irr_mesh->getMeshBuffer(nMeshBuffer);
//Get pointer to vertices and indices
S3DVertex *vertices = (S3DVertex*)mesh_buffer->getVertices();
u16 *indices = mesh_buffer->getIndices();
//Fill collision mesh
for(int i=0; i<mesh_buffer->getIndexCount(); i+=3)
{
v_index[0] = indices[ i ];
v_index[1] = indices[i+1];
v_index[2] = indices[i+2];
// 1st position vertex
array[0] = vertices[ v_index[0] ].Pos.X;
array[1] = vertices[ v_index[0] ].Pos.Y;
array[2] = vertices[ v_index[0] ].Pos.Z;
// 2nd position vertex
array[3] = vertices[ v_index[1] ].Pos.X;
array[4] = vertices[ v_index[1] ].Pos.Y;
array[5] = vertices[ v_index[1] ].Pos.Z;
// 3rd position vertex
array[6] = vertices[ v_index[2] ].Pos.X;
array[7] = vertices[ v_index[2] ].Pos.Y;
array[8] = vertices[ v_index[2] ].Pos.Z;
//Add new face to collision mesh
NewtonTreeCollisionAddFace(collision_obj, //collision mesh to add face to
3, //number of vertices in array
(float*)array, //pointer to vertex array
3*sizeof(float),//size of each vertex
1); //ID of the face
}
}
//End collision contruction , set 1 as 2dn param for optimization
NewtonTreeCollisionEndBuild(collision_obj,0);
return collision_obj;
}
//Function to create a NewtonCollision from irrlicht mesh
NewtonCollision * CreateCollisionFromMesh(NewtonWorld *nWorld, IMesh *irr_mesh )
{
int nMeshBuffer = 0; //Mesh Buffer count
IMeshBuffer *mesh_buffer = NULL;
float *vertices; //Array to store vertices
u32 nVertices = 0;
//Get number of vertices
for( nMeshBuffer=0 ; nMeshBuffer < irr_mesh->getMeshBufferCount() ; nMeshBuffer++ )
{
nVertices += irr_mesh->getMeshBuffer(nMeshBuffer)->getVertexCount();
}
//create buffer for vertices
vertices = new float[nVertices * 3];
u32 tmpCounter = 0;
//Get (irr_)mesh buffers and copy face vertices
for( nMeshBuffer=0 ; nMeshBuffer < irr_mesh->getMeshBufferCount() ; nMeshBuffer++ )
{
mesh_buffer = irr_mesh->getMeshBuffer(nMeshBuffer);
//Get pointer to vertices and indices
S3DVertex *S3vertices = (S3DVertex*)mesh_buffer->getVertices();
//copy vertices from mesh to buffer
for(int i=0; i<mesh_buffer->getVertexCount(); i++)
{
vertices[tmpCounter++] = S3vertices[i].Pos.X;
vertices[tmpCounter++] = S3vertices[i].Pos.Y;
vertices[tmpCounter++] = S3vertices[i].Pos.Z;
}
}
//Create Newton collision object
NewtonCollision *collision_obj = NewtonCreateConvexHull(nWorld,nVertices,vertices,sizeof(float)*3,NULL);
//delete vertices
delete [] vertices;
return collision_obj;
}
Unstable Version/1.3.2/IrrFunctions.h
1
2
3
4
5
6
7
8
9
#ifndef IRRFUNCTIONS_H
#define IRRFUNCTIONS_H
#include "Irr3DObj.h"
int CheckForCollision(NewtonWorld *nWorld, Irr3DObj *obj_A, Irr3DObj *obj_B);
NewtonCollision * CreateTreeCollisionFromMesh(NewtonWorld *nWorld, irr::scene::IMesh *irr_mesh );
NewtonCollision * CreateCollisionFromMesh(NewtonWorld *nWorld, irr::scene::IMesh *irr_mesh );
#endif
Unstable Version/1.3.2/IrrLib.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Copyright (C) 2008
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <irrlicht.h>
#include <strings.h>
#include <sstream>
#include <time.h>
#include "IrrLib.h"
//Libraries we create go here
//#include "IrrSphere.h"
#include "IrrColor.h"
//#include "Irr2D.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
/*IrrLib::IrrLib(MastEventReceiver & receiver){
this->device = createDevice(EDT_SOFTWARE, dimension2d<s32>(640, 480), 16, false, false, false, &receiver);
if (this->device == 0)
exit(1);
IrrLib::Init();
}*/
IrrlichtDevice *IrrLib::device;
IrrLib::IrrLib(){
IrrLib::device = createDevice(EDT_SOFTWARE, dimension2d<s32>(640, 480), 16, false, false, false, &this->IrrEvent);
if (IrrLib::device == 0)
exit(1);
IrrLib::Init();
}
IrrLib::IrrLib(video::E_DRIVER_TYPE drivertype, core::dimension2d<s32> & res, u32 bits, bool fullscreen, bool stencilbuffer, bool vsync){
//MyEventReceiver receiver;
this->device = createDevice(drivertype, res, bits, fullscreen, stencilbuffer, vsync, &this->IrrEvent);
if (this->device == 0)
exit(1);
IrrLib::Init();
}
IrrLib::IrrLib(int nDrivertype, int width, int height, int bits, bool fullscreen, bool stencilbuffer, bool vsync){
//MyEventReceiver receiver;
video::E_DRIVER_TYPE drivertype;
switch (nDrivertype){
case 0: //TODO: finish this switch case
drivertype = EDT_NULL;
break;
case 1:
drivertype = EDT_SOFTWARE;
break;
case 2:
drivertype = EDT_BURNINGSVIDEO;
break;
case 3:
drivertype = EDT_OPENGL;
break;
case 4:
#if DX8 == 1
drivertype = EDT_DIRECT3D8;
#else
drivertype = EDT_OPENGL;
#endif
//*Note: It seems as Microsoft has stoped supporting DX 8.1, so you can not compile it into Irrlicht engine anymore
//TODO: Find how to detect if DX is complied into Irrlicht
//TODO: Find how to detecht for linux
break;
case 5:
#if DX9 == 1
drivertype = EDT_DIRECT3D9;
#else
drivertype = EDT_OPENGL;
#endif
break;
default:
drivertype = EDT_SOFTWARE;
break;
}
this->device = createDevice(drivertype, dimension2d<s32>(width, height), bits, fullscreen, stencilbuffer, vsync, &this->IrrEvent);
if (this->device == 0)
exit(1);
IrrLib::Init();
}
IrrLib::~IrrLib (){ //Our moms wont clean up after us!
//Although I'm sure Irrlicht does this for us already, its always a good idea to check!
/*if (this->device != NULL)
delete this->device;
if (this->driver != NULL)
delete this->driver;
if (this->smgr != NULL)
delete this->smgr;
if (this->mesh != NULL)
delete this->mesh;
if (this->node != NULL)
delete this->node;*/ //it seems Irrlicht picks up after us...
//however we created newNodes, now we need to delete it!
// NewtonReleaseCollision(nworld, sphere.nwtn_collision);
// NewtonReleaseCollision(nworld, cube.nwtn_collision);
//NewtonDestroy(IrrPhy.nworld);
}
void IrrLib::Init(){
//this->numNodes = 0;
//this->nodeNew = new ISceneNode[10];
//this->env->addStaticText(L"Transparent Control:", rect<s32>(20,30,300,80), true);
this->env = this->device->getGUIEnvironment();
this->driver = this->device->getVideoDriver();
this->smgr = this->device->getSceneManager();
Irr3DLib.SetSmgr(this->smgr);
Irr3DLib.SetDriver(this->driver);
Irr2DLib.SetSmgr(this->smgr);
Irr2DLib.SetDriver(this->driver);
//IrrEvent.SetDevice(this->device);
//Irr2DObj.SetDriver(this->device);
GUI.SetEnv(this->env);
//IrrEvent.SetDevice(this->device);
this->timer = this->device->getTimer();
tick = this->timer->getRealTime();
}
void IrrLib::ReadArchive(stringc file){
this->device->getFileSystem()->addZipFileArchive(file.c_str());
}
void IrrLib::LoadQ3Level(stringc q3level){
this->mesh = this->smgr->getMesh(q3level.c_str());
this->node = 0;
if (this->mesh)
this->node = this->smgr->addOctTreeSceneNode(this->mesh->getMesh(0), 0, -1, 128);
}
void IrrLib::MapPos(int x, int y, int z){
if (this->node)
this->node->setPosition(core::vector3df(x, y, z));
}
void IrrLib::MapPos(){
if (this->node)
this->node->setPosition(core::vector3df(0, 0, 0));
}
void IrrLib::AddFPSCam(){
this->cam = this->smgr->addCameraSceneNodeFPS();
}
void IrrLib::AddFPSCam(f32 x, f32 y, f32 z)
{
this->cam = this->smgr->addCameraSceneNodeFPS();
this->cam->setPosition(irr::core::vector3df(x, y, z));
}
void IrrLib::VisibleCursor(bool tf){
if (tf == false)
this->device->getCursorControl()->setVisible(false);
else
this->device->getCursorControl()->setVisible(true);
}
int IrrLib::GetFPSCount(){
return this->driver->getFPS();
}
bool IrrLib::DeviceIsRunning(){
return this->device->run();
}
bool IrrLib::IsActiveWindow(){
return this->device->isWindowActive();
}
void IrrLib::BeginScene(){
this->driver->beginScene(true, true, video::SColor(0,200,200,200));
//smgr->addCameraSceneNode(0, vector3df(0,1,-7), vector3df(0,0,0));
}
void IrrLib::BeginScene(irr::video::SColor color){
this->driver->beginScene(true, true, color);
}
void IrrLib::BeginScene(bool usebackBuffer, bool usezBuffer, irr::video::SColor color){
this->driver->beginScene(usebackBuffer, usezBuffer, color);
}
void IrrLib::DrawAll(){
//position2d<int> start(50, 50);
//position2d<int> end(100,100);
// SColor whitecolor(255,255,255,255);
//driver->draw2DLine(start, end, whitecolor);
this->smgr->drawAll();
//this->env->drawAll();
//this->device->getGUIEnvironment()->drawAll();
}
void IrrLib::EndScene(){
this->driver->endScene();
}
void IrrLib::SetWindowCaption(stringw str){
this->device->setWindowCaption(str.c_str());
}
irr::core::stringw IrrLib::GetDriverName(){
return this->driver->getName();
}
void IrrLib::EndIrrlicht(){
if(this->device != NULL){
this->device->drop();
this->device = NULL;
}
}
void IrrLib::KeyPress(char key){
this->key = key;
}
char IrrLib::KeyPressed(){
return key;
}
irr::f32 IrrLib::getX(){
return this->smgr->getActiveCamera()->getPosition().X;
}
irr::f32 IrrLib::getY(){
return this->smgr->getActiveCamera()->getPosition().Y;
}
irr::f32 IrrLib::getZ(){
return this->smgr->getActiveCamera()->getPosition().Z;
}
bool IrrLib::CheckGameLoop(){
u32 now;
now = this->timer->getRealTime();
if ((now - this->tick) >= 30){
//this->tick == time (NULL);
return true;
} else {
return false;
}
}
bool IrrLib::CheckGameLoop(u32 ms){
u32 now;
now = this->timer->getRealTime();
if ((now - this->tick) >= ms){
this->tick = now;
return true;
} else {
return false;
}
}
void IrrLib::Exit()
{
this->device->closeDevice();
}
PixelSize IrrLib::GetScreenSize()
{
return this->driver->getScreenSize();
/*pixels returnres;
returnres.width = screenres.Width;
returnres.height = screenres.Height;
return returnres;*/
}
void IrrLib::AddCamera(core::vector3df pos, core::vector3df lookat)
{
this->smgr->addCameraSceneNode(0, pos, lookat);
}
//template <class T> std::string IrrLib::to_string (T t)
/*std::string IrrLib::int_to_string (int t)
{
std::stringstream ss;
ss << t;
return ss.str();
}*/
// This is in the base class now, every class that decends from that class has this ability.
Unstable Version/1.3.2/IrrLib.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Copyright (C) 2008
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRLIB_H
#define IRRLIB_H
#ifndef IRRVER
#define IRRVER 14
//2 Versions
// 14 or 131
//Different version due to different implmenation of eventreciever
#endif
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
#include <irrlicht.h>
#include <time.h>
/* We have to include Irrlichts libs */
#include "Irr3D.h"
#include "IrrColor.h"
#include "IrrLibGUI.h"
#include "IrrEventReciever.h"
#include "Irr2D.h"
//#include "Irr2DObj.h"
#include "IrrLibBase.h"
#include "IrrData.h"
//class IrrPhysics;
#include "IrrPhysics.h"
/*struct IrrObj {
int eventid;
int objectid;
};*/
//class IrrPhysics;
//Start class
class IrrLib: public IrrLibBase {
private:
/* Create an Irrlicht device as private because the class should handle
All irrlicht interaction */
//irr::IrrlichtDevice *device;
//In IrrLibBase
// Tells Irrlicht what driver to use
//video::E_DRIVER_TYPE driverType;
/*
Get a pointer to the video driver and the SceneManager so that
we do not always have to write device->getVideoDriver() and
device->getSceneManager().
*/
/*irr::video::IVideoDriver* driver;
irr::scene::ISceneManager* smgr;*/
//In IrrLibBase
irr::gui::IGUIEnvironment* env;
/*
Get a pointer to the 'mesh' aka the level.
Note: This is for Quake3 levels, ie bsp maps.
*/
irr::scene::IAnimatedMesh* mesh;
irr::scene::ISceneNode* node;
irr::scene::ISceneNode * tempNode; //use this to store nodeNew's data so we can resize it
irr::scene::ICameraSceneNode * cam;
char key;
void IrrLib::Init();
/*friend class IrrColor;
friend class Irr2DLib;
friend class Sphere;*/
//friend class IrrEventReciever;
irr::u32 tick;
irr::ITimer* timer;
public:
//IrrSphere Sphere; //This has to be public to be able to access the Sphere class
/* IrrSphere is now in Irr3D class */
//Prehaps put this into a IrrLib3D class?
Irr3D Irr3DLib;
IrrColor Color; //Color class...not much of a class but lets keep it OO
Irr2D Irr2DLib; //1/2 variable to be labeled like this due to variables not able to begin with a number
IrrLibGUI GUI;
IrrPhysics IrrPhy;
IrrEventReciever IrrEvent;
IrrLib::IrrLib();
static irr::IrrlichtDevice *device;
//IrrLib::IrrLib(MastEventReceiver & receiver);
IrrLib::IrrLib(irr::video::E_DRIVER_TYPE drivertype, irr::core::dimension2d<irr::s32> & res, irr::u32 bits, bool fullscreen, bool stencilbuffer, bool vsync);
IrrLib::IrrLib(int drivertype, int width, int height, int bits, bool fullscreen, bool stencilbuffer, bool vsync);
IrrLib::~IrrLib(); //Our moms wont clean up after us!
void IrrLib::ReadArchive(irr::core::stringc file);
void IrrLib::LoadQ3Level(irr::core::stringc q3level);
void IrrLib::MapPos(int x, int y, int z); //I think this moves the actual camera?
void IrrLib::MapPos();
void IrrLib::AddFPSCam();
void IrrLib::AddFPSCam(irr::f32 x, irr::f32 y, irr::f32 z);
void IrrLib::VisibleCursor(bool tf);
int IrrLib::GetFPSCount();
bool IrrLib::DeviceIsRunning();
bool IrrLib::IsActiveWindow();
void IrrLib::BeginScene();
void IrrLib::AddCamera(irr::core::vector3df pos, irr::core::vector3df lookat);
void IrrLib::BeginScene(irr::video::SColor color);
//void IrrLib::BeginScene(irr::video::SColor * color);
void IrrLib::BeginScene(bool usebackBuffer, bool usezBuffer, irr::video::SColor color);
//TODO: Add one more for human readable colors and hex colors!
void IrrLib::DrawAll();
void IrrLib::EndScene();
void IrrLib::SetWindowCaption(irr::core::stringw str);
irr::core::stringw IrrLib::GetDriverName();
//TODO: Make function to turn stringw to string and visa versa
void IrrLib::EndIrrlicht(); //Renamed from KillIrrlicht to EndIrrlicht
//TODO: Add logging
void IrrLib::KeyPress(char key);
char IrrLib::KeyPressed();
irr::f32 getX();
irr::f32 getY();
irr::f32 getZ();
bool CheckGameLoop();
bool CheckGameLoop(irr::u32 ms);
void Exit();
PixelSize GetScreenSize();
//void EndGameLoop();
//template <class T> std::string to_string (T t);
};
#endif
Unstable Version/1.3.2/IrrLibBase.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Copyright (C) 2008
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <irrlicht.h>
#include "IrrLibBase.h"
#include <strings.h>
#include <sstream>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
/*
* Code from http://articles.techrepublic.com.com/5100-22-5079969.html#
*
struct str_stream
{
std::stringstream & underlying_stream() const
{ return m_streamOut; }
operator std::string() const
{
return m_streamOut.str();
}
private:
mutable std::stringstream m_streamOut;
};
template< class type>
inline const str_stream & operator<< ( const str_stream & out, const type & value)
{
out.underlying_stream() << value;
return out;
}
template<class type> std::string to_string( const type & value)
{
std::ostringstream streamOut;
streamOut << value;
return streamOut.str();
}
* End code copy
*/
void IrrLibBase::SetDriver(IVideoDriver* driver) //can be overloaded
{
this->driver = driver;
}
void IrrLibBase::SetSmgr(ISceneManager* smgr)
{
this->smgr = smgr;
}
std::string IrrLibBase::wchar_to_stdstring (const wchar_t* wc)
{
//cout << "Starting conversion";
//wcstombs(tmp, in, 255);
char c[255];
for(int t = 0; wc[t] != '\0'; t++)
c[t] = (char)wc[t];
/*for(int t = 0; c[t] != '\0'; t++)
wc[t] = c[t];*/
std::stringstream ss;
ss << c;
//cout << "Conversion OK";
return ss.str();
}
std::string IrrLibBase::int_to_string (int t)
{
std::stringstream ss;
ss << t;
return ss.str();
}
std::string IrrLibBase::stringw_to_stdstring(irr::core::stringw sw)
{
std::stringstream ss;
ss << sw.c_str();
return ss.str();
}
irr::core::stringw IrrLibBase::stdstring_to_stringw(std::string ss)
{
stringw tmpw(ss.c_str());
return tmpw;
}
/*void IrrLibBase::SetDevice(irr::IrrlichtDevice *device)
{
this->device = device;
}*/
void IrrLibBase::init()
{
}
/*irr::core::stringw int_to_stringw(int t)
{
std::stringstream ss;
ss << t;
//stringw ret(ss.str());
return ret;
}*/
Unstable Version/1.3.2/IrrLibBase.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Copyright (C) 2008
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRLIBBASE_H
#define IRRLIBBASE_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
class IrrLibBase {
protected:
irr::video::IVideoDriver* driver;
irr::scene::ISceneManager* smgr;
irr::IrrlichtDevice *device;
public:
//template<class type> std::string to_string( const type & value);
irr::core::dimension2d<irr::s32> irrpixels;
void IrrLibBase::SetDriver(irr::video::IVideoDriver* driver);
void IrrLibBase::SetSmgr(irr::scene::ISceneManager* smgr);
void SetDevice(irr::IrrlichtDevice *device);
std::string int_to_string (int t);
std::string stringw_to_stdstring(irr::core::stringw sw);
irr::core::stringw stdstring_to_stringw(std::string ss);
std::string wchar_to_stdstring (const wchar_t* wc);
//irr::core::stringw int_to_stringw(int t);
void init();
};
#endif
Unstable Version/1.3.2/IrrLibGUI.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Copyright (C) 2008
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <strings.h>
#include <irrlicht.h>
#include <vector>
#include <sstream>
#include "IrrLib.h"
#include "IrrData.h"
#include "IrrLibGUI.h"
#include "IrrLibBase.h"
#include <stdlib.h>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
template<class type> std::string to_string( const type & value)
{
std::ostringstream streamOut;
streamOut << value;
return streamOut.str();
}
IrrLibGUI::IrrLibGUI()
{
//NA does it need to do anything at init?
this->nStaticText = 0;
this->nButton = 0;
this->nButtonid = 100;
this->nListBoxid = 200;
this->nListBox = 0;
//this->nListBoxid = 300;
//this->arrStaticText = new IGUIStaticText[10];
//this->env = this->device->getGUIEnvironment(); //NA yes we do!
}
IrrLibGUI::~IrrLibGUI()
{
//NA Do we have to delete anything?
}
void IrrLibGUI::SetEnv(IGUIEnvironment* env)
{
this->env = env;
//env->addButton(rect<s32>(10,210,110,210 + 32), 0, 109, L"Quit", L"Exits Program");
}
IrrObj IrrLibGUI::addButton(const core::rect< s32 > & rectangle, IGUIElement *parent, s32 id, const wchar_t * text, const wchar_t * tooltiptext)
{
arrButton.push_back(this->env->addButton(rectangle, parent, id, text, tooltiptext));
++nButton;
++nButtonid;
IrrObj ret;
ret.objectid = --nButtonid;
return ret;
}
IrrObj IrrLibGUI::addListBox(const irr::core::rect< irr::s32 > &rectangle, IGUIElement * parent)
{
irr::gui::IGUIListBox* tmp = this->env->addListBox(rectangle, parent, nListBoxid);
arrListBox.push_back(tmp);
//we introduce a new datatype; IrroObj
IrrObj ret;
ret.eventid = nListBoxid;
ret.objectid = nListBox;
++nListBox;
++nListBoxid;
return ret;
}
IrrObj IrrLibGUI::AddListBox(int x1, int y1, int x2, int y2, IGUIElement * parent)
{
return addListBox(rect<s32>(x1, y1, x2, y2), parent);
}
IrrObj IrrLibGUI::AddListBox(const irr::core::rect< irr::s32 > &rectangle, IGUIElement * parent)
{
return addListBox(rectangle, parent);
}
void IrrLibGUI::AddStringToListBox(IrrObj nLbox, stringw text)
{
this->arrListBox[nLbox.objectid]->addItem(text.c_str());
//this->arrListBox[0]->addItem(L"TEST");
}
std::string IrrLibGUI::getSelectListString(IrrObj lstbox)
{
//stringc tmp = this->arrListBox[lstbox]->getListItem(this->arrListBox[lstbox]->getSelected());
//s32 selected = this->arrListBox[lstbox.objectid]->getSelected();
//const wchar_t* tmp = this->arrListBox[lstbox]->getListItem(selected);
//irr::core::stringw tmp;
//char out[255];
//tmp = this->arrListBox[lstbox]->getText();
irr::core::stringc tmp(arrListBox[lstbox.objectid]->getListItem(arrListBox[lstbox.objectid]->getSelected()));
//cout << tmp.c_str() << endl;
//wcstombs(out, tmp, tmp.length());
//cout << tmp[0] << endl;
// std::stringstream ss;
//for (int i = 0; i < tmp.size(); ++i)
//ss << tmp.c_str();
std::string ret = tmp.c_str();
return ret;
}
void IrrLibGUI::Clear()
{
this->env->clear();
}
void IrrLibGUI::DrawAll()
{
this->env->drawAll();
}
IrrObj IrrLibGUI::AddToStaticArray(irr::gui::IGUIStaticText * addme)
{
//arrStaticText[nStaticText] = addme;
arrStaticText.push_back(addme);
this->nStaticText++;
this->nButtonid++;
IrrObj ret;
ret.objectid = this->nStaticText;
return ret;
}
void IrrLibGUI::AddStaticText()
{
//rect<s32>(20,30,300,80),
this->env->addStaticText(L"Powered by IrrLib.", rect<s32>(20,30,300,80), true);
}
IrrObj IrrLibGUI::AddStaticText(stringw message)
{
irr::gui::IGUIStaticText * addthis;
addthis = this->env->addStaticText(message.c_str(), rect<s32>(20,30,300,80), true);
return AddToStaticArray(addthis);
}
IrrObj IrrLibGUI::AddStaticText(stringw message, int x1, int y1, int x2, int y2)
{
irr::gui::IGUIStaticText * addthis;
addthis = this->env->addStaticText(message.c_str(), rect<s32>(x1,y1,x2,y2), true);
return AddToStaticArray(addthis);
}
IrrObj IrrLibGUI::AddStaticText(stringw message, int x1, int y1, int x2, int y2, bool border, bool wordwrap)
{
irr::gui::IGUIStaticText * addthis;
addthis = this->env->addStaticText(message.c_str(), rect<s32>(x1,y1,x2,y2), border, wordwrap);
return AddToStaticArray(addthis);
}
IrrObj IrrLibGUI::AddStaticText(stringw message, int x1, int y1, int x2, int y2, bool border, bool wordwrap, int id, bool fillbackground)
{
irr::gui::IGUIStaticText * addthis;
addthis = this->env->addStaticText(message.c_str(), rect<s32>(x1,y1,x2,y2), border, wordwrap, 0, id, fillbackground);
return AddToStaticArray(addthis);
}
IrrObj IrrLibGUI::AddStaticText(stringw message, const core::rect< s32 > &rectangle)
{
irr::gui::IGUIStaticText * addthis;
addthis = this->env->addStaticText(message.c_str(), rectangle);
return AddToStaticArray(addthis);
}
IrrObj IrrLibGUI::AddStaticText(stringw message, const core::rect< s32 > &rectangle, bool border, bool wordwrap)
{
irr::gui::IGUIStaticText * addthis;
addthis = this->env->addStaticText(message.c_str(), rectangle, border, wordwrap);
return AddToStaticArray(addthis);
}
IrrObj IrrLibGUI::AddStaticText(stringw message, const core::rect< s32 > &rectangle, bool border, bool wordwrap, int id, bool fillbackground)
{
irr::gui::IGUIStaticText * addthis;
addthis = this->env->addStaticText(message.c_str(), rectangle, border, wordwrap, 0, id, fillbackground);
return AddToStaticArray(addthis);
}
void IrrLibGUI::ChangeStaticText(IrrObj nstatictext, stringw message)
{
//this->arrStaticText[this->nStaticText.objectid-1]->setText(message.c_str());
this->arrStaticText[nstatictext.objectid]->setText(message.c_str());
}
void IrrLibGUI::ChangeFont(stringc fontfile)
{
IGUISkin* skin = this->env->getSkin();
IGUIFont* font = this->env->getFont(fontfile.c_str());
if (font)
skin->setFont(font);
}
IrrObj IrrLibGUI::AddButton(stringw text, int x1, int y1, int x2, int y2, stringw tooltiptext = "")
{
return addButton(rect<s32>(x1, y1, x2, y2), 0, nButtonid, text.c_str(), tooltiptext.c_str());
}
IrrObj IrrLibGUI::AddButton(stringw text, core::rect<s32> & rect, stringw tooltiptext = "")
{
return addButton(rect, 0, nButtonid, text.c_str(), tooltiptext.c_str());
}
Unstable Version/1.3.2/IrrLibGUI.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Copyright (C) 2008
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRLIBGUI_H
#define IRRLIBGUI_H
#include <iostream>
#include <strings.h>
#include <irrlicht.h>
#include "IrrLib.h"
#include "IrrData.h"
#include "IrrLibBase.h"
class IrrLibGUI: public IrrLibBase {
private:
irr::gui::IGUISkin* skin;
irr::gui::IGUIFont* font;
irr::gui::IGUIEnvironment* env;
//TODO: Create an array storing all messages
int nStaticText;
//irr::gui::IGUIStaticText* arrStaticText[10];
int nButton;
int nButtonid;
int nListBox;
int nListBoxid;
std::vector<irr::gui::IGUIStaticText*> arrStaticText;
std::vector<irr::gui::IGUIButton*> arrButton;
std::vector<irr::gui::IGUIListBox*> arrListBox;
IrrObj AddToStaticArray(irr::gui::IGUIStaticText * addme);
IrrObj addButton(const irr::core::rect< irr::s32 > & rectangle, irr::gui::IGUIElement *parent = 0, irr::s32 id = 0, const wchar_t * text = 0, const wchar_t * tooltiptext = 0); //TODO: Clean this up!
IrrObj addListBox(const irr::core::rect< irr::s32 > &rectangle, irr::gui::IGUIElement * parent);
public:
IrrLibGUI();
~IrrLibGUI();
void SetEnv(irr::gui::IGUIEnvironment* env);
void Clear();
void DrawAll();
//irr::gui::IGUIStaticText* IrrLibGUI::AddStaticText(); //NA eh a default text adder why not?
/* This is bad coding, we do not want to return an irrlicht object, we want to return a standard datatype because this class handles the GUI elements, not the user. */
void AddStaticText(); //NA eh a default text adder why not?
IrrObj AddStaticText(irr::core::stringw message);
IrrObj AddStaticText(irr::core::stringw message, int x1, int y1, int x2, int y2);
IrrObj AddStaticText(irr::core::stringw message, int x1, int y1, int x2, int y2, bool border, bool wordwrap);
IrrObj AddStaticText(irr::core::stringw message, int x1, int y1, int x2, int y2, bool border, bool wordwrap, int id, bool fillbackground);
IrrObj AddStaticText(irr::core::stringw message, const irr::core::rect< irr::s32 > &rectangle);
IrrObj AddStaticText(irr::core::stringw message, const irr::core::rect< irr::s32 > &rectangle, bool border, bool wordwrap);
IrrObj AddStaticText(irr::core::stringw message, const irr::core::rect< irr::s32 > &rectangle, bool border, bool wordwrap, int id, bool fillbackground);
IrrObj AddButton(irr::core::stringw text, int x1, int y1, int x2, int y2, irr::core::stringw tooltiptext);
IrrObj AddButton(irr::core::stringw text, irr::core::rect<irr::s32> & rect, irr::core::stringw tooltiptext); //TODO: Add move functions
IrrObj AddListBox(int x1, int y1, int x2, int y2, irr::gui::IGUIElement * parent = 0);
IrrObj AddListBox(const irr::core::rect< irr::s32 > &rectangle, irr::gui::IGUIElement * parent = 0);
void AddStringToListBox(IrrObj nLbox, irr::core::stringw text);
void ChangeStaticText(IrrObj nstatictext, irr::core::stringw message);
void ChangeFont(irr::core::stringc fontfile);
std::string getSelectListString(IrrObj lstbox);
//irr::core::stringw getSelectListString(int lstbox);
};
#endif
Unstable Version/1.3.2/IrrPhysics.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Copyright (C) 2008
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
#include <vector>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
//#include "IrrLib.h"
#include "IrrData.h"
#include <newton.h>
#include "IrrPhysics.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
NewtonWorld * IrrPhysics::nworld;
IrrPhysics::IrrPhysics()
{
this->nworld = NewtonCreate(NULL,NULL);
NewtonSetSolverModel(this->nworld, 1);
}
IrrPhysics::~IrrPhysics()
{
NewtonDestroy(this->nworld);
}
Unstable Version/1.3.2/IrrPhysics.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Copyright (C) 2008
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRPHYSICS_H
#define IRRPHYSICS_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
#include <vector>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
#include <newton.h>
//#include "IrrLib.h"
#include "IrrData.h"
#include "IrrLibBase.h"
class IrrPhysics: public IrrLibBase {
//private:
public:
static NewtonWorld *nworld;
IrrPhysics::IrrPhysics();
IrrPhysics::~IrrPhysics();
};
#endif
Unstable Version/1.3.2/IrrSphere.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Copyright (C) 2008
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include "IrrLib.h"
#include "IrrSphere.h"
#include <irrlicht.h>
#include <strings.h>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
/*void IrrSphere::SetSmgr(irr::scene::ISceneManager* smgr){
this->smgr = smgr;
}
void IrrSphere::SetDriver(irr::video::IVideoDriver* driver){
this->driver = driver;
}*/
IrrObj IrrSphere::CreateNewSphereNode(int x, int y, int z, stringc texture, bool light){
//this->nodeNew[this->numNodes] = this->smgr->addSphereSceneNode();
//this->sphereNodes[this->numNodes]->setPosition(core::vector3df(x,y,z));
//this->sphereNodes[this->numNodes]->setMaterialTexture(0, this->driver->getTexture(texture.c_str()));
//this->sphereNodes[this->numNodes]->setMaterialFlag(video::EMF_LIGHTING, light);
IrrObj ret;
nodeNew = this->smgr->addSphereSceneNode();
nodeNew->setPosition(core::vector3df(x,y,z));
nodeNew->setMaterialTexture(0, this->driver->getTexture(texture.c_str()));
nodeNew->setMaterialFlag(video::EMF_LIGHTING, light);
sphereNodes.push_back(nodeNew);
this->numNodes++;
ret.objectid = this->numNodes--;
return ret;
/*this->node = this->smgr->addSphereSceneNode();
this->node->setPosition(core::vector3df(x,y,z));
this->node->setMaterialTexture(0, this->driver->getTexture(texture.c_str()));
this->node->setMaterialFlag(video::EMF_LIGHTING, light);*/
}
irr::core::vector3df IrrSphere::GetSphereVector(int sphere){
//We are converting to vectors, under construction NA
//return this->nodeNew[sphere]->getPosition();
return this->sphereNodes[sphere]->getPosition();
}
void IrrSphere::SetSphereVector(int sphere, irr::core::vector3df v){
this->sphereNodes[sphere]->setPosition(v);
}
IrrSphere::IrrSphere(){
this->numNodes = 0;
}
IrrSphere::~IrrSphere(){
/*for(int i = 0; i < numNodes; ++i)
delete this->nodeNew[i];
delete this->nodeNew;*/
//We are using vectors now, no more memory clowing business NA
}
Unstable Version/1.3.2/IrrSphere.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Copyright (C) 2008
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRSPHERE_H
#define IRRSPHERE_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
#include <vector>
/* We have to include Irrlichts libs */
#include "IrrLibBase.h"
#include "IrrData.h"
#include <irrlicht.h>
//#include "IrrLib.h"
class IrrSphere: public IrrLibBase
{
private:
//irr::scene::ISceneNode* nodeNew[10];
irr::scene::ISceneNode* nodeNew;
std::vector<irr::scene::ISceneNode*> sphereNodes;
int numNodes;
//irr::scene::ISceneManager* smgr;
//irr::video::IVideoDriver* driver;
public:
//void IrrSphere::SetDriver(irr::video::IVideoDriver* driver);
//void IrrSphere::SetSmgr(irr::scene::ISceneManager* smgr);
IrrObj IrrSphere::CreateNewSphereNode(int x, int y, int z, irr::core::stringc texture, bool light); //this is going to take my advanced C++ skillz!
irr::core::vector3df IrrSphere::GetSphereVector(int sphere);
void IrrSphere::SetSphereVector(int sphere, irr::core::vector3df v);
IrrSphere::IrrSphere();
//IrrSphere::IrrSphere(IrrLib*);
IrrSphere::~IrrSphere();
};
#endif
Unstable Version/1.3.2/IrrSprite.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Copyright (C) 2008
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <irrlicht.h>
#include <strings.h>
#include "IrrLib.h"
//Libraries we create go here
//#include "IrrSphere.h"
#include "IrrColor.h"
#include "IrrSprite.h"
//#include "Irr2D.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
IrrSprite::IrrSprite()
{
//do stuff
}
IrrSprite::~IrrSprite()
{
//delete stuff
}
/*void IrrSprite::SetDriver(irr::video::IVideoDriver* driver)
{
this->driver = driver;
}
void IrrSprite::SetSmgr(irr::scene::ISceneManager* smgr)
{
this->smgr = smgr;
}*/
Unstable Version/1.3.2/IrrSprite.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Copyright (C) 2008
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRSPRITE_H
#define IRRSPRITE_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
//#include "IrrSphere.h"
#include "IrrLibBase.h"
#include "IrrColor.h"
//#include "Irr2D.h"
//#include "IrrSprite.h"
//Start class
class IrrSprite: public IrrLibBase {
private:
//irr::video::IVideoDriver* driver;
//irr::scene::ISceneManager* smgr;
public:
IrrSprite::IrrSprite();
IrrSprite::~IrrSprite();
/*void IrrSprite::SetDriver(irr::video::IVideoDriver* driver);
void IrrSprite::SetSmgr(irr::scene::ISceneManager* smgr);*/
// I forgot a semicolon here....and it wasn't compling
//Thats 1 bad thing about OOP if there is an error you don't know where the @#$@# the problem is!
};
#endif
Unstable Version/1.3.2/Newton.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
//********************************************************************
// Newton Game dynamics
// copyright 2000-2004
// By Julio Jerez
// VC: 6.0
// One and only header file.
//********************************************************************
#ifndef NEWTON_H__736495_6495_076__INCLUDED_
#define NEWTON_H__736495_6495_076__INCLUDED_
// force all not visual studio platform to be in library form
#ifndef _MSC_VER
#ifndef _NEWTON_USE_LIB
#define _NEWTON_USE_LIB
#endif
#endif
#ifdef _NEWTON_USE_LIB
#define NEWTON_API
#else
#ifdef _NEWTON_BUILD_DLL
#define NEWTON_API __declspec(dllexport)
#else
#define NEWTON_API __declspec(dllimport)
#endif
#endif
//#define __USE_DOUBLE_PRECISION__
#ifdef __USE_DOUBLE_PRECISION__
typedef double dFloat;
#else
typedef float dFloat;
#endif
#ifdef __cplusplus
extern "C" {
#endif
typedef struct NewtonBody{} NewtonBody;
typedef struct NewtonWorld{} NewtonWorld;
typedef struct NewtonJoint{} NewtonJoint;
typedef struct NewtonContact{} NewtonContact;
typedef struct NewtonMaterial{} NewtonMaterial;
typedef struct NewtonCollision{} NewtonCollision;
typedef struct NewtonRagDoll{} NewtonRagDoll;
typedef struct NewtonRagDollBone{} NewtonRagDollBone;
typedef struct NewtonUserMeshCollisionCollideDescTag
{
dFloat m_boxP0[4];// lower bounding box of intersection query in local space
dFloat m_boxP1[4];// upper bounding box of intersection query in local space
void* m_userData; // user data passed to the collision geometry at creation time
int m_faceCount; // the application should set here how many polygons intersect the query box
dFloat* m_vertex; // the application should the pointer to the vertex array.
int m_vertexStrideInBytes; // the application should set here the size of each vertex
int* m_userAttribute; // the application should set here the pointer to the user data, one for each face
int* m_faceIndexCount; // the application should set here the pointer to the vertex count of each face.
int* m_faceVertexIndex; // the application should set here the pointer index array for each vertex on a face.
NewtonBody* m_objBody; // pointer to the colliding body
NewtonBody* m_polySoupBody; // pointer to the rigid body owner of this collision tree
} NewtonUserMeshCollisionCollideDesc;
typedef struct NewtonUserMeshCollisionRayHitDescTag
{
dFloat m_p0[4];// ray origin in collision local space
dFloat m_p1[4]; // ray destination in collision local space
dFloat m_normalOut[4];// copy here the normal at the rat intersection
int m_userIdOut; // copy here a user defined id for further feedback
void* m_userData; // user data passed to the collision geometry at creation time
} NewtonUserMeshCollisionRayHitDesc;
typedef struct NewtonHingeSliderUpdateDescTag
{
dFloat m_accel;
dFloat m_minFriction;
dFloat m_maxFriction;
dFloat m_timestep;
} NewtonHingeSliderUpdateDesc;
// Newton callback functions
typedef void* (*NewtonAllocMemory) (int sizeInBytes);
typedef void (*NewtonFreeMemory) (void *ptr, int sizeInBytes);
typedef void (*NewtonSerialize) (void* serializeHandle, const void* buffer, size_t size);
typedef void (*NewtonDeserialize) (void* serializeHandle, void* buffer, size_t size);
typedef void (*NewtonUserMeshCollisionCollideCallback) (NewtonUserMeshCollisionCollideDesc* collideDescData);
typedef dFloat (*NewtonUserMeshCollisionRayHitCallback) (NewtonUserMeshCollisionRayHitDesc* lineDescData);
typedef void (*NewtonUserMeshCollisionDestroyCallback) (void* descData);
typedef void (*NewtonTreeCollisionCallback) (const NewtonBody* bodyWithTreeCollision, const NewtonBody* body,
const dFloat* vertex, int vertexstrideInBytes,
int indexCount, const int* indexArray);
typedef void (*NewtonBodyDestructor) (const NewtonBody* body);
typedef void (*NewtonApplyForceAndTorque) (const NewtonBody* body);
typedef void (*NewtonBodyActivationState) (const NewtonBody* body, unsigned state);
typedef void (*NewtonSetTransform) (const NewtonBody* body, const dFloat* matrix);
typedef void (*NewtonSetRagDollTransform) (const NewtonRagDollBone* bone);
typedef int (*NewtonGetBuoyancyPlane) (const int collisionID, void *context, const dFloat* globalSpaceMatrix, dFloat* globalSpacePlane);
typedef void (*NewtonVehicleTireUpdate) (const NewtonJoint* vehicle);
typedef unsigned (*NewtonWorldRayPrefilterCallback)(const NewtonBody* body, const NewtonCollision* collision, void* userData);
typedef dFloat (*NewtonWorldRayFilterCallback)(const NewtonBody* body, const dFloat* hitNormal, int collisionID, void* userData, dFloat intersetParam);
typedef void (*NewtonBodyLeaveWorld) (const NewtonBody* body);
typedef int (*NewtonContactBegin) (const NewtonMaterial* material, const NewtonBody* body0, const NewtonBody* body1);
typedef int (*NewtonContactProcess) (const NewtonMaterial* material, const NewtonContact* contact);
typedef void (*NewtonContactEnd) (const NewtonMaterial* material);
typedef void (*NewtonBodyIterator) (const NewtonBody* body);
typedef void (*NewtonCollisionIterator) (const NewtonBody* body, int vertexCount, const dFloat* FaceArray, int faceId);
typedef void (*NewtonBallCallBack) (const NewtonJoint* ball);
typedef unsigned (*NewtonHingeCallBack) (const NewtonJoint* hinge, NewtonHingeSliderUpdateDesc* desc);
typedef unsigned (*NewtonSliderCallBack) (const NewtonJoint* slider, NewtonHingeSliderUpdateDesc* desc);
typedef unsigned (*NewtonUniversalCallBack) (const NewtonJoint* universal, NewtonHingeSliderUpdateDesc* desc);
typedef unsigned (*NewtonCorkscrewCallBack) (const NewtonJoint* corkscrew, NewtonHingeSliderUpdateDesc* desc);
typedef void (*NewtonUserBilateralCallBack) (const NewtonJoint* userJoint);
typedef void (*NewtonConstraintDestructor) (const NewtonJoint* me);
// **********************************************************************************************
//
// world control functions
//
// **********************************************************************************************
NEWTON_API NewtonWorld* NewtonCreate (NewtonAllocMemory malloc, NewtonFreeMemory mfree);
NEWTON_API void NewtonDestroy (const NewtonWorld* newtonWorld);
NEWTON_API void NewtonDestroyAllBodies (const NewtonWorld* newtonWorld);
NEWTON_API void NewtonUpdate (const NewtonWorld* newtonWorld, dFloat timestep);
NEWTON_API void NewtonSetPlatformArchitecture (const NewtonWorld* newtonWorld, int mode);
NEWTON_API void NewtonSetSolverModel (const NewtonWorld* newtonWorld, int model);
NEWTON_API void NewtonSetFrictionModel (const NewtonWorld* newtonWorld, int model);
NEWTON_API dFloat NewtonGetTimeStep (const NewtonWorld* newtonWorld);
NEWTON_API void NewtonSetMinimumFrameRate (const NewtonWorld* newtonWorld, dFloat frameRate);
NEWTON_API void NewtonSetBodyLeaveWorldEvent (const NewtonWorld* newtonWorld, NewtonBodyLeaveWorld callback);
NEWTON_API void NewtonSetWorldSize (const NewtonWorld* newtonWorld, const dFloat* minPoint, const dFloat* maxPoint);
NEWTON_API void NewtonWorldFreezeBody (const NewtonWorld* newtonWorld, const NewtonBody* body);
NEWTON_API void NewtonWorldUnfreezeBody (const NewtonWorld* newtonWorld, const NewtonBody* body);
NEWTON_API void NewtonWorldForEachBodyDo (const NewtonWorld* newtonWorld, NewtonBodyIterator callback);
NEWTON_API void NewtonWorldForEachBodyInAABBDo (const NewtonWorld* newtonWorld, const dFloat* p0, const dFloat* p1, NewtonBodyIterator callback);
NEWTON_API void NewtonWorldSetUserData (const NewtonWorld* newtonWorld, void* userData);
NEWTON_API void* NewtonWorldGetUserData (const NewtonWorld* newtonWorld);
NEWTON_API int NewtonWorldGetVersion (const NewtonWorld* newtonWorld);
NEWTON_API void NewtonWorldRayCast (const NewtonWorld* newtonWorld, const dFloat* p0, const dFloat* p1, NewtonWorldRayFilterCallback filter, void* userData, NewtonWorldRayPrefilterCallback prefilter);
// world utility functions
// NEWTON_API int NewtonGetBodiesCount();
// NEWTON_API int NewtonGetActiveBodiesCount();
// NEWTON_API int NewtonGetActiveConstraintsCount();
// NEWTON_API dFloat NewtonGetGlobalScale (const NewtonWorld* newtonWorld);
// **********************************************************************************************
//
// Physics Material Section
//
// **********************************************************************************************
NEWTON_API int NewtonMaterialGetDefaultGroupID(const NewtonWorld* newtonWorld);
NEWTON_API int NewtonMaterialCreateGroupID(const NewtonWorld* newtonWorld);
NEWTON_API void NewtonMaterialDestroyAllGroupID(const NewtonWorld* newtonWorld);
NEWTON_API void NewtonMaterialSetDefaultSoftness (const NewtonWorld* newtonWorld, int id0, int id1, dFloat value);
NEWTON_API void NewtonMaterialSetDefaultElasticity (const NewtonWorld* newtonWorld, int id0, int id1, dFloat elasticCoef);
NEWTON_API void NewtonMaterialSetDefaultCollidable (const NewtonWorld* newtonWorld, int id0, int id1, int state);
NEWTON_API void NewtonMaterialSetContinuousCollisionMode (const NewtonWorld* newtonWorld, int id0, int id1, int state);
NEWTON_API void NewtonMaterialSetDefaultFriction (const NewtonWorld* newtonWorld, int id0, int id1,
dFloat staticFriction, dFloat kineticFriction);
NEWTON_API void NewtonMaterialSetCollisionCallback (const NewtonWorld* newtonWorld, int id0, int id1, void* userData,
NewtonContactBegin begin, NewtonContactProcess process, NewtonContactEnd end);
NEWTON_API void* NewtonMaterialGetUserData (const NewtonWorld* newtonWorld, int id0, int id1);
// **********************************************************************************************
//
// Physics Contact control functions
//
// **********************************************************************************************
NEWTON_API void NewtonMaterialDisableContact (const NewtonMaterial* material);
NEWTON_API dFloat NewtonMaterialGetCurrentTimestep (const NewtonMaterial* material);
NEWTON_API void *NewtonMaterialGetMaterialPairUserData (const NewtonMaterial* material);
NEWTON_API unsigned NewtonMaterialGetContactFaceAttribute (const NewtonMaterial* material);
NEWTON_API unsigned NewtonMaterialGetBodyCollisionID (const NewtonMaterial* material, const NewtonBody* body);
NEWTON_API dFloat NewtonMaterialGetContactNormalSpeed (const NewtonMaterial* material, const NewtonContact* contactlHandle);
NEWTON_API void NewtonMaterialGetContactForce (const NewtonMaterial* material, dFloat* force);
NEWTON_API void NewtonMaterialGetContactPositionAndNormal (const NewtonMaterial* material, dFloat* posit, dFloat* normal);
NEWTON_API void NewtonMaterialGetContactTangentDirections (const NewtonMaterial* material, dFloat* dir0, dFloat* dir);
NEWTON_API dFloat NewtonMaterialGetContactTangentSpeed (const NewtonMaterial* material, const NewtonContact* contactlHandle, int index);
NEWTON_API void NewtonMaterialSetContactSoftness (const NewtonMaterial* material, dFloat softness);
NEWTON_API void NewtonMaterialSetContactElasticity (const NewtonMaterial* material, dFloat restitution);
NEWTON_API void NewtonMaterialSetContactFrictionState (const NewtonMaterial* material, int state, int index);
NEWTON_API void NewtonMaterialSetContactStaticFrictionCoef (const NewtonMaterial* material, dFloat coef, int index);
NEWTON_API void NewtonMaterialSetContactKineticFrictionCoef (const NewtonMaterial* material, dFloat coef, int index);
NEWTON_API void NewtonMaterialSetContactNormalAcceleration (const NewtonMaterial* material, dFloat accel);
NEWTON_API void NewtonMaterialSetContactNormalDirection (const NewtonMaterial* material, const dFloat* directionVector);
NEWTON_API void NewtonMaterialSetContactTangentAcceleration (const NewtonMaterial* material, dFloat accel, int index);
NEWTON_API void NewtonMaterialContactRotateTangentDirections (const NewtonMaterial* material, const dFloat* directionVector);
// **********************************************************************************************
//
// convex collision primitives creation functions
//
// **********************************************************************************************
NEWTON_API NewtonCollision* NewtonCreateNull (const NewtonWorld* newtonWorld);
NEWTON_API NewtonCollision* NewtonCreateSphere (const NewtonWorld* newtonWorld, dFloat radiusX, dFloat radiusY, dFloat radiusZ, const dFloat *offsetMatrix);
NEWTON_API NewtonCollision* NewtonCreateBox (const NewtonWorld* newtonWorld, dFloat dx, dFloat dy, dFloat dz, const dFloat *offsetMatrix);
NEWTON_API NewtonCollision* NewtonCreateCone (const NewtonWorld* newtonWorld, dFloat radius, dFloat height, const dFloat *offsetMatrix);
NEWTON_API NewtonCollision* NewtonCreateCapsule (const NewtonWorld* newtonWorld, dFloat radius, dFloat height, const dFloat *offsetMatrix);
NEWTON_API NewtonCollision* NewtonCreateCylinder (const NewtonWorld* newtonWorld, dFloat radius, dFloat height, const dFloat *offsetMatrix);
NEWTON_API NewtonCollision* NewtonCreateChamferCylinder (const NewtonWorld* newtonWorld, dFloat radius, dFloat height, const dFloat *offsetMatrix);
NEWTON_API NewtonCollision* NewtonCreateConvexHull (const NewtonWorld* newtonWorld, int count, const dFloat* vertexCloud, int strideInBytes, const dFloat *offsetMatrix);
NEWTON_API NewtonCollision* NewtonCreateConvexHullModifier (const NewtonWorld* newtonWorld, const NewtonCollision* convexHullCollision);
NEWTON_API void NewtonConvexHullModifierGetMatrix (const NewtonCollision* convexHullCollision, dFloat* matrix);
NEWTON_API void NewtonConvexHullModifierSetMatrix (const NewtonCollision* convexHullCollision, const dFloat* matrix);
NEWTON_API void NewtonConvexCollisionSetUserID (const NewtonCollision* convexCollision, unsigned id);
NEWTON_API unsigned NewtonConvexCollisionGetUserID (const NewtonCollision* convexCollision);
NEWTON_API dFloat NewtonConvexCollisionCalculateVolume (const NewtonCollision* convexCollision);
NEWTON_API void NewtonConvexCollisionCalculateInertialMatrix (const NewtonCollision* convexCollision, dFloat* inertia, dFloat* origin);
NEWTON_API void NewtonCollisionMakeUnique (const NewtonWorld* newtonWorld, const NewtonCollision* collision);
NEWTON_API void NewtonReleaseCollision (const NewtonWorld* newtonWorld, const NewtonCollision* collision);
// **********************************************************************************************
//
// complex collision primitives creation functions
// note: can only be used with static bodies (bodies with infinite mass)
//
// **********************************************************************************************
NEWTON_API NewtonCollision* NewtonCreateCompoundCollision (const NewtonWorld* newtonWorld, int count,
NewtonCollision* const collisionPrimitiveArray[]);
NEWTON_API NewtonCollision* NewtonCreateUserMeshCollision (const NewtonWorld* newtonWorld, const dFloat *minBox,
const dFloat *maxBox, void *userData, NewtonUserMeshCollisionCollideCallback collideCallback,
NewtonUserMeshCollisionRayHitCallback rayHitCallback, NewtonUserMeshCollisionDestroyCallback destroyCallback);
// **********************************************************************************************
//
// CollisionTree Utility functions
//
// **********************************************************************************************
NEWTON_API NewtonCollision* NewtonCreateTreeCollision (const NewtonWorld* newtonWorld, NewtonTreeCollisionCallback userCallback);
NEWTON_API void NewtonTreeCollisionBeginBuild (const NewtonCollision* treeCollision);
NEWTON_API void NewtonTreeCollisionAddFace (const NewtonCollision* treeCollision, int vertexCount, const dFloat* vertexPtr,
int strideInBytes, int faceAttribute);
NEWTON_API void NewtonTreeCollisionEndBuild (const NewtonCollision* treeCollision, int optimize);
NEWTON_API void NewtonTreeCollisionSerialize (const NewtonCollision* treeCollision, NewtonSerialize serializeFunction,
void* serializeHandle);
NEWTON_API NewtonCollision* NewtonCreateTreeCollisionFromSerialization (const NewtonWorld* newtonWorld,
NewtonTreeCollisionCallback userCallback, NewtonDeserialize deserializeFunction, void* serializeHandle);
NEWTON_API int NewtonTreeCollisionGetFaceAtribute (const NewtonCollision* treeCollision, const int* faceIndexArray);
NEWTON_API void NewtonTreeCollisionSetFaceAtribute (const NewtonCollision* treeCollision, const int* faceIndexArray,
int attribute);
// **********************************************************************************************
//
// General purpose collision library functions
//
// **********************************************************************************************
NEWTON_API int NewtonCollisionPointDistance (const NewtonWorld* newtonWorld, const dFloat *point,
const NewtonCollision* collsion, const dFloat* matrix, dFloat* contact, dFloat* normal);
NEWTON_API int NewtonCollisionClosestPoint (const NewtonWorld* newtonWorld,
const NewtonCollision* collsionA, const dFloat* matrixA, const NewtonCollision* collsionB, const dFloat* matrixB,
dFloat* contactA, dFloat* contactB, dFloat* normalAB);
NEWTON_API int NewtonCollisionCollide (const NewtonWorld* newtonWorld, int maxSize,
const NewtonCollision* collsionA, const dFloat* matrixA, const NewtonCollision* collsionB, const dFloat* matrixB,
dFloat* contacts, dFloat* normals, dFloat* penetration);
NEWTON_API int NewtonCollisionCollideContinue (const NewtonWorld* newtonWorld, int maxSize, const dFloat timestap,
const NewtonCollision* collsionA, const dFloat* matrixA, const dFloat* velocA, const dFloat* omegaA,
const NewtonCollision* collsionB, const dFloat* matrixB, const dFloat* velocB, const dFloat* omegaB,
dFloat* timeOfImpact, dFloat* contacts, dFloat* normals, dFloat* penetration);
NEWTON_API dFloat NewtonCollisionRayCast (const NewtonCollision* collision, const dFloat* p0, const dFloat* p1, dFloat* normals, int* attribute);
NEWTON_API void NewtonCollisionCalculateAABB (const NewtonCollision* collision, const dFloat *matrix, dFloat* p0, dFloat* p1);
// **********************************************************************************************
//
// transforms utility functions
//
// **********************************************************************************************
NEWTON_API void NewtonGetEulerAngle (const dFloat* matrix, dFloat* eulersAngles);
NEWTON_API void NewtonSetEulerAngle (const dFloat* eulersAngles, dFloat* matrix);
// **********************************************************************************************
//
// body manipulation functions
//
// **********************************************************************************************
NEWTON_API NewtonBody* NewtonCreateBody (const NewtonWorld* newtonWorld, const NewtonCollision* collision);
NEWTON_API void NewtonDestroyBody(const NewtonWorld* newtonWorld, const NewtonBody* body);
NEWTON_API void NewtonBodyAddForce (const NewtonBody* body, const dFloat* force);
NEWTON_API void NewtonBodyAddTorque (const NewtonBody* body, const dFloat* torque);
NEWTON_API void NewtonBodySetMatrix (const NewtonBody* body, const dFloat* matrix);
NEWTON_API void NewtonBodySetMatrixRecursive (const NewtonBody* body, const dFloat* matrix);
NEWTON_API void NewtonBodySetMassMatrix (const NewtonBody* body, dFloat mass, dFloat Ixx, dFloat Iyy, dFloat Izz);
NEWTON_API void NewtonBodySetMaterialGroupID (const NewtonBody* body, int id);
NEWTON_API void NewtonBodySetContinuousCollisionMode (const NewtonBody* body, unsigned state);
NEWTON_API void NewtonBodySetJointRecursiveCollision (const NewtonBody* body, unsigned state);
NEWTON_API void NewtonBodySetOmega (const NewtonBody* body, const dFloat* omega);
NEWTON_API void NewtonBodySetVelocity (const NewtonBody* body, const dFloat* velocity);
NEWTON_API void NewtonBodySetForce (const NewtonBody* body, const dFloat* force);
NEWTON_API void NewtonBodySetTorque (const NewtonBody* body, const dFloat* torque);
NEWTON_API void NewtonBodySetCentreOfMass (const NewtonBody* body, const dFloat* com);
NEWTON_API void NewtonBodySetLinearDamping (const NewtonBody* body, dFloat linearDamp);
NEWTON_API void NewtonBodySetAngularDamping (const NewtonBody* body, const dFloat* angularDamp);
NEWTON_API void NewtonBodySetUserData (const NewtonBody* body, void* userData);
NEWTON_API void NewtonBodyCoriolisForcesMode (const NewtonBody* body, int mode);
NEWTON_API void NewtonBodySetCollision (const NewtonBody* body, const NewtonCollision* collision);
NEWTON_API void NewtonBodySetAutoFreeze (const NewtonBody* body, int state);
NEWTON_API void NewtonBodySetFreezeTreshold (const NewtonBody* body, dFloat freezeSpeed2, dFloat freezeOmega2, int framesCount);
NEWTON_API void NewtonBodySetTransformCallback (const NewtonBody* body, NewtonSetTransform callback);
NEWTON_API void NewtonBodySetDestructorCallback (const NewtonBody* body, NewtonBodyDestructor callback);
NEWTON_API void NewtonBodySetAutoactiveCallback (const NewtonBody* body, NewtonBodyActivationState callback);
NEWTON_API void NewtonBodySetForceAndTorqueCallback (const NewtonBody* body, NewtonApplyForceAndTorque callback);
NEWTON_API NewtonApplyForceAndTorque NewtonBodyGetForceAndTorqueCallback (const NewtonBody* body);
NEWTON_API void* NewtonBodyGetUserData (const NewtonBody* body);
NEWTON_API NewtonWorld* NewtonBodyGetWorld (const NewtonBody* body);
NEWTON_API NewtonCollision* NewtonBodyGetCollision (const NewtonBody* body);
NEWTON_API int NewtonBodyGetMaterialGroupID (const NewtonBody* body);
NEWTON_API int NewtonBodyGetContinuousCollisionMode (const NewtonBody* body);
NEWTON_API int NewtonBodyGetJointRecursiveCollision (const NewtonBody* body);
NEWTON_API void NewtonBodyGetMatrix(const NewtonBody* body, dFloat* matrix);
NEWTON_API void NewtonBodyGetMassMatrix (const NewtonBody* body, dFloat* mass, dFloat* Ixx, dFloat* Iyy, dFloat* Izz);
NEWTON_API void NewtonBodyGetInvMass(const NewtonBody* body, dFloat* invMass, dFloat* invIxx, dFloat* invIyy, dFloat* invIzz);
NEWTON_API void NewtonBodyGetOmega(const NewtonBody* body, dFloat* vector);
NEWTON_API void NewtonBodyGetVelocity(const NewtonBody* body, dFloat* vector);
NEWTON_API void NewtonBodyGetForce(const NewtonBody* body, dFloat* vector);
NEWTON_API void NewtonBodyGetTorque(const NewtonBody* body, dFloat* vector);
NEWTON_API void NewtonBodyGetCentreOfMass (const NewtonBody* body, dFloat* com);
NEWTON_API int NewtonBodyGetSleepingState(const NewtonBody* body);
NEWTON_API int NewtonBodyGetAutoFreeze(const NewtonBody* body);
NEWTON_API dFloat NewtonBodyGetLinearDamping (const NewtonBody* body);
NEWTON_API void NewtonBodyGetAngularDamping (const NewtonBody* body, dFloat* vector);
NEWTON_API void NewtonBodyGetAABB (const NewtonBody* body, dFloat* p0, dFloat* p1);
NEWTON_API void NewtonBodyGetFreezeTreshold (const NewtonBody* body, dFloat* freezeSpeed2, dFloat* freezeOmega2);
NEWTON_API void NewtonBodyAddBuoyancyForce (const NewtonBody* body, dFloat fluidDensity,
dFloat fluidLinearViscosity, dFloat fluidAngularViscosity,
const dFloat* gravityVector, NewtonGetBuoyancyPlane buoyancyPlane, void *context);
NEWTON_API void NewtonBodyForEachPolygonDo (const NewtonBody* body, NewtonCollisionIterator callback);
NEWTON_API void NewtonAddBodyImpulse (const NewtonBody* body, const dFloat* pointDeltaVeloc, const dFloat* pointPosit);
// **********************************************************************************************
//
// Common joint functions
//
// **********************************************************************************************
NEWTON_API void* NewtonJointGetUserData (const NewtonJoint* joint);
NEWTON_API void NewtonJointSetUserData (const NewtonJoint* joint, void* userData);
NEWTON_API int NewtonJointGetCollisionState (const NewtonJoint* joint);
NEWTON_API void NewtonJointSetCollisionState (const NewtonJoint* joint, int state);
NEWTON_API dFloat NewtonJointGetStiffness (const NewtonJoint* joint);
NEWTON_API void NewtonJointSetStiffness (const NewtonJoint* joint, dFloat state);
NEWTON_API void NewtonDestroyJoint(const NewtonWorld* newtonWorld, const NewtonJoint* joint);
NEWTON_API void NewtonJointSetDestructor (const NewtonJoint* joint, NewtonConstraintDestructor destructor);
// **********************************************************************************************
//
// Ball and Socket joint functions
//
// **********************************************************************************************
NEWTON_API NewtonJoint* NewtonConstraintCreateBall (const NewtonWorld* newtonWorld, const dFloat* pivotPoint,
const NewtonBody* childBody, const NewtonBody* parentBody);
NEWTON_API void NewtonBallSetUserCallback (const NewtonJoint* ball, NewtonBallCallBack callback);
NEWTON_API void NewtonBallGetJointAngle (const NewtonJoint* ball, dFloat* angle);
NEWTON_API void NewtonBallGetJointOmega (const NewtonJoint* ball, dFloat* omega);
NEWTON_API void NewtonBallGetJointForce (const NewtonJoint* ball, dFloat* force);
NEWTON_API void NewtonBallSetConeLimits (const NewtonJoint* ball, const dFloat* pin, dFloat maxConeAngle, dFloat maxTwistAngle);
// **********************************************************************************************
//
// Hinge joint functions
//
// **********************************************************************************************
NEWTON_API NewtonJoint* NewtonConstraintCreateHinge (const NewtonWorld* newtonWorld,
const dFloat* pivotPoint, const dFloat* pinDir,
const NewtonBody* childBody, const NewtonBody* parentBody);
NEWTON_API void NewtonHingeSetUserCallback (const NewtonJoint* hinge, NewtonHingeCallBack callback);
NEWTON_API dFloat NewtonHingeGetJointAngle (const NewtonJoint* hinge);
NEWTON_API dFloat NewtonHingeGetJointOmega (const NewtonJoint* hinge);
NEWTON_API void NewtonHingeGetJointForce (const NewtonJoint* hinge, dFloat* force);
NEWTON_API dFloat NewtonHingeCalculateStopAlpha (const NewtonJoint* hinge, const NewtonHingeSliderUpdateDesc* desc, dFloat angle);
// **********************************************************************************************
//
// Slider joint functions
//
// **********************************************************************************************
NEWTON_API NewtonJoint* NewtonConstraintCreateSlider (const NewtonWorld* newtonWorld,
const dFloat* pivotPoint, const dFloat* pinDir,
const NewtonBody* childBody, const NewtonBody* parentBody);
NEWTON_API void NewtonSliderSetUserCallback (const NewtonJoint* slider, NewtonSliderCallBack callback);
NEWTON_API dFloat NewtonSliderGetJointPosit (const NewtonJoint* slider);
NEWTON_API dFloat NewtonSliderGetJointVeloc (const NewtonJoint* slider);
NEWTON_API void NewtonSliderGetJointForce (const NewtonJoint* slider, dFloat* force);
NEWTON_API dFloat NewtonSliderCalculateStopAccel (const NewtonJoint* slider, const NewtonHingeSliderUpdateDesc* desc, dFloat position);
// **********************************************************************************************
//
// Corkscrew joint functions
//
// **********************************************************************************************
NEWTON_API NewtonJoint* NewtonConstraintCreateCorkscrew (const NewtonWorld* newtonWorld,
const dFloat* pivotPoint, const dFloat* pinDir,
const NewtonBody* childBody, const NewtonBody* parentBody);
NEWTON_API void NewtonCorkscrewSetUserCallback (const NewtonJoint* corkscrew, NewtonCorkscrewCallBack callback);
NEWTON_API dFloat NewtonCorkscrewGetJointPosit (const NewtonJoint* corkscrew);
NEWTON_API dFloat NewtonCorkscrewGetJointAngle (const NewtonJoint* corkscrew);
NEWTON_API dFloat NewtonCorkscrewGetJointVeloc (const NewtonJoint* corkscrew);
NEWTON_API dFloat NewtonCorkscrewGetJointOmega (const NewtonJoint* corkscrew);
NEWTON_API void NewtonCorkscrewGetJointForce (const NewtonJoint* corkscrew, dFloat* force);
NEWTON_API dFloat NewtonCorkscrewCalculateStopAlpha (const NewtonJoint* corkscrew, const NewtonHingeSliderUpdateDesc* desc, dFloat angle);
NEWTON_API dFloat NewtonCorkscrewCalculateStopAccel (const NewtonJoint* corkscrew, const NewtonHingeSliderUpdateDesc* desc, dFloat position);
// **********************************************************************************************
//
// Universal joint functions
//
// **********************************************************************************************
NEWTON_API NewtonJoint* NewtonConstraintCreateUniversal (const NewtonWorld* newtonWorld,
const dFloat* pivotPoint, const dFloat* pinDir0, const dFloat* pinDir1,
const NewtonBody* childBody, const NewtonBody* parentBody);
NEWTON_API void NewtonUniversalSetUserCallback (const NewtonJoint* universal, NewtonUniversalCallBack callback);
NEWTON_API dFloat NewtonUniversalGetJointAngle0 (const NewtonJoint* universal);
NEWTON_API dFloat NewtonUniversalGetJointAngle1 (const NewtonJoint* universal);
NEWTON_API dFloat NewtonUniversalGetJointOmega0 (const NewtonJoint* universal);
NEWTON_API dFloat NewtonUniversalGetJointOmega1 (const NewtonJoint* universal);
NEWTON_API void NewtonUniversalGetJointForce (const NewtonJoint* universal, dFloat* force);
NEWTON_API dFloat NewtonUniversalCalculateStopAlpha0 (const NewtonJoint* universal, const NewtonHingeSliderUpdateDesc* desc, dFloat angle);
NEWTON_API dFloat NewtonUniversalCalculateStopAlpha1 (const NewtonJoint* universal, const NewtonHingeSliderUpdateDesc* desc, dFloat angle);
// **********************************************************************************************
//
// Up vector joint functions
//
// **********************************************************************************************
NEWTON_API NewtonJoint* NewtonConstraintCreateUpVector (const NewtonWorld* newtonWorld, const dFloat* pinDir, const NewtonBody* body);
NEWTON_API void NewtonUpVectorGetPin (const NewtonJoint* upVector, dFloat *pin);
NEWTON_API void NewtonUpVectorSetPin (const NewtonJoint* upVector, const dFloat *pin);
// **********************************************************************************************
//
// User defined bilateral Joint
//
// **********************************************************************************************
NEWTON_API NewtonJoint* NewtonConstraintCreateUserJoint (const NewtonWorld* newtonWorld, int maxDOF, NewtonUserBilateralCallBack callback,
const NewtonBody* childBody, const NewtonBody* parentBody);
NEWTON_API void NewtonUserJointAddLinearRow (const NewtonJoint* joint, const dFloat *pivot0, const dFloat *pivot1, const dFloat *dir);
NEWTON_API void NewtonUserJointAddAngularRow (const NewtonJoint* joint, dFloat relativeAngle, const dFloat *dir);
NEWTON_API void NewtonUserJointAddGeneralRow (const NewtonJoint* joint, const dFloat *jacobian0, const dFloat *jacobian1);
NEWTON_API void NewtonUserJointSetRowMinimumFriction (const NewtonJoint* joint, dFloat friction);
NEWTON_API void NewtonUserJointSetRowMaximumFriction (const NewtonJoint* joint, dFloat friction);
NEWTON_API void NewtonUserJointSetRowAcceleration (const NewtonJoint* joint, dFloat acceleration);
NEWTON_API void NewtonUserJointSetRowSpringDamperAcceleration (const NewtonJoint* joint, dFloat springK, dFloat springD);
NEWTON_API void NewtonUserJointSetRowStiffness (const NewtonJoint* joint, dFloat stiffness);
NEWTON_API dFloat NewtonUserJointGetRowForce (const NewtonJoint* joint, int row);
// **********************************************************************************************
//
// Rag doll joint container functions
//
// **********************************************************************************************
NEWTON_API NewtonRagDoll* NewtonCreateRagDoll (const NewtonWorld* newtonWorld);
NEWTON_API void NewtonDestroyRagDoll (const NewtonWorld* newtonWorld, const NewtonRagDoll* ragDoll);
NEWTON_API void NewtonRagDollBegin (const NewtonRagDoll* ragDoll);
NEWTON_API void NewtonRagDollEnd (const NewtonRagDoll* ragDoll);
//NEWTON_API void NewtonRagDollSetFriction (const NewtonRagDoll* ragDoll, dFloat friction);
NEWTON_API NewtonRagDollBone* NewtonRagDollFindBone (const NewtonRagDoll* ragDoll, int id);
//NEWTON_API NewtonRagDollBone* NewtonRagDollGetRootBone (const NewtonRagDoll* ragDoll);
NEWTON_API void NewtonRagDollSetForceAndTorqueCallback (const NewtonRagDoll* ragDoll, NewtonApplyForceAndTorque callback);
NEWTON_API void NewtonRagDollSetTransformCallback (const NewtonRagDoll* ragDoll, NewtonSetRagDollTransform callback);
NEWTON_API NewtonRagDollBone* NewtonRagDollAddBone (const NewtonRagDoll* ragDoll, const NewtonRagDollBone* parent,
void *userData, dFloat mass, const dFloat* matrix,
const NewtonCollision* boneCollision, const dFloat* size);
NEWTON_API void* NewtonRagDollBoneGetUserData (const NewtonRagDollBone* bone);
NEWTON_API NewtonBody* NewtonRagDollBoneGetBody (const NewtonRagDollBone* bone);
NEWTON_API void NewtonRagDollBoneSetID (const NewtonRagDollBone* bone, int id);
NEWTON_API void NewtonRagDollBoneSetLimits (const NewtonRagDollBone* bone,
const dFloat* coneDir, dFloat minConeAngle, dFloat maxConeAngle, dFloat maxTwistAngle,
const dFloat* bilateralConeDir, dFloat negativeBilateralConeAngle, dFloat positiveBilateralConeAngle);
//NEWTON_API NewtonRagDollBone* NewtonRagDollBoneGetChild (const NewtonRagDollBone* bone);
//NEWTON_API NewtonRagDollBone* NewtonRagDollBoneGetSibling (const NewtonRagDollBone* bone);
//NEWTON_API NewtonRagDollBone* NewtonRagDollBoneGetParent (const NewtonRagDollBone* bone);
//NEWTON_API void NewtonRagDollBoneSetLocalMatrix (const NewtonRagDollBone* bone, dFloat* matrix);
//NEWTON_API void NewtonRagDollBoneSetGlobalMatrix (const NewtonRagDollBone* bone, dFloat* matrix);
NEWTON_API void NewtonRagDollBoneGetLocalMatrix (const NewtonRagDollBone* bone, dFloat* matrix);
NEWTON_API void NewtonRagDollBoneGetGlobalMatrix (const NewtonRagDollBone* bone, dFloat* matrix);
// **********************************************************************************************
//
// Vehicle joint functions
//
// **********************************************************************************************
NEWTON_API NewtonJoint* NewtonConstraintCreateVehicle (const NewtonWorld* newtonWorld, const dFloat* upDir, const NewtonBody* body);
NEWTON_API void NewtonVehicleReset (const NewtonJoint* vehicle);
NEWTON_API void NewtonVehicleSetTireCallback (const NewtonJoint* vehicle, NewtonVehicleTireUpdate update);
NEWTON_API void* NewtonVehicleAddTire (const NewtonJoint* vehicle, const dFloat* localMatrix, const dFloat* pin, dFloat mass, dFloat width, dFloat radius,
dFloat suspesionShock, dFloat suspesionSpring, dFloat suspesionLength, void* userData, int collisionID);
NEWTON_API void NewtonVehicleRemoveTire (const NewtonJoint* vehicle, void* tireId);
NEWTON_API void* NewtonVehicleGetFirstTireID (const NewtonJoint* vehicle);
NEWTON_API void* NewtonVehicleGetNextTireID (const NewtonJoint* vehicle, void* tireId);
NEWTON_API int NewtonVehicleTireIsAirBorne (const NewtonJoint* vehicle, void* tireId);
NEWTON_API int NewtonVehicleTireLostSideGrip (const NewtonJoint* vehicle, void* tireId);
NEWTON_API int NewtonVehicleTireLostTraction (const NewtonJoint* vehicle, void* tireId);
NEWTON_API void* NewtonVehicleGetTireUserData (const NewtonJoint* vehicle, void* tireId);
NEWTON_API dFloat NewtonVehicleGetTireOmega (const NewtonJoint* vehicle, void* tireId);
NEWTON_API dFloat NewtonVehicleGetTireNormalLoad (const NewtonJoint* vehicle, void* tireId);
NEWTON_API dFloat NewtonVehicleGetTireSteerAngle (const NewtonJoint* vehicle, void* tireId);
NEWTON_API dFloat NewtonVehicleGetTireLateralSpeed (const NewtonJoint* vehicle, void* tireId);
NEWTON_API dFloat NewtonVehicleGetTireLongitudinalSpeed (const NewtonJoint* vehicle, void* tireId);
NEWTON_API void NewtonVehicleGetTireMatrix (const NewtonJoint* vehicle, void* tireId, dFloat* matrix);
NEWTON_API void NewtonVehicleSetTireTorque (const NewtonJoint* vehicle, void* tireId, dFloat torque);
NEWTON_API void NewtonVehicleSetTireSteerAngle (const NewtonJoint* vehicle, void* tireId, dFloat angle);
NEWTON_API void NewtonVehicleSetTireMaxSideSleepSpeed (const NewtonJoint* vehicle, void* tireId, dFloat speed);
NEWTON_API void NewtonVehicleSetTireSideSleepCoeficient (const NewtonJoint* vehicle, void* tireId, dFloat coeficient);
NEWTON_API void NewtonVehicleSetTireMaxLongitudinalSlideSpeed (const NewtonJoint* vehicle, void* tireId, dFloat speed);
NEWTON_API void NewtonVehicleSetTireLongitudinalSlideCoeficient (const NewtonJoint* vehicle, void* tireId, dFloat coeficient);
NEWTON_API dFloat NewtonVehicleTireCalculateMaxBrakeAcceleration (const NewtonJoint* vehicle, void* tireId);
NEWTON_API void NewtonVehicleTireSetBrakeAcceleration (const NewtonJoint* vehicle, void* tireId, dFloat accelaration, dFloat torqueLimit);
#ifdef __cplusplus
}
#endif
#endif
Unstable Version/1.3.2/README
1
2
3
4
5
6
7
8
9
10
11
12
13
Irrlicht Library Wrapper
Created by Nathan Adams
Version 1.2.9
Copyright (C) 2008
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
Please leave all files intact if you redistrubte this software.
How to use:
Add all the files to your Irrlicht project, you could compile it into a DLL if you wanted too, but for now just add all the files to your project.
Then inside your complier add the directory that you have the IrrLib files and use #include "IrrLib.h" to refrence it, and you are good to go!
Unstable Version/1.3.3/CHANGES
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
Version 1.2
+ Added a Irr3DLib class that will control all 3D objects
+ Also Added a Irr2D class that works on the same concept.
+ IrrSphere is now owned by Irr3DLib
+ Updated the examples using the latest code
Version 1.2.2
+ Added IrrEventReciever to handle all input
- Still under work
+ Fixed some misc coding bugs
+ Added template class
+ Added sprite class
+ Added GUI class
Version 1.2.3
+ IrrEventReciver now works as advertised
+ Baseclass is now being used
+ A couple somewhat-useful functions
+ int_to_string
+ stringw_to_stdstring
+ stdstring_to_stringw
+ GUI elements
+ Static text is working
+ Under construction for a data type class
Version 1.2.4
+ Implmented color codes accessiable through the class
+ IrrLib.Color.RED (ect)
Version 1.2.5
+ Implmented mouse events
+ IrrLib.IrrEvent.getMouseX();
+ IrrLib.IrrEvent.getMouseY();
+ Using vectors instead of static arrays
+ Side note: Was going to use dynamic arrays, but C++ has vectors which are 10x better.
+ Added a default exit for when you hit esc
+ Use IrrLib.IrrEvent.SetEscExit(false) to turn that off for your software
+ Use IrrLib.IrrEvent.SetEscExit(true) to turn it back on
+ Every stable version will now include a windows DLL.
+ Possible Linux .so file in the future.
Version 1.2.6
+ Added a IrrEvent for buttons
+ IrrLib.IrrEvent.checkButtonState();
+ See example for use
+ Added an AddButton function
+ IrrLib.GUI.AddButton(..);
+ See example for use
+ Problems with making the DLL
+ reasearching
Version 1.2.7
+ Fixed DLL Problem
+ Added an enum example to example 1
+ Added more examples
+ Added example 9
+ Added left click handling (see example 9)
+ Added AddLines function to Irr2D
+ DrawLines function in Irr2D will draw the lines you add
Version 1.2.9
+ Added Listbox GUI object
+ Added a new datatype IrrObj
+ Contains 2 ints, 1 for object id and 1 for event id
+ Added a IrrData.h file
Version 1.3.0
+ Changed String class use to Irrlicht's type Strings
Version 1.3.1
+ Added support for newest Irrlict version
Version 1.3.2/1.3.3
+ Added Newton Physics engine
- Deleted Irr2D::Collision as this will be now handled by the physics engine
+ Added a few functions for Collision
+ Added a new object Irr3DObj
+ Has several functions that allow you to work easily with 3D objects including moving them and setting the texture.
+ You can now detect collision between 2 3D objects and output them to the screen
+ Example code: http://pastethis.net/?code=49
+ Changed the way IrrColor colors work
+ Changed internally handling of some global variables
+ Added some static variables
+ Irrlicht Device is now static in IrrLib class
+ Some variables that deal with Physics are static
+ Updated copyright
+ Added new datatypes
+ Irr3DLibObj
+ Irr3DObj
+ Irr2DObj
+ IrrGUIObj
+ IrrGUIStruct
+ IrrEventObj
+ Irr3DSphere
+ Irr3DObjColor
- Deleted IrrData.h
+ 3D mesh display is working, though its still in the works (see example 11 in the SVN)
+ Implmented smart pointer class "IrrObj"
+ Possible fix of header circular inclusion
% Future planned use of namespace
Unstable Version/1.3.3/CREDITS
1
2
3
4
5
6
7
8
9
10
IrrLib
Created by
Nathan Adams
From #irrlicht
Acid
wacom
From Irrlicht Forums
Denzel Morris
Unstable Version/1.3.3/Collision.h
1
2
3
4
5
6
7
#ifndef COLLISION.H
#define COLLISION.H
struct Collision {
int nHits;
bool hit;
};
#endif
Unstable Version/1.3.3/Copy of IrrFunctions.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
#include "IrrFunctions.h"
#include <newton.h>
#include <irrlicht.h>
#include <iostream>
#include "IrrDefines.h"
#include "IrrPhysics.h"
#include <dMatrix.h>
using namespace std;
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
int CheckForCollision(Irr2DObj& obj_A, Irr2DObj& obj_B)
{
const int nContacts = 4;
float contacts[3 * nContacts];
float normals[3 * nContacts];
float penetration[3 * nContacts ];
//dMatrix t1, t2;
const float NewtonToIrr = 32.0f;
const float IrrToNewton = (1.0f / NewtonToIrr);
matrix4 mat_A,mat_B;
mat_A.makeIdentity();
mat_B.makeIdentity();
mat_A.setTranslation(obj_A->getPosition());
mat_B.setTranslation(obj_B->getPosition());
core::aabbox3d<f32> box1(vector3d<f32>(obj_A->getLength(), obj_A->getHeight(), 0));
core::aabbox3d<f32> box2(vector3d<f32>(obj_B->getLength(), obj_B->getHeight(), 0));
NewtonCollision* obj1_col = NewtonCreateBox(IrrPhysics::nworld, (obj_A->getLength()), obj_A->getHeight(), 1, NULL);
NewtonCollision* obj2_col = NewtonCreateBox(IrrPhysics::nworld, (obj_B->getLength()), obj_B->getHeight(), 1, NULL);
//NewtonCollision* obj2_col = NewtonCreateBox(IrrPhysics::nworld, 2, 10, 1, NULL);
//NewtonBody* obj1 = NewtonCreateBody(IrrPhysics::nworld, obj1_col);
//NewtonBody* obj2 = NewtonCreateBody(IrrPhysics::nworld, obj2_col);
//NewtonBodyGetMatrix( obj1, &t1[0][0] );
//NewtonBodyGetMatrix( obj2, &t2[0][0] );
//Check for collision between collision meshes,
// returns number of contact points
int nHits = NewtonCollisionCollide( IrrPhysics::nworld,nContacts,
obj1_col, (float*)&mat_A,
obj2_col, (float*)&mat_B,
contacts,
normals,
penetration);
//Collision detected if nHits > 0
/*if( nHits > 0)
return true;
return false;*/
NewtonReleaseCollision(IrrPhysics::nworld, obj1_col);
NewtonReleaseCollision(IrrPhysics::nworld, obj2_col);
//NewtonDestroyBody(IrrPhysics::nworld, obj1);
//NewtonDestroyBody(IrrPhysics::nworld, obj2);
return nHits;
}
int CheckForCollision(Irr3DObj& obj_A, Irr3DObj& obj_B)
{
//Matrix to store irr_node position
matrix4 mat_A,mat_B;
//Copy position
mat_A.makeIdentity();
mat_B.makeIdentity();
mat_A.setTranslation(obj_A->getSceneNode()->getPosition());
mat_B.setTranslation(obj_B->getSceneNode()->getPosition());
const int nContacts = 2;
float contacts[3 * nContacts];
float normals[3 * nContacts];
float penetration[ nContacts ];
//Check for collision between collision meshes,
// returns number of contact points
int nHits = NewtonCollisionCollide( IrrPhysics::nworld,nContacts,
obj_A->getNewtonCollision(), (float*)&mat_A[0],
obj_B->getNewtonCollision(), (float*)&mat_B[0],
contacts,
normals,
penetration);
//Collision detected if nHits > 0
/*if( nHits > 0)
return true;
return false;*/
return nHits;
}
//Function to create a NewtonCollision from irrlicht mesh with tree optimization
NewtonCollision * CreateTreeCollisionFromMesh(IMesh *irr_mesh )
{
//Create new (tree optimized) collision mesh
NewtonCollision *collision_obj = NewtonCreateTreeCollision(IrrPhysics::nworld ,NULL);
//Begin collision mesh construction
NewtonTreeCollisionBeginBuild(collision_obj);
int nMeshBuffer = 0; //Mesh Buffer count
int v_index[3] = {0,0,0}; //vertex indices
IMeshBuffer *mesh_buffer = NULL;
float array[9]; //Array to store 3 vertices
//Get (irr_)mesh buffers and copy face by face to collision mesh
for( nMeshBuffer=0 ; nMeshBuffer < irr_mesh->getMeshBufferCount() ; nMeshBuffer++ )
{
mesh_buffer = irr_mesh->getMeshBuffer(nMeshBuffer);
//Get pointer to vertices and indices
S3DVertex *vertices = (S3DVertex*)mesh_buffer->getVertices();
u16 *indices = mesh_buffer->getIndices();
//Fill collision mesh
for(int i=0; i<mesh_buffer->getIndexCount(); i+=3)
{
v_index[0] = indices[ i ];
v_index[1] = indices[i+1];
v_index[2] = indices[i+2];
// 1st position vertex
array[0] = vertices[ v_index[0] ].Pos.X;
array[1] = vertices[ v_index[0] ].Pos.Y;
array[2] = vertices[ v_index[0] ].Pos.Z;
// 2nd position vertex
array[3] = vertices[ v_index[1] ].Pos.X;
array[4] = vertices[ v_index[1] ].Pos.Y;
array[5] = vertices[ v_index[1] ].Pos.Z;
// 3rd position vertex
array[6] = vertices[ v_index[2] ].Pos.X;
array[7] = vertices[ v_index[2] ].Pos.Y;
array[8] = vertices[ v_index[2] ].Pos.Z;
//Add new face to collision mesh
NewtonTreeCollisionAddFace(collision_obj, //collision mesh to add face to
3, //number of vertices in array
(float*)array, //pointer to vertex array
3*sizeof(float),//size of each vertex
1); //ID of the face
}
}
//End collision contruction , set 1 as 2dn param for optimization
NewtonTreeCollisionEndBuild(collision_obj,0);
return collision_obj;
}
//Function to create a NewtonCollision from irrlicht mesh
NewtonCollision * CreateCollisionFromMesh(IMesh *irr_mesh )
{
int nMeshBuffer = 0; //Mesh Buffer count
IMeshBuffer *mesh_buffer = NULL;
float *vertices; //Array to store vertices
u32 nVertices = 0;
//Get number of vertices
for( nMeshBuffer=0 ; nMeshBuffer < irr_mesh->getMeshBufferCount() ; nMeshBuffer++ )
{
nVertices += irr_mesh->getMeshBuffer(nMeshBuffer)->getVertexCount();
}
//create buffer for vertices
vertices = new float[nVertices * 3];
u32 tmpCounter = 0;
//Get (irr_)mesh buffers and copy face vertices
for( nMeshBuffer=0 ; nMeshBuffer < irr_mesh->getMeshBufferCount() ; nMeshBuffer++ )
{
mesh_buffer = irr_mesh->getMeshBuffer(nMeshBuffer);
//Get pointer to vertices and indices
S3DVertex *S3vertices = (S3DVertex*)mesh_buffer->getVertices();
//copy vertices from mesh to buffer
for(int i=0; i<mesh_buffer->getVertexCount(); i++)
{
vertices[tmpCounter++] = S3vertices[i].Pos.X;
vertices[tmpCounter++] = S3vertices[i].Pos.Y;
vertices[tmpCounter++] = S3vertices[i].Pos.Z;
}
}
//Create Newton collision object
NewtonCollision *collision_obj = NewtonCreateConvexHull(IrrPhysics::nworld,nVertices,vertices,sizeof(float)*3,NULL);
//delete vertices
delete [] vertices;
return collision_obj;
}
Unstable Version/1.3.3/Irr2D.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Copyright (C) 2008
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
//#include "IrrLib.h"
//#include "IrrSphere.h" //You probably aren't going to be using 3D objects in a 2D environment!
#include <irrlicht.h>
#include <strings.h>
#include "Irr2D.h"
#include "IrrSprite.h"
#include "IrrText.h"
//#include "IrrLibBase.h"
//#include "IrrData.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
void Irr2D::LoadText()
{
text.push_back(this->driver->getTexture("0.png"));
text.push_back(this->driver->getTexture("1.png"));
text.push_back(this->driver->getTexture("2.png"));
}
Irr2D::Irr2D(){
this->numTextures = 0;
this->numLines = 0;
this->nImages = 0;
//NA Should we set textures to new
}
Irr2D::~Irr2D(){
//delete Irr2DObjret;
/*for(int i = 0; i < numTextures; ++i)
delete this->textures[i];
delete this->textures;*/
//No more dynamic memory business yay! NA
//All handled by vectors!
}
/*void Irr2D::SetSmgr(irr::scene::ISceneManager* smgr){
this->smgr = smgr;
Sprite.SetSmgr(smgr);
}
void Irr2D::SetDriver(irr::video::IVideoDriver* driver){
this->driver = driver;
Sprite.SetDriver(driver);
}*/
Irr2DObj Irr2D::LoadTexturemap(stringc file){
this->texturemap = this->driver->getTexture(file.c_str());
}
Irr2DObj Irr2D::LoadTexture(stringc file){
//this->textures[this->numTextures] = driver->getTexture(file.c_str());
textures.push_back(driver->getTexture(file.c_str()));
this->numTextures++;
Irr2DObj ret;
ret->eventid = 0;
ret->objectid = numTextures--;
return ret;
}
void Irr2D::DrawLine(IrrPos& start, IrrPos& end, irr::video::SColor color)
{
this->driver->draw2DLine(start, end, color);
}
void Irr2D::AddLines(IrrPos& start, IrrPos& end, irr::video::SColor color)
{
this->start.push_back(start);
this->end.push_back(end);
this->color.push_back(color);
this->numLines++;
}
void Irr2D::DrawLines()
{
for(int i = 0; i < numLines; ++i)
this->driver->draw2DLine(this->start[i], this->end[i], this->color[i]);
}
void Irr2D::LoadIrrImage(Irr2DObj& in, irr::core::stringc file)
{
images.push_back(this->driver->getTexture(file.c_str()));
//cout << "Irr2DObjret->objectid = " << (*Irr2DObjret)->objectid << endl;
in->objectid = nImages;
this->driver->makeColorKeyTexture(images[nImages], core::position2d<s32>(0,0));
dimension2d<s32> tmp;
tmp = images[nImages]->getSize();
//cout << tmp.Height << ": " << nImages << endl;
in->setHeight(tmp.Height);
in->setLength(tmp.Width);
//in->
in->eventid = 0;
this->nImages++;
//return (*Irr2DObjret);
}
void Irr2D::DrawImage(Irr2DObj& img)
{
//irr::core::position2d<irr::s32> destPos(img->x, img->y);
irr::core::position2d<irr::s32> destPos(img->getX(), img->getY());
irr::core::rect<irr::s32> sourcePos(0, 0, img->getHeight(), img->getLength());
//this->driver->draw2DImage(images[img->objectid], destPos);
this->driver->draw2DImage(images[img->objectid], destPos);
//this->driver->draw2DImage(images[img->objectid], destPos, sourcePos, SColor(255, 255, 255, 255), true);
}
void Irr2D::Draw2DObj(irr::core::stringc file)
{
//NewtonObj tmp;
//tmp.irr_node = smgr->addMeshSceneNode(smgr->getMesh(file.c_str())->getMesh(0));
//IMeshSceneNode* temp;
objects.push_back(smgr->addMeshSceneNode(smgr->getMesh(file.c_str())->getMesh(0)));
//objects.push_back(smgr->addMeshSceneNode(smgr->getMesh(file.c_str())->getMesh(0)));
objects[0]->setPosition(vector3df(-5,0,0));
objects[0]->getMaterial(0).EmissiveColor.set(255,0,255,5);
}
void Irr2D::DrawText(IrrText& txt)
{
//txt.resetCounter();
int offsetx = 0;
char nc;
for (int i = 0; i < txt.size(); ++i){
irr::core::position2d<irr::s32> destPos(txt.getX()+offsetx, txt.getY());
offsetx += 18;
nc = txt.getChar(i);
switch (nc)
{
case '0':
#ifdef IRRDEBUG
cout << "0" << endl;
#endif
this->driver->draw2DImage(this->text[0], destPos);
break;
case '1':
#ifdef IRRDEBUG
cout << "1" << endl;
#endif
this->driver->draw2DImage(this->text[1], destPos);
break;
case '2':
#ifdef IRRDEBUG
cout << "2" << endl;
#endif
this->driver->draw2DImage(this->text[2], destPos);
break;
case '3':
#ifdef IRRDEBUG
cout << "3" << endl;
#endif
break;
case '4':
#ifdef IRRDEBUG
cout << "4" << endl;
#endif
break;
case '5':
#ifdef IRRDEBUG
cout << "5" << endl;
#endif
break;
case '6':
#ifdef IRRDEBUG
cout << "6" << endl;
#endif
break;
case '8':
#ifdef IRRDEBUG
cout << "7" << endl;
#endif
break;
case '9':
#ifdef IRRDEBUG
cout << "8" << endl;
#endif
break;
default:
cout << "Unrecongized Character!" << endl;
break;
}
}
}
Unstable Version/1.3.3/Irr2D.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Copyright (C) 2008
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRR2D_H
#define IRR2D_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
#include <vector>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
//#include "IrrLib.h"
#include "IrrSprite.h"
#include "IrrDefines.h"
#include "IrrText.h"
class Irr2D: public IrrLibBase {
private:
//irr::scene::ISceneManager* smgr;
//irr::video::IVideoDriver* driver;
//Inherited from IrrLibBase
irr::video::ITexture* texturemap;
int numTextures;
//irr::video::ITexture* textures[10];
std::vector<irr::video::ITexture*> textures;
std::vector<irr::core::position2d<irr::s32> > start;
std::vector<irr::core::position2d<irr::s32> > end;
std::vector<irr::video::SColor> color;
std::vector<irr::video::ITexture*> images;
std::vector<irr::video::ITexture*> text;
std::vector<irr::scene::IMeshSceneNode*> objects;
int numLines;
int nImages;
public:
//Irr2D::Irr2D();
IrrSprite Sprite;
Irr2D();
~Irr2D();
//void Irr2D::SetDriver(irr::video::IVideoDriver* driver);
//void Irr2D::SetSmgr(irr::scene::ISceneManager* smgr);
//Inherited from irrlibbase
Irr2DObj LoadTexturemap(irr::core::stringc file);
Irr2DObj LoadTexture(irr::core::stringc file);
//Has been renamed from LoadImage to LoadIrrImage due to conflict with windows API
void LoadIrrImage(Irr2DObj& in, irr::core::stringc file);
//void Irr2D::DrawImage(int texture, const irr::core::position2d<irr::s32> & destPos);
//void Irr2D::DrawImage(IrrObj& img, irr::core::position2d<irr::s32>& destPos);
void DrawImage(Irr2DObj& img);
void Draw2DObj(irr::core::stringc file);
//void Irr2D::MoveImage(IrrObj img, irr::core::dimension2d<irr::s32> destPos);
//void Irr2D::MoveImage(IrrObj img, int x, int y);
//void Irr2D::DrawImage(const irr::core::position2d<irr::s32> & destPos, const irr::core::rect<irr::s32> & sourceRect, const irr::core::rect<irr::s32> * clipRect, irr::video::SColor color, bool useAlphaChannelOfTexture);
//void Irr2D::DrawImage(const irr::core::position2d<irr::s32> & destPos, const irr::core::rect<irr::s32> & sourceRect, const irr::core::rect<irr::s32> * clipRect, irr::video::SColor color, bool useAlphaChannelOfTexture);
//void Irr2D::DrawLine(irr::core::position2d<irr::s32>& start, irr::core::position2d<irr::s32>& end, irr::video::SColor& color);
void DrawLine(IrrPos& start, IrrPos& end, irr::video::SColor color);
void DrawLines();
//void Irr2D::AddLines(irr::core::position2d<irr::s32>& start, irr::core::position2d<irr::s32>& end, irr::video::SColor& color);
void AddLines(IrrPos& start, IrrPos & end, irr::video::SColor color);
void DrawText(IrrText& txt);
void LoadText();
//bool Irr2D::Collision(IrrObj obj1, IrrObj obj2);
//IrrObj Irr2D::LoadImageA(irr::core::stringc file);
};
#endif
Unstable Version/1.3.3/Irr2DLibObj.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#include <iostream>
#include "Irr2DLibObj.h"
using namespace std;
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
Irr2DLibObj::~Irr2DLibObj()
{
//NewtonReleaseCollision(IrrPhysics::nworld, this->nwtn_collision);
}
float Irr2DLibObj::getX()
{
return this->x;
}
float Irr2DLibObj::getY()
{
return this->y;
}
void Irr2DLibObj::setX(float cord)
{
this->x = cord;
}
void Irr2DLibObj::setY(float cord)
{
this->y = cord;
}
void createObject()
{
//NewtonCreateBox(IrrPhysics::nworld,
}
irr::core::vector3d<float> Irr2DLibObj::getPosition()
{
//this->nwtn_collision =
//int rl = this->getLength() / 2;
//int rh = this->getHeight() / 2;
//this->pos.set(this->x-rl, this->y-rh, 0);
float rx = this->x + (this->getLength() / 2);
float ry = this->y + (this->getHeight() / 2);
this->pos.set(rx, ry, 0);
//this->pos.set(this->x, this->y, 0);
return pos;
}
NewtonCollision* Irr2DLibObj::getNewtonCollision()
{
return this->nwtn_collision;
}
s32 Irr2DLibObj::getHeight()
{
return this->height;
}
s32 Irr2DLibObj::getLength()
{
return this->length;
}
void Irr2DLibObj::setHeight(s32 h)
{
this->height = h;
}
void Irr2DLibObj::setLength(s32 l)
{
this->length = l;
}
Unstable Version/1.3.3/Irr2DLibObj.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#ifndef IRR2DLIBOBJ_H
#define IRR2DLIBOBJ_H
#include <irrlicht.h>
#include <newton.h>
class Irr2DLibObj {
private:
float x;
float y;
NewtonCollision *nwtn_collision;
irr::core::vector3d<float> pos;
irr::s32 height;
irr::s32 length;
public:
int eventid;
int objectid;
float getX();
float getY();
void createObject();
~Irr2DLibObj();
irr::s32 getHeight();
irr::s32 getLength();
void setHeight(irr::s32 h);
void setLength(irr::s32 l);
void setX(float cord);
void setY(float cord);
irr::core::vector3d<float> getPosition();
NewtonCollision* getNewtonCollision();
};
#endif
Unstable Version/1.3.3/Irr3D.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Copyright (C) 2008
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <strings.h>
//#include "IrrLib.h"
//Libraries we create go here
#include "IrrSphere.h"
//#include "IrrColor.h"
#include "Irr3D.h"
#include <irrlicht.h>
//#include "Irr2D.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
/*void Irr3D::SetDriver(irr::video::IVideoDriver* driver) //so much for copying and pasting code from the header file
{
this->driver = driver;
Sphere.SetDriver(driver);
}
void Irr3D::SetSmgr(irr::scene::ISceneManager* smgr)
{
this->smgr = smgr;
Sphere.SetSmgr(smgr);
}*/
Irr3D::Irr3D()
{
//do stuff here!
}
Irr3D::~Irr3D()
{
//delete stuff here!
}
Unstable Version/1.3.3/Irr3D.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Copyright (C) 2008
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRR3D_H
#define IRR3D_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
#include "IrrSphere.h"
//#include "IrrColor.h"
//#include "Irr3D.h"
//#include "Irr2D.h" This is a 3D class not 2D
/* However due to Irrlciht's nature mixing 2D with 3D is possible */
//Start class
class Irr3D: public IrrLibBase {
private:
//irr::video::IVideoDriver* driver;
//irr::scene::ISceneManager* smgr;
public:
IrrSphere Sphere;
Irr3D();
~Irr3D();
//void Irr3D::SetDriver(irr::video::IVideoDriver* driver);
//void Irr3D::SetSmgr(irr::scene::ISceneManager* smgr);
};
#endif
Unstable Version/1.3.3/Irr3DLibObj.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Copyright (C) 2008
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <irrlicht.h>
#include <strings.h>
#include <newton.h>
#include "Irr3DLibObj.h"
#include "IrrPhysics.h"
#include "IrrFunctions.h"
#include "IrrLib.h"
//#include "IrrDevices.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
Irr3DLibObj::Irr3DLibObj()
{
this->col.a = 0;
this->col.b = 0;
this->col.g = 0;
this->col.r = 0;
}
void Irr3DLibObj::setColor(Irr3DObjColor col)
{
this->col.a = col.a;
this->col.b = col.b;
this->col.g = col.g;
this->col.r = col.r;
}
/*Irr3DLibObj::Irr3DLibObj(IrrLib &irr, Irr3DLibObjColor col)
{
this->col.a = col.a;
this->col.r = col.r;
this->col.g = col.g;
this->col.b = col.b;
}*/
IMeshSceneNode* Irr3DLibObj::getSceneNode()
{
return this->irr_node;
}
NewtonCollision* Irr3DLibObj::getNewtonCollision()
{
return this->nwtn_collision;
}
void Irr3DLibObj::setMesh(irr::core::stringc strng)
{
this->texture = strng;
}
void Irr3DLibObj::Move(Irr3DPos pos)
{
this->irr_node->setPosition(vector3df(pos.x, pos.y, pos.z));
}
void Irr3DLibObj::addToScene()
{
if (this->texture == "")
{
cout << "Material not set for this object" << endl;
return;
}
if (IrrLib::device == NULL)
cout << "Device is null!" << endl;
else {
ISceneManager* smgr = IrrLib::device->getSceneManager();
//this->irr_node = this->device->getSceneManager->addMeshSceneNode(this->device->getSceneManager->getMesh(this->texture.c_str())->getMesh(0));
this->irr_node = smgr->addMeshSceneNode(smgr->getMesh(this->texture.c_str())->getMesh(0));
this->irr_node->getMaterial(0).EmissiveColor.set(this->col.a, this->col.r, this->col.g, this->col.b);
//cout << col.a << endl;
this->nwtn_collision = CreateCollisionFromMesh(this->irr_node->getMesh());
}
}
Unstable Version/1.3.3/Irr3DLibObj.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Copyright (C) 2008
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRR3DLIBOBJ_H
#define IRR3DLIBOBJ_H
/* We have to include Irrlichts libs */
#include <irrlicht.h>
#include <newton.h>
#include "IrrLibBase.h"
//class IrrLib;
//#include "IrrData.h"
#include "Irr3DObjColor.h"
#include "Irr3DPos.h"
//class Irr3DLibObj;
//class IrrLib;
//#include "IrrLib.h"
//class Irr3DPos;
class IrrLib;
class Irr3DLibObj: public IrrLibBase {
private:
IrrLib * Irrlicht;
irr::scene::IMeshSceneNode *irr_node;
NewtonCollision *nwtn_collision;
irr::core::stringc texture;
Irr3DObjColor col;
public:
Irr3DLibObj();
void Move(Irr3DPos pos);
void addToScene();
void createNewObj(); //Not implmented?
void setMesh(irr::core::stringc strng);
void setPosition(Irr3DPos pos); //Not implmented?
void setColor(Irr3DObjColor col);
void setPosition(irr::u32 x, irr::u32 y, irr::u32 z); //Not implmented?
irr::scene::IMeshSceneNode* getSceneNode();
NewtonCollision* getNewtonCollision();
};
#endif
Unstable Version/1.3.3/Irr3DObjColor.h
1
2
3
4
5
6
7
8
9
10
11
12
#ifndef IRR3DOBJCOLOR_H
#define IRR3DOBJCOLOR_H
#include <irrlicht.h>
struct Irr3DObjColor {
irr::u32 r;
irr::u32 g;
irr::u32 b;
irr::u32 a;
};
#endif
Unstable Version/1.3.3/Irr3DPos.h
1
2
3
4
5
6
7
8
9
10
#ifndef IRR3DPOS_H
#define IRR3DPOS_H
struct Irr3DPos {
int x;
int y;
int z;
};
#endif
Unstable Version/1.3.3/IrrColor.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Copyright (C) 2008
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <irrlicht.h>
#include <strings.h>
//#include "IrrLib.h"
#include "IrrColor.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
void IrrColor::Init(){
/*SColor * temp;
temp = new SColor(alpha, 255, 0, 0);
this->RED = temp;
delete temp;*/
this->RED = SColor(alpha, 255, 0, 0);
this->ORANGE = SColor(alpha, 255, 165, 0);
this->YELLOW = SColor(alpha, 255, 255, 0);
this->GREEN = SColor(alpha, 0, 255, 0);
this->BLUE = SColor(alpha, 0, 0, 255);
this->DARK_GREEN = SColor(alpha, 0, 100, 0);
this->PINK = SColor(alpha, 255, 192, 203);
this->GREY = SColor(alpha, 190, 190, 190);
this->WHITE = SColor(alpha, 0, 0, 0);
this->BLACK = SColor(alpha, 0, 0, 0);
}
IrrColor::~IrrColor(){
/*delete this->RED;
delete this->ORANGE;
delete this->YELLOW;
delete this->GREEN;
delete this->BLUE;
delete this->DARK_GREEN;
delete this->PINK;
delete this->GREY;
delete this->WHITE;
delete this->BLACK;*/
}
IrrColor::IrrColor(){
this->alpha = 255;
Init();
}
IrrColor::IrrColor(irr::u32 alpha){
this->alpha = alpha;
Init();
}
int IrrColor::getAlpha(){
return this->alpha;
}
void IrrColor::setAlpha(int alpha){
this->alpha = alpha;
}
SColor IrrColor::returnColor(stringw color){
int nColor = -1;
if (color == "red")
nColor = 1;
else if (color == "green")
nColor = 2;
else if (color == "blue")
nColor = 3;
else if (color == "dark green")
nColor = 4;
else if (color == "pink")
nColor = 5;
else if (color == "grey")
nColor = 6;
switch (nColor){
case 1:
return SColor(255, 255, 0, 0);
break;
case 2:
return SColor(255, 0, 255, 0);
break;
case 3:
return SColor(255, 0, 0, 255);
break;
case 4:
return SColor(255, 0, 50, 0);
break;
case 5:
return SColor(255, 255, 10, 255);
break;
case 6:
return SColor(255,200,200,200);
break;
default:
return SColor(255,200,200,200);
break;
}// TODO: Make this function modular
}
Unstable Version/1.3.3/IrrColor.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Copyright (C) 2008
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRCOLOR_H
#define IRRCOLOR_H
#include <iostream>
#include <strings.h>
#include "irrlicht.h"
//#include "IrrLib.h"
class IrrColor {
private:
irr::u32 alpha;
void Init();
//who knows?
public:
//irr::video::SColor(alpha, 255, 0, 0);
irr::video::SColor RED;
irr::video::SColor ORANGE;
irr::video::SColor YELLOW;
irr::video::SColor GREEN;
irr::video::SColor BLUE;
irr::video::SColor DARK_GREEN;
irr::video::SColor PINK;
irr::video::SColor GREY;
irr::video::SColor WHITE;
irr::video::SColor BLACK;
/*const ORANGE = irr::video::SColor(alpha, 255, 165, 0);
const YELLOW = irr::video::SColor(alpha, 255, 255, 0);
const GREEN = irr::video::SColor(alpha, 0, 255, 0);
const BLUE = irr::video::SColor(alpha, 0, 0, 255);
const DARK_GREEN = irr::video::SColor(alpha, 0, 100, 0);
const PINK = irr::video::SColor(alpha, 255, 192, 203);
const GREY = irr::video::Scolor(alpha, 190, 190, 190);*/
//void IrrColor::test();
IrrColor();
IrrColor(irr::u32 alpha);
~IrrColor();
int getAlpha();
void setAlpha(int alpha);
irr::video::SColor returnColor(irr::core::stringw color);
};
#endif
Unstable Version/1.3.3/IrrDefines.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#ifndef IRRDEFINES_H
#define IRRDEFINES_H
//#include "IrrData.h"
#include "IrrObj.h"
#include "IrrLibObj.h"
#include "IrrGUIStruct.h"
#include "Irr3DObjColor.h"
#include "Irr3DLibObj.h"
#include "Irr2DLibObj.h"
typedef IrrObj<Irr2DLibObj> Irr2DObj;
typedef IrrObj<IrrGUIStruct> IrrGUIObj;
typedef IrrObj<IrrLibObj> IrrEventObj;
typedef IrrObj<IrrLibObj> Irr3DSphere;
typedef IrrObj<Irr3DLibObj> Irr3DObj;
typedef irr::core::dimension2d<irr::s32> PixelSize;
typedef irr::core::position2d<irr::s32> IrrPos;
#endif
Unstable Version/1.3.3/IrrDevices.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Copyright (C) 2008
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRDEVICES_H
#define IRRDEVICES_H
class IrrDevices {
public:
static irr::video::IVideoDriver* getDriver();
static irr::scene::ISceneManager* getSmgr();
static irr::IrrlichtDevice* getDevice();
static irr::video::IVideoDriver* driver;
static irr::scene::ISceneManager* smgr;
static irr::IrrlichtDevice *device;
};
#endif
Unstable Version/1.3.3/IrrEventReciever.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Copyright (C) 2008
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include "IrrEventReciever.h"
#include "IrrLib.h"
//#include "IrrLib.h"
#include <irrlicht.h>
#include <iostream>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
/*void IrrEventReciever::setIrrLib(IrrLib& IrrLib)
{
this.callingIrrLib = IrrLib;
}*/
IrrEventReciever::IrrEventReciever()
{
this->escexit = true;
this->mouse.x = 0;
this->mouse.y = 0;
for(int i = 0; i < irr::KEY_KEY_CODES_COUNT; i++)
keyStates[i] = false;
this->device = IrrLib::device;
}
#if IRRVER == 131
bool IrrEventReciever::OnEvent(SEvent event)
#else
bool IrrEventReciever::OnEvent(const SEvent &event)
#endif
{
// A button was clicked
if (event.EventType == irr::EET_GUI_EVENT)
{
s32 id = event.GUIEvent.Caller->getID();
switch(event.GUIEvent.EventType){
case EGET_BUTTON_CLICKED:
//cout << id << endl;
buttonStates.push_back(id);
break;
case EGET_LISTBOX_CHANGED:
//s32 id = event.GUIEvent.Caller->getID();
listStates.push_back(id);
break;
case EGET_LISTBOX_SELECTED_AGAIN:
listStates.push_back(id);
break;
default:
break;
}
}
/*if (event.EventType == irr::EGET_SCROLL_BAR_CHANGED)
{
}*/
if (event.EventType == irr::EET_KEY_INPUT_EVENT) {
if (!event.KeyInput.PressedDown){
this->keyStates[event.KeyInput.Key] = false;
//cout << "Key was not hit " << this->keyStates[event.KeyInput.Key] << endl;
}
else{
if(event.KeyInput.Key == KEY_ESCAPE && escexit)
IrrLib::device->closeDevice();
this->keyStates[event.KeyInput.Key] = true;
//cout << "Key was hit: " << event.KeyInput.Key << " " << this->keyStates[event.KeyInput.Key] << endl;
}
}
if (event.EventType == EET_MOUSE_INPUT_EVENT){
if (event.MouseInput.Event == EMIE_MOUSE_MOVED){
this->mouse.x = event.MouseInput.X;
this->mouse.y = event.MouseInput.Y;
}
if (event.MouseInput.Event == EMIE_LMOUSE_PRESSED_DOWN)
this->mouseStates[0] = true;
if (event.MouseInput.Event == EMIE_LMOUSE_LEFT_UP)
this->mouseStates[0] = false;
}
return false;
}
void IrrEventReciever::SetEscExit(bool onoff)
{
this->escexit = onoff;
}
int IrrEventReciever::getMouseX()
{
return this->mouse.x;
}
int IrrEventReciever::getMouseY()
{
return this->mouse.y;
}
int IrrEventReciever::getButtonState()
{
if(!this->buttonStates.empty()){
int id;
id = buttonStates.back();
this->buttonStates.pop_back();
return id;
}
else
return -1;
}
int IrrEventReciever::getRevButtonState()
{
if(!this->buttonStates.empty()){
int id = buttonStates.front();
this->buttonStates.erase(buttonStates.begin());
return id;
}
else
return -1;
}
void IrrEventReciever::clearButtonState()
{
this->buttonStates.clear();
}
int IrrEventReciever::checkButtonState(IrrEventObj obj)
{
if(!this->buttonStates.empty()){
int tmp = this->buttonStates.back();
if (tmp == obj->eventid)
{
this->delLastButtonState();
return 1;
}
else
{
return 0;
}
}
else
{
return -1;
}
}
void IrrEventReciever::delLastButtonState()
{
if(!this->buttonStates.empty())
this->buttonStates.pop_back();
}
bool IrrEventReciever::isButtonStateEmpty()
{
return this->buttonStates.empty();
}
int IrrEventReciever::checkListState(IrrEventObj obj)
{
if(!this->listStates.empty())
{
int tmp = this->listStates.back();
//cout << tmp << endl;
if (tmp == obj->eventid)
{
this->delLastListState();
return 1;
}
else
{
return 0;
}
}
else
{
return 0;
}
}
void IrrEventReciever::delLastListState()
{
if(!this->listStates.empty())
this->listStates.pop_back();
}
Unstable Version/1.3.3/IrrEventReciever.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Copyright (C) 2008
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRREVENTRECIEVER_H
#define IRREVENTRECIEVER_H
//#include "IrrLib.h"
#include <vector>
#include <irrlicht.h>
#include "IrrLibBase.h"
#include "IrrDefines.h"
#include <stdlib.h>
#include "_mouse.h"
class IrrEventReciever : public irr::IEventReceiver, public IrrLibBase
{
private:
//IrrLib callingIrrLib;
_mouse mouse;
bool escexit;
std::vector<int> buttonStates;
std::vector<int> listStates;
irr::IrrlichtDevice *device;
public:
//IrrEventReciever();
bool mouseStates[1];
IrrEventReciever();
int getMouseX();
int getMouseY();
bool keyStates[irr::KEY_KEY_CODES_COUNT];
//void setIrrLib(IrrLib& IrrLib)
#if IRRVER == 131
virtual bool OnEvent(irr::SEvent event);
#else
virtual bool OnEvent(const irr::SEvent &event);
#endif
void SetEscExit(bool onoff);
int getButtonState();
int getRevButtonState();
void clearButtonState();
int checkButtonState(IrrEventObj obj);
void delLastButtonState();
bool isButtonStateEmpty(); //is there still stuff in the vector to be done? NA
int checkListState(IrrEventObj obj);
void delLastListState();
};
#endif
Unstable Version/1.3.3/IrrFunctions.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
#include "IrrFunctions.h"
#include <newton.h>
#include <irrlicht.h>
#include <iostream>
#include "IrrDefines.h"
#include "IrrPhysics.h"
#include <dMatrix.h>
using namespace std;
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
int CheckForCollision(Irr2DObj& obj_A, Irr2DObj& obj_B)
{
const int nContacts = 4;
float contacts[3 * nContacts];
float normals[3 * nContacts];
float penetration[3 * nContacts ];
//dMatrix t1, t2;
const float NewtonToIrr = 32.0f;
const float IrrToNewton = (1.0f / NewtonToIrr);
matrix4 mat_A,mat_B;
mat_A.makeIdentity();
mat_B.makeIdentity();
mat_A.setTranslation(obj_A->getPosition());
mat_B.setTranslation(obj_B->getPosition());
NewtonCollision* obj1_col = NewtonCreateBox(IrrPhysics::nworld, (obj_A->getLength()), obj_A->getHeight(), 1, NULL);
NewtonCollision* obj2_col = NewtonCreateBox(IrrPhysics::nworld, (obj_B->getLength()), obj_B->getHeight(), 1, NULL);
//NewtonCollision* obj2_col = NewtonCreateBox(IrrPhysics::nworld, 2, 10, 1, NULL);
//NewtonBody* obj1 = NewtonCreateBody(IrrPhysics::nworld, obj1_col);
//NewtonBody* obj2 = NewtonCreateBody(IrrPhysics::nworld, obj2_col);
//NewtonBodyGetMatrix( obj1, &t1[0][0] );
//NewtonBodyGetMatrix( obj2, &t2[0][0] );
//Check for collision between collision meshes,
// returns number of contact points
int nHits = NewtonCollisionCollide( IrrPhysics::nworld,nContacts,
obj1_col, (float*)&mat_A,
obj2_col, (float*)&mat_B,
contacts,
normals,
penetration);
NewtonReleaseCollision(IrrPhysics::nworld, obj1_col);
NewtonReleaseCollision(IrrPhysics::nworld, obj2_col);
//Collision detected if nHits > 0
/*if( nHits > 0)
return true;
return false;*/
//NewtonDestroyBody(IrrPhysics::nworld, obj1);
//NewtonDestroyBody(IrrPhysics::nworld, obj2);
return nHits;
}
int CheckForCollision(Irr3DObj& obj_A, Irr3DObj& obj_B)
{
//Matrix to store irr_node position
matrix4 mat_A,mat_B;
//Copy position
mat_A.makeIdentity();
mat_B.makeIdentity();
mat_A.setTranslation(obj_A->getSceneNode()->getPosition());
mat_B.setTranslation(obj_B->getSceneNode()->getPosition());
const int nContacts = 2;
float contacts[3 * nContacts];
float normals[3 * nContacts];
float penetration[ nContacts ];
//Check for collision between collision meshes,
// returns number of contact points
int nHits = NewtonCollisionCollide( IrrPhysics::nworld,nContacts,
obj_A->getNewtonCollision(), (float*)&mat_A[0],
obj_B->getNewtonCollision(), (float*)&mat_B[0],
contacts,
normals,
penetration);
//Collision detected if nHits > 0
/*if( nHits > 0)
return true;
return false;*/
return nHits;
}
//Function to create a NewtonCollision from irrlicht mesh with tree optimization
NewtonCollision * CreateTreeCollisionFromMesh(IMesh *irr_mesh )
{
//Create new (tree optimized) collision mesh
NewtonCollision *collision_obj = NewtonCreateTreeCollision(IrrPhysics::nworld ,NULL);
//Begin collision mesh construction
NewtonTreeCollisionBeginBuild(collision_obj);
int nMeshBuffer = 0; //Mesh Buffer count
int v_index[3] = {0,0,0}; //vertex indices
IMeshBuffer *mesh_buffer = NULL;
float array[9]; //Array to store 3 vertices
//Get (irr_)mesh buffers and copy face by face to collision mesh
for( nMeshBuffer=0 ; nMeshBuffer < irr_mesh->getMeshBufferCount() ; nMeshBuffer++ )
{
mesh_buffer = irr_mesh->getMeshBuffer(nMeshBuffer);
//Get pointer to vertices and indices
S3DVertex *vertices = (S3DVertex*)mesh_buffer->getVertices();
u16 *indices = mesh_buffer->getIndices();
//Fill collision mesh
for(int i=0; i<mesh_buffer->getIndexCount(); i+=3)
{
v_index[0] = indices[ i ];
v_index[1] = indices[i+1];
v_index[2] = indices[i+2];
// 1st position vertex
array[0] = vertices[ v_index[0] ].Pos.X;
array[1] = vertices[ v_index[0] ].Pos.Y;
array[2] = vertices[ v_index[0] ].Pos.Z;
// 2nd position vertex
array[3] = vertices[ v_index[1] ].Pos.X;
array[4] = vertices[ v_index[1] ].Pos.Y;
array[5] = vertices[ v_index[1] ].Pos.Z;
// 3rd position vertex
array[6] = vertices[ v_index[2] ].Pos.X;
array[7] = vertices[ v_index[2] ].Pos.Y;
array[8] = vertices[ v_index[2] ].Pos.Z;
//Add new face to collision mesh
NewtonTreeCollisionAddFace(collision_obj, //collision mesh to add face to
3, //number of vertices in array
(float*)array, //pointer to vertex array
3*sizeof(float),//size of each vertex
1); //ID of the face
}
}
//End collision contruction , set 1 as 2dn param for optimization
NewtonTreeCollisionEndBuild(collision_obj,0);
return collision_obj;
}
//Function to create a NewtonCollision from irrlicht mesh
NewtonCollision * CreateCollisionFromMesh(IMesh *irr_mesh )
{
int nMeshBuffer = 0; //Mesh Buffer count
IMeshBuffer *mesh_buffer = NULL;
float *vertices; //Array to store vertices
u32 nVertices = 0;
//Get number of vertices
for( nMeshBuffer=0 ; nMeshBuffer < irr_mesh->getMeshBufferCount() ; nMeshBuffer++ )
{
nVertices += irr_mesh->getMeshBuffer(nMeshBuffer)->getVertexCount();
}
//create buffer for vertices
vertices = new float[nVertices * 3];
u32 tmpCounter = 0;
//Get (irr_)mesh buffers and copy face vertices
for( nMeshBuffer=0 ; nMeshBuffer < irr_mesh->getMeshBufferCount() ; nMeshBuffer++ )
{
mesh_buffer = irr_mesh->getMeshBuffer(nMeshBuffer);
//Get pointer to vertices and indices
S3DVertex *S3vertices = (S3DVertex*)mesh_buffer->getVertices();
//copy vertices from mesh to buffer
for(int i=0; i<mesh_buffer->getVertexCount(); i++)
{
vertices[tmpCounter++] = S3vertices[i].Pos.X;
vertices[tmpCounter++] = S3vertices[i].Pos.Y;
vertices[tmpCounter++] = S3vertices[i].Pos.Z;
}
}
//Create Newton collision object
NewtonCollision *collision_obj = NewtonCreateConvexHull(IrrPhysics::nworld,nVertices,vertices,sizeof(float)*3,NULL);
//delete vertices
delete [] vertices;
return collision_obj;
}
Unstable Version/1.3.3/IrrFunctions.h
1
2
3
4
5
6
7
8
9
10
11
12
13
#ifndef IRRFUNCTIONS_H
#define IRRFUNCTIONS_H
//#include "IrrObj.h"
#include "IrrDefines.h"
//void test(Irr3DObj obj_A, Irr3DObj obj_B);
int CheckForCollision(Irr3DObj& obj_A, Irr3DObj& obj_B);
NewtonCollision * CreateTreeCollisionFromMesh(irr::scene::IMesh *irr_mesh );
NewtonCollision * CreateCollisionFromMesh(irr::scene::IMesh *irr_mesh );
int CheckForCollision(Irr2DObj& obj_A, Irr2DObj& obj_B);
#endif
Unstable Version/1.3.3/IrrGUIStruct.h
1
2
3
4
5
6
7
8
9
10
#ifndef IRRGUISTRUCT_H
#define IRRGUISTRUCT_H
struct IrrGUIStruct {
int eventid;
int objectid;
};
#endif
Unstable Version/1.3.3/IrrLib.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Copyright (C) 2008
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <irrlicht.h>
#include <strings.h>
#include <sstream>
#include <time.h>
#include "IrrLib.h"
//Libraries we create go here
//#include "IrrSphere.h"
#include "IrrColor.h"
//class IrrDevices;
#include "IrrDevices.h"
//#include "Irr2D.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
/*IrrLib::IrrLib(MastEventReceiver & receiver){
this->device = createDevice(EDT_SOFTWARE, dimension2d<s32>(640, 480), 16, false, false, false, &receiver);
if (this->device == 0)
exit(1);
IrrLib::Init();
}*/
IrrlichtDevice *IrrLib::device;
IrrLib::IrrLib(){
IrrLib::device = createDevice(EDT_SOFTWARE, dimension2d<s32>(640, 480), 16, false, false, false, &this->IrrEvent);
if (IrrLib::device == 0)
exit(1);
IrrLib::Init();
}
IrrLib::IrrLib(video::E_DRIVER_TYPE drivertype, core::dimension2d<s32> & res, u32 bits, bool fullscreen, bool stencilbuffer, bool vsync){
//MyEventReceiver receiver;
IrrLib::device = createDevice(drivertype, res, bits, fullscreen, stencilbuffer, vsync, &this->IrrEvent);
if (IrrLib::device == 0)
exit(1);
IrrLib::Init();
}
IrrLib::IrrLib(int nDrivertype, int width, int height, int bits, bool fullscreen, bool stencilbuffer, bool vsync){
//MyEventReceiver receiver;
video::E_DRIVER_TYPE drivertype;
switch (nDrivertype){
case 0: //TODO: finish this switch case
drivertype = EDT_NULL;
break;
case 1:
drivertype = EDT_SOFTWARE;
break;
case 2:
drivertype = EDT_BURNINGSVIDEO;
break;
case 3:
drivertype = EDT_OPENGL;
break;
case 4:
#if DX8 == 1
drivertype = EDT_DIRECT3D8;
#else
drivertype = EDT_OPENGL;
#endif
//*Note: It seems as Microsoft has stoped supporting DX 8.1, so you can not compile it into Irrlicht engine anymore
//TODO: Find how to detect if DX is complied into Irrlicht
//TODO: Find how to detecht for linux
break;
case 5:
#if DX9 == 1
drivertype = EDT_DIRECT3D9;
#else
drivertype = EDT_OPENGL;
#endif
break;
default:
drivertype = EDT_SOFTWARE;
break;
}
IrrLib::device = createDevice(drivertype, dimension2d<s32>(width, height), bits, fullscreen, stencilbuffer, vsync, &this->IrrEvent);
if (IrrLib::device == 0)
exit(1);
IrrLib::Init();
}
IrrLib::~IrrLib (){ //Our moms wont clean up after us!
//Although I'm sure Irrlicht does this for us already, its always a good idea to check!
/*if (this->device != NULL)
delete this->device;
if (this->driver != NULL)
delete this->driver;
if (this->smgr != NULL)
delete this->smgr;
if (this->mesh != NULL)
delete this->mesh;
if (this->node != NULL)
delete this->node;*/ //it seems Irrlicht picks up after us...
//however we created newNodes, now we need to delete it!
// NewtonReleaseCollision(nworld, sphere.nwtn_collision);
// NewtonReleaseCollision(nworld, cube.nwtn_collision);
//NewtonDestroy(IrrPhy.nworld);
}
void IrrLib::Init(){
//this->numNodes = 0;
//this->nodeNew = new ISceneNode[10];
//this->env->addStaticText(L"Transparent Control:", rect<s32>(20,30,300,80), true);
this->env = this->device->getGUIEnvironment();
this->driver = this->device->getVideoDriver();
this->smgr = this->device->getSceneManager();
//IrrDevices::driver = this->driver;
//IrrDevices::smgr = this->smgr;
Irr3DLib.SetSmgr(this->smgr);
Irr3DLib.SetDriver(this->driver);
Irr2DLib.SetSmgr(this->smgr);
Irr2DLib.SetDriver(this->driver);
//Irr
Irr2DLib.LoadText();
//IrrEvent.SetDevice(this->device);
//Irr2DObj.SetDriver(this->device);
GUI.SetEnv(this->env);
//IrrEvent.SetDevice(this->device);
this->timer = this->device->getTimer();
tick = this->timer->getRealTime();
}
void IrrLib::ReadArchive(stringc file){
this->device->getFileSystem()->addZipFileArchive(file.c_str());
}
void IrrLib::LoadQ3Level(stringc q3level){
this->mesh = this->smgr->getMesh(q3level.c_str());
this->node = 0;
if (this->mesh)
this->node = this->smgr->addOctTreeSceneNode(this->mesh->getMesh(0), 0, -1, 128);
}
void IrrLib::MapPos(int x, int y, int z){
if (this->node)
this->node->setPosition(core::vector3df(x, y, z));
}
void IrrLib::MapPos(){
if (this->node)
this->node->setPosition(core::vector3df(0, 0, 0));
}
void IrrLib::AddFPSCam(){
this->cam = this->smgr->addCameraSceneNodeFPS();
}
void IrrLib::AddFPSCam(f32 x, f32 y, f32 z)
{
this->cam = this->smgr->addCameraSceneNodeFPS();
this->cam->setPosition(irr::core::vector3df(x, y, z));
}
void IrrLib::VisibleCursor(bool tf){
if (tf == false)
this->device->getCursorControl()->setVisible(false);
else
this->device->getCursorControl()->setVisible(true);
}
int IrrLib::GetFPSCount(){
return this->driver->getFPS();
}
bool IrrLib::DeviceIsRunning(){
return this->device->run();
}
bool IrrLib::IsActiveWindow(){
return this->device->isWindowActive();
}
void IrrLib::BeginScene(){
this->driver->beginScene(true, true, video::SColor(0,200,200,200));
//smgr->addCameraSceneNode(0, vector3df(0,1,-7), vector3df(0,0,0));
}
void IrrLib::BeginScene(irr::video::SColor color){
this->driver->beginScene(true, true, color);
}
void IrrLib::BeginScene(bool usebackBuffer, bool usezBuffer, irr::video::SColor color){
this->driver->beginScene(usebackBuffer, usezBuffer, color);
}
void IrrLib::DrawAll(){
//position2d<int> start(50, 50);
//position2d<int> end(100,100);
// SColor whitecolor(255,255,255,255);
//driver->draw2DLine(start, end, whitecolor);
this->env->drawAll();
this->smgr->drawAll();
/*gui::IGUIFont* font = device->getGUIEnvironment()->getBuiltInFont();
if (font)
font->draw(L"This demo shows that Irrlicht is also capable of drawing 2D graphics.",
core::rect<s32>(130,10,300,50),
video::SColor(255,255,255,255));
if (font)
font->draw(L"This demo shows that Irrlicht is also capable of drawing 2D graphics.",
core::rect<s32>(300,10,420,50),
video::SColor(255,255,255,255));*/
//this->device->getGUIEnvironment()->drawAll();
}
void IrrLib::EndScene(){
this->driver->endScene();
}
void IrrLib::SetWindowCaption(stringw str){
this->device->setWindowCaption(str.c_str());
}
irr::core::stringw IrrLib::GetDriverName(){
return this->driver->getName();
}
void IrrLib::EndIrrlicht(){
if(this->device != NULL){
this->device->drop();
this->device = NULL;
}
}
void IrrLib::KeyPress(char key){
this->key = key;
}
char IrrLib::KeyPressed(){
return key;
}
irr::f32 IrrLib::getX(){
return this->smgr->getActiveCamera()->getPosition().X;
}
irr::f32 IrrLib::getY(){
return this->smgr->getActiveCamera()->getPosition().Y;
}
irr::f32 IrrLib::getZ(){
return this->smgr->getActiveCamera()->getPosition().Z;
}
bool IrrLib::CheckGameLoop(){
u32 now;
now = this->timer->getRealTime();
if ((now - this->tick) >= 30){
this->tick = now;
//this->tick == time (NULL);
return true;
} else {
return false;
}
}
bool IrrLib::CheckGameLoop(u32 ms){
u32 now;
now = this->timer->getRealTime();
if ((now - this->tick) >= ms){
this->tick = now;
return true;
} else {
return false;
}
}
void IrrLib::Exit()
{
this->device->closeDevice();
}
PixelSize IrrLib::GetScreenSize()
{
return this->driver->getScreenSize();
/*pixels returnres;
returnres.width = screenres.Width;
returnres.height = screenres.Height;
return returnres;*/
}
void IrrLib::AddCamera(core::vector3df pos, core::vector3df lookat)
{
this->smgr->addCameraSceneNode(0, pos, lookat);
}
//template <class T> std::string IrrLib::to_string (T t)
/*std::string IrrLib::int_to_string (int t)
{
std::stringstream ss;
ss << t;
return ss.str();
}*/
// This is in the base class now, every class that decends from that class has this ability.
Unstable Version/1.3.3/IrrLib.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Copyright (C) 2008
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRLIB_H
#define IRRLIB_H
#ifndef IRRVER
#define IRRVER 14
//2 Versions
// 14 or 131
//Different version due to different implmenation of eventreciever
#endif
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
#include <irrlicht.h>
#include <time.h>
/* We have to include Irrlichts libs */
/*class Irr3D;
class IrrColor;
class IrrLibGUI;
class IrrEventReciever;
class Irr2D;
//class IrrLibBase;
class IrrPhysics;
class Irr3DObj;*/
#include "Irr3D.h"
#include "IrrColor.h"
#include "IrrLibGUI.h"
#include "IrrEventReciever.h"
#include "Irr2D.h"
//#include "Irr2DObj.h"
#include "IrrLibBase.h"
//#include "IrrData.h"
//class IrrPhysics;
#include "IrrPhysics.h"
#include "IrrFunctions.h"
#include "Irr3DLibObj.h"
#include "IrrDefines.h"
#include "IrrText.h"
//#include "Irr3DObj.h"
/*struct IrrObj {
int eventid;
int objectid;
};*/
//class IrrPhysics;
//Start class
class IrrLib: public IrrLibBase {
private:
/* Create an Irrlicht device as private because the class should handle
All irrlicht interaction */
//irr::IrrlichtDevice *device;
//In IrrLibBase
// Tells Irrlicht what driver to use
//video::E_DRIVER_TYPE driverType;
/*
Get a pointer to the video driver and the SceneManager so that
we do not always have to write device->getVideoDriver() and
device->getSceneManager().
*/
/*irr::video::IVideoDriver* driver;
irr::scene::ISceneManager* smgr;*/
//In IrrLibBase
irr::gui::IGUIEnvironment* env;
/*
Get a pointer to the 'mesh' aka the level.
Note: This is for Quake3 levels, ie bsp maps.
*/
irr::scene::IAnimatedMesh* mesh;
irr::scene::ISceneNode* node;
irr::scene::ISceneNode * tempNode; //use this to store nodeNew's data so we can resize it
irr::scene::ICameraSceneNode * cam;
char key;
void Init();
/*friend class IrrColor;
friend class Irr2DLib;
friend class Sphere;*/
//friend class IrrEventReciever;
irr::u32 tick;
irr::ITimer* timer;
//std::vector<Irr3DLibObj*> gc_vector;
public:
//IrrSphere Sphere; //This has to be public to be able to access the Sphere class
/* IrrSphere is now in Irr3D class */
//Prehaps put this into a IrrLib3D class?
Irr3D Irr3DLib;
IrrColor Color; //Color class...not much of a class but lets keep it OO
Irr2D Irr2DLib; //1/2 variable to be labeled like this due to variables not able to begin with a number
IrrLibGUI GUI;
IrrPhysics IrrPhy;
IrrEventReciever IrrEvent;
IrrLib();
static irr::IrrlichtDevice *device;
//IrrLib(MastEventReceiver & receiver);
IrrLib(irr::video::E_DRIVER_TYPE drivertype, irr::core::dimension2d<irr::s32> & res, irr::u32 bits, bool fullscreen, bool stencilbuffer, bool vsync);
IrrLib(int drivertype, int width, int height, int bits, bool fullscreen, bool stencilbuffer, bool vsync);
~IrrLib(); //Our moms wont clean up after us!
void ReadArchive(irr::core::stringc file);
void LoadQ3Level(irr::core::stringc q3level);
void MapPos(int x, int y, int z); //I think this moves the actual camera?
void MapPos();
void AddFPSCam();
void AddFPSCam(irr::f32 x, irr::f32 y, irr::f32 z);
void VisibleCursor(bool tf);
int GetFPSCount();
bool DeviceIsRunning();
bool IsActiveWindow();
void BeginScene();
void AddCamera(irr::core::vector3df pos, irr::core::vector3df lookat);
void BeginScene(irr::video::SColor color);
//void BeginScene(irr::video::SColor * color);
void BeginScene(bool usebackBuffer, bool usezBuffer, irr::video::SColor color);
//TODO: Add one more for human readable colors and hex colors!
void DrawAll();
void EndScene();
void SetWindowCaption(irr::core::stringw str);
irr::core::stringw GetDriverName();
//TODO: Make function to turn stringw to string and visa versa
void EndIrrlicht(); //Renamed from KillIrrlicht to EndIrrlicht
//TODO: Add logging
void KeyPress(char key);
char KeyPressed();
irr::f32 getX();
irr::f32 getY();
irr::f32 getZ();
bool CheckGameLoop();
bool CheckGameLoop(irr::u32 ms);
void Exit();
PixelSize GetScreenSize();
//void EndGameLoop();
//template <class T> std::string to_string (T t);
};
#endif
Unstable Version/1.3.3/IrrLibBase.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Copyright (C) 2008
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <irrlicht.h>
#include "IrrLibBase.h"
#include <strings.h>
#include <sstream>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
/*
* Code from http://articles.techrepublic.com.com/5100-22-5079969.html#
*
struct str_stream
{
std::stringstream & underlying_stream() const
{ return m_streamOut; }
operator std::string() const
{
return m_streamOut.str();
}
private:
mutable std::stringstream m_streamOut;
};
template< class type>
inline const str_stream & operator<< ( const str_stream & out, const type & value)
{
out.underlying_stream() << value;
return out;
}
template<class type> std::string to_string( const type & value)
{
std::ostringstream streamOut;
streamOut << value;
return streamOut.str();
}
* End code copy
*/
void IrrLibBase::SetDriver(IVideoDriver* driver) //can be overloaded
{
this->driver = driver;
}
void IrrLibBase::SetSmgr(ISceneManager* smgr)
{
this->smgr = smgr;
}
std::string IrrLibBase::wchar_to_stdstring (const wchar_t* wc)
{
//cout << "Starting conversion";
//wcstombs(tmp, in, 255);
char c[255];
for(int t = 0; wc[t] != '\0'; t++)
c[t] = (char)wc[t];
/*for(int t = 0; c[t] != '\0'; t++)
wc[t] = c[t];*/
std::stringstream ss;
ss << c;
//cout << "Conversion OK";
return ss.str();
}
std::string IrrLibBase::int_to_string (int t)
{
std::stringstream ss;
ss << t;
return ss.str();
}
std::string IrrLibBase::stringw_to_stdstring(irr::core::stringw sw)
{
std::stringstream ss;
ss << sw.c_str();
return ss.str();
}
irr::core::stringw IrrLibBase::stdstring_to_stringw(std::string ss)
{
stringw tmpw(ss.c_str());
return tmpw;
}
/*void IrrLibBase::SetDevice(irr::IrrlichtDevice *device)
{
this->device = device;
}*/
void IrrLibBase::init()
{
}
/*irr::core::stringw int_to_stringw(int t)
{
std::stringstream ss;
ss << t;
//stringw ret(ss.str());
return ret;
}*/
Unstable Version/1.3.3/IrrLibBase.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Copyright (C) 2008
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRLIBBASE_H
#define IRRLIBBASE_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
class IrrLibBase {
protected:
irr::video::IVideoDriver* driver;
irr::scene::ISceneManager* smgr;
irr::IrrlichtDevice *device;
public:
//template<class type> std::string to_string( const type & value);
irr::core::dimension2d<irr::s32> irrpixels;
void SetDriver(irr::video::IVideoDriver* driver);
void SetSmgr(irr::scene::ISceneManager* smgr);
void SetDevice(irr::IrrlichtDevice *device);
std::string int_to_string (int t);
std::string stringw_to_stdstring(irr::core::stringw sw);
irr::core::stringw stdstring_to_stringw(std::string ss);
std::string wchar_to_stdstring (const wchar_t* wc);
//irr::core::stringw int_to_stringw(int t);
void init();
};
#endif
Unstable Version/1.3.3/IrrLibGUI.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Copyright (C) 2008
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <strings.h>
#include <irrlicht.h>
#include <vector>
#include <sstream>
#include "IrrLib.h"
#include "IrrLibGUI.h"
#include "IrrLibBase.h"
#include <stdlib.h>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
template<class type> std::string to_string( const type & value)
{
std::ostringstream streamOut;
streamOut << value;
return streamOut.str();
}
IrrLibGUI::IrrLibGUI()
{
//NA does it need to do anything at init?
this->nStaticText = 0;
this->nButton = 0;
this->nButtonid = 100;
this->nListBoxid = 200;
this->nListBox = 0;
//this->nListBoxid = 300;
//this->arrStaticText = new IGUIStaticText[10];
//this->env = this->device->getGUIEnvironment(); //NA yes we do!
}
IrrLibGUI::~IrrLibGUI()
{
//NA Do we have to delete anything?
}
void IrrLibGUI::SetEnv(IGUIEnvironment* env)
{
this->env = env;
//env->addButton(rect<s32>(10,210,110,210 + 32), 0, 109, L"Quit", L"Exits Program");
}
IrrGUIObj IrrLibGUI::addButton(const core::rect< s32 > & rectangle, IGUIElement *parent, s32 id, const wchar_t * text, const wchar_t * tooltiptext)
{
arrButton.push_back(this->env->addButton(rectangle, parent, id, text, tooltiptext));
++nButton;
++nButtonid;
IrrGUIObj ret;
ret->objectid = --nButtonid;
return ret;
}
IrrGUIObj IrrLibGUI::addListBox(const irr::core::rect< irr::s32 > &rectangle, IGUIElement * parent)
{
irr::gui::IGUIListBox* tmp = this->env->addListBox(rectangle, parent, nListBoxid);
arrListBox.push_back(tmp);
//we introduce a new datatype; IrroObj
IrrGUIObj ret;
ret->eventid = nListBoxid;
ret->objectid = nListBox;
++nListBox;
++nListBoxid;
return ret;
}
IrrGUIObj IrrLibGUI::AddListBox(int x1, int y1, int x2, int y2, IGUIElement * parent)
{
return addListBox(rect<s32>(x1, y1, x2, y2), parent);
}
IrrGUIObj IrrLibGUI::AddListBox(const irr::core::rect< irr::s32 > &rectangle, IGUIElement * parent)
{
return addListBox(rectangle, parent);
}
void IrrLibGUI::AddStringToListBox(IrrGUIObj nLbox, stringw text)
{
this->arrListBox[nLbox->objectid]->addItem(text.c_str());
//this->arrListBox[0]->addItem(L"TEST");
}
std::string IrrLibGUI::getSelectListString(IrrGUIObj lstbox)
{
//stringc tmp = this->arrListBox[lstbox]->getListItem(this->arrListBox[lstbox]->getSelected());
//s32 selected = this->arrListBox[lstbox.objectid]->getSelected();
//const wchar_t* tmp = this->arrListBox[lstbox]->getListItem(selected);
//irr::core::stringw tmp;
//char out[255];
//tmp = this->arrListBox[lstbox]->getText();
irr::core::stringc tmp(arrListBox[lstbox->objectid]->getListItem(arrListBox[lstbox->objectid]->getSelected()));
//cout << tmp.c_str() << endl;
//wcstombs(out, tmp, tmp.length());
//cout << tmp[0] << endl;
// std::stringstream ss;
//for (int i = 0; i < tmp.size(); ++i)
//ss << tmp.c_str();
std::string ret = tmp.c_str();
return ret;
}
void IrrLibGUI::Clear()
{
this->env->clear();
}
void IrrLibGUI::DrawAll()
{
this->env->drawAll();
}
IrrGUIObj IrrLibGUI::AddToStaticArray(irr::gui::IGUIStaticText * addme)
{
//arrStaticText[nStaticText] = addme;
arrStaticText.push_back(addme);
this->nStaticText++;
this->nButtonid++;
IrrGUIObj ret;
ret->objectid = this->nStaticText;
return ret;
}
void IrrLibGUI::AddStaticText()
{
//rect<s32>(20,30,300,80),
if (!this->env->addStaticText(L"Powered by IrrLib.\nPowered by Newton Game Dynamics.", rect<s32>(20,30,300,80), true))
cout << "Error:: Adding static text!" << endl;
}
IrrGUIObj IrrLibGUI::AddStaticText(stringw message)
{
irr::gui::IGUIStaticText * addthis;
addthis = this->env->addStaticText(message.c_str(), rect<s32>(20,30,300,80), true);
return AddToStaticArray(addthis);
}
IrrGUIObj IrrLibGUI::AddStaticText(stringw message, int x1, int y1, int x2, int y2)
{
irr::gui::IGUIStaticText * addthis;
addthis = this->env->addStaticText(message.c_str(), rect<s32>(x1,y1,x2,y2), true);
return AddToStaticArray(addthis);
}
IrrGUIObj IrrLibGUI::AddStaticText(stringw message, int x1, int y1, int x2, int y2, bool border, bool wordwrap)
{
irr::gui::IGUIStaticText * addthis;
addthis = this->env->addStaticText(message.c_str(), rect<s32>(x1,y1,x2,y2), border, wordwrap);
return AddToStaticArray(addthis);
}
IrrGUIObj IrrLibGUI::AddStaticText(stringw message, int x1, int y1, int x2, int y2, bool border, bool wordwrap, int id, bool fillbackground)
{
irr::gui::IGUIStaticText * addthis;
addthis = this->env->addStaticText(message.c_str(), rect<s32>(x1,y1,x2,y2), border, wordwrap, 0, id, fillbackground);
return AddToStaticArray(addthis);
}
IrrGUIObj IrrLibGUI::AddStaticText(stringw message, const core::rect< s32 > &rectangle)
{
irr::gui::IGUIStaticText * addthis;
addthis = this->env->addStaticText(message.c_str(), rectangle);
return AddToStaticArray(addthis);
}
IrrGUIObj IrrLibGUI::AddStaticText(stringw message, const core::rect< s32 > &rectangle, bool border, bool wordwrap)
{
irr::gui::IGUIStaticText * addthis;
addthis = this->env->addStaticText(message.c_str(), rectangle, border, wordwrap);
return AddToStaticArray(addthis);
}
IrrGUIObj IrrLibGUI::AddStaticText(stringw message, const core::rect< s32 > &rectangle, bool border, bool wordwrap, int id, bool fillbackground)
{
irr::gui::IGUIStaticText * addthis;
addthis = this->env->addStaticText(message.c_str(), rectangle, border, wordwrap, 0, id, fillbackground);
return AddToStaticArray(addthis);
}
void IrrLibGUI::ChangeStaticText(IrrGUIObj nstatictext, stringw message)
{
//this->arrStaticText[this->nStaticText.objectid-1]->setText(message.c_str());
this->arrStaticText[nstatictext->objectid]->setText(message.c_str());
}
void IrrLibGUI::ChangeFont(stringc fontfile)
{
IGUISkin* skin = this->env->getSkin();
IGUIFont* font = this->env->getFont(fontfile.c_str());
if (font)
skin->setFont(font);
}
IrrGUIObj IrrLibGUI::AddButton(stringw text, int x1, int y1, int x2, int y2, stringw tooltiptext = "")
{
return addButton(rect<s32>(x1, y1, x2, y2), 0, nButtonid, text.c_str(), tooltiptext.c_str());
}
IrrGUIObj IrrLibGUI::AddButton(stringw text, core::rect<s32> & rect, stringw tooltiptext = "")
{
return addButton(rect, 0, nButtonid, text.c_str(), tooltiptext.c_str());
}
Unstable Version/1.3.3/IrrLibGUI.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Copyright (C) 2008
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRLIBGUI_H
#define IRRLIBGUI_H
#include <iostream>
#include <strings.h>
#include <irrlicht.h>
#include "IrrLib.h"
#include "IrrLibBase.h"
class IrrLibGUI: public IrrLibBase {
private:
irr::gui::IGUISkin* skin;
irr::gui::IGUIFont* font;
irr::gui::IGUIEnvironment* env;
//TODO: Create an array storing all messages
int nStaticText;
//irr::gui::IGUIStaticText* arrStaticText[10];
int nButton;
int nButtonid;
int nListBox;
int nListBoxid;
std::vector<irr::gui::IGUIStaticText*> arrStaticText;
std::vector<irr::gui::IGUIButton*> arrButton;
std::vector<irr::gui::IGUIListBox*> arrListBox;
IrrGUIObj AddToStaticArray(irr::gui::IGUIStaticText * addme);
IrrGUIObj addButton(const irr::core::rect< irr::s32 > & rectangle, irr::gui::IGUIElement *parent = 0, irr::s32 id = 0, const wchar_t * text = 0, const wchar_t * tooltiptext = 0); //TODO: Clean this up!
IrrGUIObj addListBox(const irr::core::rect< irr::s32 > &rectangle, irr::gui::IGUIElement * parent);
public:
IrrLibGUI();
~IrrLibGUI();
void SetEnv(irr::gui::IGUIEnvironment* env);
void Clear();
void DrawAll();
//irr::gui::IGUIStaticText* IrrLibGUI::AddStaticText(); //NA eh a default text adder why not?
/* This is bad coding, we do not want to return an irrlicht object, we want to return a standard datatype because this class handles the GUI elements, not the user. */
void AddStaticText(); //NA eh a default text adder why not?
IrrGUIObj AddStaticText(irr::core::stringw message);
IrrGUIObj AddStaticText(irr::core::stringw message, int x1, int y1, int x2, int y2);
IrrGUIObj AddStaticText(irr::core::stringw message, int x1, int y1, int x2, int y2, bool border, bool wordwrap);
IrrGUIObj AddStaticText(irr::core::stringw message, int x1, int y1, int x2, int y2, bool border, bool wordwrap, int id, bool fillbackground);
IrrGUIObj AddStaticText(irr::core::stringw message, const irr::core::rect< irr::s32 > &rectangle);
IrrGUIObj AddStaticText(irr::core::stringw message, const irr::core::rect< irr::s32 > &rectangle, bool border, bool wordwrap);
IrrGUIObj AddStaticText(irr::core::stringw message, const irr::core::rect< irr::s32 > &rectangle, bool border, bool wordwrap, int id, bool fillbackground);
IrrGUIObj AddButton(irr::core::stringw text, int x1, int y1, int x2, int y2, irr::core::stringw tooltiptext);
IrrGUIObj AddButton(irr::core::stringw text, irr::core::rect<irr::s32> & rect, irr::core::stringw tooltiptext); //TODO: Add move functions
IrrGUIObj AddListBox(int x1, int y1, int x2, int y2, irr::gui::IGUIElement * parent = 0);
IrrGUIObj AddListBox(const irr::core::rect< irr::s32 > &rectangle, irr::gui::IGUIElement * parent = 0);
void AddStringToListBox(IrrGUIObj nLbox, irr::core::stringw text);
void ChangeStaticText(IrrGUIObj nstatictext, irr::core::stringw message);
void ChangeFont(irr::core::stringc fontfile);
std::string getSelectListString(IrrGUIObj lstbox);
//irr::core::stringw getSelectListString(int lstbox);
};
#endif
Unstable Version/1.3.3/IrrLibObj.h
1
2
3
4
5
6
7
8
9
10
11
12
#ifndef IRRLIBOBJ_H
#define IRRLIBOBJ_H
struct IrrLibObj {
int eventid;
int objectid;
int x;
int y;
};
#endif
Unstable Version/1.3.3/IrrObj.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#ifndef IRROBJ_H
#define IRROBJ_H
#include <iostream>
//template <typename T> const char* typeof(T&) { return "unknown"; } // default
//template<> const char* typeof(Irr3DLibObj&) { return "Irr3DLibObj"; }
//template<> const char* typeof(float&) { return "float"; }
template <class T> class IrrObj {
T* ptr;
public:
explicit IrrObj(T* p = 0) : ptr(p) {if (p == NULL) ptr = new T;}
~IrrObj() {if (ptr!=0) delete ptr;}
T& operator*() {return *ptr;}
T* operator->() {return ptr;}
void remove() {delete ptr;}
};
#endif
Unstable Version/1.3.3/IrrOpt.h
1
2
3
4
5
6
7
8
9
#ifndef IRROPT.H
#define IRROPT.H
struct IrrOpt {
bool lighting;
irr::core::stringc t;
};
#endif
Unstable Version/1.3.3/IrrPhysics.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Copyright (C) 2008
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
#include <vector>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
//#include "IrrLib.h"
#include <newton.h>
#include "IrrPhysics.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
NewtonWorld * IrrPhysics::nworld;
IrrPhysics::IrrPhysics()
{
this->nworld = NewtonCreate(NULL,NULL);
NewtonSetSolverModel(this->nworld, 0);
NewtonSetFrictionModel(this->nworld, 0);
}
IrrPhysics::~IrrPhysics()
{
NewtonDestroy(this->nworld);
}
Unstable Version/1.3.3/IrrPhysics.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Copyright (C) 2008
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRPHYSICS_H
#define IRRPHYSICS_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
#include <vector>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
#include <newton.h>
//#include "IrrLib.h"
#include "IrrLibBase.h"
class IrrPhysics: public IrrLibBase {
//private:
public:
static NewtonWorld *nworld;
IrrPhysics();
~IrrPhysics();
};
#endif
Unstable Version/1.3.3/IrrSphere.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Copyright (C) 2008
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include "IrrLib.h"
#include "IrrSphere.h"
#include <irrlicht.h>
#include <strings.h>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
/*void IrrSphere::SetSmgr(irr::scene::ISceneManager* smgr){
this->smgr = smgr;
}
void IrrSphere::SetDriver(irr::video::IVideoDriver* driver){
this->driver = driver;
}*/
Irr3DSphere IrrSphere::CreateNewSphereNode(int x, int y, int z, stringc texture, bool light){
//this->nodeNew[this->numNodes] = this->smgr->addSphereSceneNode();
//this->sphereNodes[this->numNodes]->setPosition(core::vector3df(x,y,z));
//this->sphereNodes[this->numNodes]->setMaterialTexture(0, this->driver->getTexture(texture.c_str()));
//this->sphereNodes[this->numNodes]->setMaterialFlag(video::EMF_LIGHTING, light);
Irr3DSphere ret;
nodeNew = this->smgr->addSphereSceneNode();
nodeNew->setPosition(core::vector3df(x,y,z));
nodeNew->setMaterialTexture(0, this->driver->getTexture(texture.c_str()));
nodeNew->setMaterialFlag(video::EMF_LIGHTING, light);
sphereNodes.push_back(nodeNew);
this->numNodes++;
ret->objectid = this->numNodes--;
return ret;
/*this->node = this->smgr->addSphereSceneNode();
this->node->setPosition(core::vector3df(x,y,z));
this->node->setMaterialTexture(0, this->driver->getTexture(texture.c_str()));
this->node->setMaterialFlag(video::EMF_LIGHTING, light);*/
}
irr::core::vector3df IrrSphere::GetSphereVector(int sphere){
//We are converting to vectors, under construction NA
//return this->nodeNew[sphere]->getPosition();
return this->sphereNodes[sphere]->getPosition();
}
void IrrSphere::SetSphereVector(int sphere, irr::core::vector3df v){
this->sphereNodes[sphere]->setPosition(v);
}
IrrSphere::IrrSphere(){
this->numNodes = 0;
}
IrrSphere::~IrrSphere(){
/*for(int i = 0; i < numNodes; ++i)
delete this->nodeNew[i];
delete this->nodeNew;*/
//We are using vectors now, no more memory clowing business NA
}
Unstable Version/1.3.3/IrrSphere.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Copyright (C) 2008
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRSPHERE_H
#define IRRSPHERE_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
#include <vector>
#include <irrlicht.h>
/* We have to include Irrlichts libs */
#include "IrrLibBase.h"
//#include "IrrData.h"
#include "IrrDefines.h"
//#include "IrrLib.h"
class IrrSphere: public IrrLibBase
{
private:
//irr::scene::ISceneNode* nodeNew[10];
irr::scene::ISceneNode* nodeNew;
std::vector<irr::scene::ISceneNode*> sphereNodes;
int numNodes;
//irr::scene::ISceneManager* smgr;
//irr::video::IVideoDriver* driver;
public:
//void IrrSphere::SetDriver(irr::video::IVideoDriver* driver);
//void IrrSphere::SetSmgr(irr::scene::ISceneManager* smgr);
Irr3DSphere CreateNewSphereNode(int x, int y, int z, irr::core::stringc texture, bool light); //this is going to take my advanced C++ skillz!
irr::core::vector3df GetSphereVector(int sphere);
void SetSphereVector(int sphere, irr::core::vector3df v);
IrrSphere();
//IrrSphere::IrrSphere(IrrLib*);
~IrrSphere();
};
#endif
Unstable Version/1.3.3/IrrSprite.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Copyright (C) 2008
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <irrlicht.h>
#include <strings.h>
#include "IrrLib.h"
//Libraries we create go here
//#include "IrrSphere.h"
#include "IrrColor.h"
#include "IrrSprite.h"
//#include "Irr2D.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
IrrSprite::IrrSprite()
{
//do stuff
}
IrrSprite::~IrrSprite()
{
//delete stuff
}
/*void IrrSprite::SetDriver(irr::video::IVideoDriver* driver)
{
this->driver = driver;
}
void IrrSprite::SetSmgr(irr::scene::ISceneManager* smgr)
{
this->smgr = smgr;
}*/
Unstable Version/1.3.3/IrrSprite.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Copyright (C) 2008
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRSPRITE_H
#define IRRSPRITE_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
//#include "IrrSphere.h"
#include "IrrLibBase.h"
#include "IrrColor.h"
//#include "Irr2D.h"
//#include "IrrSprite.h"
//Start class
class IrrSprite: public IrrLibBase {
private:
//irr::video::IVideoDriver* driver;
//irr::scene::ISceneManager* smgr;
public:
IrrSprite();
~IrrSprite();
/*void IrrSprite::SetDriver(irr::video::IVideoDriver* driver);
void IrrSprite::SetSmgr(irr::scene::ISceneManager* smgr);*/
// I forgot a semicolon here....and it wasn't compling
//Thats 1 bad thing about OOP if there is an error you don't know where the @#$@# the problem is!
};
#endif
Unstable Version/1.3.3/IrrText.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Copyright (C) 2008
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <irrlicht.h>
#include "IrrText.h"
#include <vector>
#include <iostream>
#include "IrrDevices.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
IrrText::IrrText()
{
//counter = 0;
//this->setText("No Text");
this->str = "No Text";
this->Move(0,0);
}
IrrText::IrrText(irr::core::stringw str)
{
//counter = 0;
this->str = str;
//this->setText(str);
this->Move(0,0);
}
void IrrText::Move(float x, float y)
{
this->x = x;
this->y = y;
}
/*void IrrText::setText(irr::core::stringw str)
{
int offset = 0;
irr::core::position2d<irr::s32> destPos(this->x, this->y);
this->text.clear();
for(unsigned int i = 0; i < str.size(); i++)
switch (str[i])
{
case '0':
#ifdef IRRDEBUG
cout << "0" << endl;
#endif
//this->text.push_back(IrrDevices::driver->getTexture("0.png"));
break;
case '1':
#ifdef IRRDEBUG
cout << "1" << endl;
#endif
break;
case '2':
#ifdef IRRDEBUG
cout << "2" << endl;
#endif
break;
case '3':
#ifdef IRRDEBUG
cout << "3" << endl;
#endif
break;
case '4':
#ifdef IRRDEBUG
cout << "4" << endl;
#endif
break;
case '5':
#ifdef IRRDEBUG
cout << "5" << endl;
#endif
break;
case '6':
#ifdef IRRDEBUG
cout << "6" << endl;
#endif
break;
case '8':
#ifdef IRRDEBUG
cout << "7" << endl;
#endif
break;
case '9':
#ifdef IRRDEBUG
cout << "8" << endl;
#endif
break;
default:
cout << "Unrecongized Character!" << endl;
break;
}
}*/
float IrrText::getX()
{
return this->x;
}
float IrrText::getY()
{
return this->y;
}
char IrrText::getChar(int charLoc)
{
return this->str[charLoc];
}
void IrrText::setX(float x)
{
this->x = x;
}
void IrrText::setY(float y)
{
this->y = y;
}
void IrrText::Set(irr::core::stringw str)
{
this->str = str;
}
void IrrText::Set(int num)
{
char tmp[10];
//itoa(num, tmp, 10);
sprintf(tmp, "%d", num);
this->str = tmp;
}
int IrrText::size()
{
return this->str.size();
}
/*void IrrText::resetCounter()
{
this->counter = 0;
}*/
Unstable Version/1.3.3/IrrText.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/*
Irrlicht Library Wrapper
Created by:
Nathan Adams
Copyright (C) 2008
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRTEXT_H
#define IRRTEXT_H
#include <irrlicht.h>
#include "IrrLibBase.h"
#include <vector>
class IrrText: public IrrLibBase {
private:
irr::core::stringw str;
float x;
float y;
//int counter;
public:
int size();
void setX(float x);
void setY(float y);
char getChar(int charLoc);
void Set(irr::core::stringw str);
void Set(int num);
//void resetCounter();
float getX();
float getY();
IrrText();
IrrText(irr::core::stringw str);
//void setText(irr::core::stringw str);
void Move(float x, float y);
};
#endif
Unstable Version/1.3.3/Newton.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
//********************************************************************
// Newton Game dynamics
// copyright 2000-2004
// By Julio Jerez
// VC: 6.0
// One and only header file.
//********************************************************************
#ifndef NEWTON_H__736495_6495_076__INCLUDED_
#define NEWTON_H__736495_6495_076__INCLUDED_
// force all not visual studio platform to be in library form
#ifndef _MSC_VER
#ifndef _NEWTON_USE_LIB
#define _NEWTON_USE_LIB
#endif
#endif
#ifdef _NEWTON_USE_LIB
#define NEWTON_API
#else
#ifdef _NEWTON_BUILD_DLL
#define NEWTON_API __declspec(dllexport)
#else
#define NEWTON_API __declspec(dllimport)
#endif
#endif
//#define __USE_DOUBLE_PRECISION__
#ifdef __USE_DOUBLE_PRECISION__
typedef double dFloat;
#else
typedef float dFloat;
#endif
#ifdef __cplusplus
extern "C" {
#endif
typedef struct NewtonBody{} NewtonBody;
typedef struct NewtonWorld{} NewtonWorld;
typedef struct NewtonJoint{} NewtonJoint;
typedef struct NewtonContact{} NewtonContact;
typedef struct NewtonMaterial{} NewtonMaterial;
typedef struct NewtonCollision{} NewtonCollision;
typedef struct NewtonRagDoll{} NewtonRagDoll;
typedef struct NewtonRagDollBone{} NewtonRagDollBone;
typedef struct NewtonUserMeshCollisionCollideDescTag
{
dFloat m_boxP0[4];// lower bounding box of intersection query in local space
dFloat m_boxP1[4];// upper bounding box of intersection query in local space
void* m_userData; // user data passed to the collision geometry at creation time
int m_faceCount; // the application should set here how many polygons intersect the query box
dFloat* m_vertex; // the application should the pointer to the vertex array.
int m_vertexStrideInBytes; // the application should set here the size of each vertex
int* m_userAttribute; // the application should set here the pointer to the user data, one for each face
int* m_faceIndexCount; // the application should set here the pointer to the vertex count of each face.
int* m_faceVertexIndex; // the application should set here the pointer index array for each vertex on a face.
NewtonBody* m_objBody; // pointer to the colliding body
NewtonBody* m_polySoupBody; // pointer to the rigid body owner of this collision tree
} NewtonUserMeshCollisionCollideDesc;
typedef struct NewtonUserMeshCollisionRayHitDescTag
{
dFloat m_p0[4];// ray origin in collision local space
dFloat m_p1[4]; // ray destination in collision local space
dFloat m_normalOut[4];// copy here the normal at the rat intersection
int m_userIdOut; // copy here a user defined id for further feedback
void* m_userData; // user data passed to the collision geometry at creation time
} NewtonUserMeshCollisionRayHitDesc;
typedef struct NewtonHingeSliderUpdateDescTag
{
dFloat m_accel;
dFloat m_minFriction;
dFloat m_maxFriction;
dFloat m_timestep;
} NewtonHingeSliderUpdateDesc;
// Newton callback functions
typedef void* (*NewtonAllocMemory) (int sizeInBytes);
typedef void (*NewtonFreeMemory) (void *ptr, int sizeInBytes);
typedef void (*NewtonSerialize) (void* serializeHandle, const void* buffer, size_t size);
typedef void (*NewtonDeserialize) (void* serializeHandle, void* buffer, size_t size);
typedef void (*NewtonUserMeshCollisionCollideCallback) (NewtonUserMeshCollisionCollideDesc* collideDescData);
typedef dFloat (*NewtonUserMeshCollisionRayHitCallback) (NewtonUserMeshCollisionRayHitDesc* lineDescData);
typedef void (*NewtonUserMeshCollisionDestroyCallback) (void* descData);
typedef void (*NewtonTreeCollisionCallback) (const NewtonBody* bodyWithTreeCollision, const NewtonBody* body,
const dFloat* vertex, int vertexstrideInBytes,
int indexCount, const int* indexArray);
typedef void (*NewtonBodyDestructor) (const NewtonBody* body);
typedef void (*NewtonApplyForceAndTorque) (const NewtonBody* body);
typedef void (*NewtonBodyActivationState) (const NewtonBody* body, unsigned state);
typedef void (*NewtonSetTransform) (const NewtonBody* body, const dFloat* matrix);
typedef void (*NewtonSetRagDollTransform) (const NewtonRagDollBone* bone);
typedef int (*NewtonGetBuoyancyPlane) (const int collisionID, void *context, const dFloat* globalSpaceMatrix, dFloat* globalSpacePlane);
typedef void (*NewtonVehicleTireUpdate) (const NewtonJoint* vehicle);
typedef unsigned (*NewtonWorldRayPrefilterCallback)(const NewtonBody* body, const NewtonCollision* collision, void* userData);
typedef dFloat (*NewtonWorldRayFilterCallback)(const NewtonBody* body, const dFloat* hitNormal, int collisionID, void* userData, dFloat intersetParam);
typedef void (*NewtonBodyLeaveWorld) (const NewtonBody* body);
typedef int (*NewtonContactBegin) (const NewtonMaterial* material, const NewtonBody* body0, const NewtonBody* body1);
typedef int (*NewtonContactProcess) (const NewtonMaterial* material, const NewtonContact* contact);
typedef void (*NewtonContactEnd) (const NewtonMaterial* material);
typedef void (*NewtonBodyIterator) (const NewtonBody* body);
typedef void (*NewtonCollisionIterator) (const NewtonBody* body, int vertexCount, const dFloat* FaceArray, int faceId);
typedef void (*NewtonBallCallBack) (const NewtonJoint* ball);
typedef unsigned (*NewtonHingeCallBack) (const NewtonJoint* hinge, NewtonHingeSliderUpdateDesc* desc);
typedef unsigned (*NewtonSliderCallBack) (const NewtonJoint* slider, NewtonHingeSliderUpdateDesc* desc);
typedef unsigned (*NewtonUniversalCallBack) (const NewtonJoint* universal, NewtonHingeSliderUpdateDesc* desc);
typedef unsigned (*NewtonCorkscrewCallBack) (const NewtonJoint* corkscrew, NewtonHingeSliderUpdateDesc* desc);
typedef void (*NewtonUserBilateralCallBack) (const NewtonJoint* userJoint);
typedef void (*NewtonConstraintDestructor) (const NewtonJoint* me);
// **********************************************************************************************
//
// world control functions
//
// **********************************************************************************************
NEWTON_API NewtonWorld* NewtonCreate (NewtonAllocMemory malloc, NewtonFreeMemory mfree);
NEWTON_API void NewtonDestroy (const NewtonWorld* newtonWorld);
NEWTON_API void NewtonDestroyAllBodies (const NewtonWorld* newtonWorld);
NEWTON_API void NewtonUpdate (const NewtonWorld* newtonWorld, dFloat timestep);
NEWTON_API void NewtonSetPlatformArchitecture (const NewtonWorld* newtonWorld, int mode);
NEWTON_API void NewtonSetSolverModel (const NewtonWorld* newtonWorld, int model);
NEWTON_API void NewtonSetFrictionModel (const NewtonWorld* newtonWorld, int model);
NEWTON_API dFloat NewtonGetTimeStep (const NewtonWorld* newtonWorld);
NEWTON_API void NewtonSetMinimumFrameRate (const NewtonWorld* newtonWorld, dFloat frameRate);
NEWTON_API void NewtonSetBodyLeaveWorldEvent (const NewtonWorld* newtonWorld, NewtonBodyLeaveWorld callback);
NEWTON_API void NewtonSetWorldSize (const NewtonWorld* newtonWorld, const dFloat* minPoint, const dFloat* maxPoint);
NEWTON_API void NewtonWorldFreezeBody (const NewtonWorld* newtonWorld, const NewtonBody* body);
NEWTON_API void NewtonWorldUnfreezeBody (const NewtonWorld* newtonWorld, const NewtonBody* body);
NEWTON_API void NewtonWorldForEachBodyDo (const NewtonWorld* newtonWorld, NewtonBodyIterator callback);
NEWTON_API void NewtonWorldForEachBodyInAABBDo (const NewtonWorld* newtonWorld, const dFloat* p0, const dFloat* p1, NewtonBodyIterator callback);
NEWTON_API void NewtonWorldSetUserData (const NewtonWorld* newtonWorld, void* userData);
NEWTON_API void* NewtonWorldGetUserData (const NewtonWorld* newtonWorld);
NEWTON_API int NewtonWorldGetVersion (const NewtonWorld* newtonWorld);
NEWTON_API void NewtonWorldRayCast (const NewtonWorld* newtonWorld, const dFloat* p0, const dFloat* p1, NewtonWorldRayFilterCallback filter, void* userData, NewtonWorldRayPrefilterCallback prefilter);
// world utility functions
// NEWTON_API int NewtonGetBodiesCount();
// NEWTON_API int NewtonGetActiveBodiesCount();
// NEWTON_API int NewtonGetActiveConstraintsCount();
// NEWTON_API dFloat NewtonGetGlobalScale (const NewtonWorld* newtonWorld);
// **********************************************************************************************
//
// Physics Material Section
//
// **********************************************************************************************
NEWTON_API int NewtonMaterialGetDefaultGroupID(const NewtonWorld* newtonWorld);
NEWTON_API int NewtonMaterialCreateGroupID(const NewtonWorld* newtonWorld);
NEWTON_API void NewtonMaterialDestroyAllGroupID(const NewtonWorld* newtonWorld);
NEWTON_API void NewtonMaterialSetDefaultSoftness (const NewtonWorld* newtonWorld, int id0, int id1, dFloat value);
NEWTON_API void NewtonMaterialSetDefaultElasticity (const NewtonWorld* newtonWorld, int id0, int id1, dFloat elasticCoef);
NEWTON_API void NewtonMaterialSetDefaultCollidable (const NewtonWorld* newtonWorld, int id0, int id1, int state);
NEWTON_API void NewtonMaterialSetContinuousCollisionMode (const NewtonWorld* newtonWorld, int id0, int id1, int state);
NEWTON_API void NewtonMaterialSetDefaultFriction (const NewtonWorld* newtonWorld, int id0, int id1,
dFloat staticFriction, dFloat kineticFriction);
NEWTON_API void NewtonMaterialSetCollisionCallback (const NewtonWorld* newtonWorld, int id0, int id1, void* userData,
NewtonContactBegin begin, NewtonContactProcess process, NewtonContactEnd end);
NEWTON_API void* NewtonMaterialGetUserData (const NewtonWorld* newtonWorld, int id0, int id1);
// **********************************************************************************************
//
// Physics Contact control functions
//
// **********************************************************************************************
NEWTON_API void NewtonMaterialDisableContact (const NewtonMaterial* material);
NEWTON_API dFloat NewtonMaterialGetCurrentTimestep (const NewtonMaterial* material);
NEWTON_API void *NewtonMaterialGetMaterialPairUserData (const NewtonMaterial* material);
NEWTON_API unsigned NewtonMaterialGetContactFaceAttribute (const NewtonMaterial* material);
NEWTON_API unsigned NewtonMaterialGetBodyCollisionID (const NewtonMaterial* material, const NewtonBody* body);
NEWTON_API dFloat NewtonMaterialGetContactNormalSpeed (const NewtonMaterial* material, const NewtonContact* contactlHandle);
NEWTON_API void NewtonMaterialGetContactForce (const NewtonMaterial* material, dFloat* force);
NEWTON_API void NewtonMaterialGetContactPositionAndNormal (const NewtonMaterial* material, dFloat* posit, dFloat* normal);
NEWTON_API void NewtonMaterialGetContactTangentDirections (const NewtonMaterial* material, dFloat* dir0, dFloat* dir);
NEWTON_API dFloat NewtonMaterialGetContactTangentSpeed (const NewtonMaterial* material, const NewtonContact* contactlHandle, int index);
NEWTON_API void NewtonMaterialSetContactSoftness (const NewtonMaterial* material, dFloat softness);
NEWTON_API void NewtonMaterialSetContactElasticity (const NewtonMaterial* material, dFloat restitution);
NEWTON_API void NewtonMaterialSetContactFrictionState (const NewtonMaterial* material, int state, int index);
NEWTON_API void NewtonMaterialSetContactStaticFrictionCoef (const NewtonMaterial* material, dFloat coef, int index);
NEWTON_API void NewtonMaterialSetContactKineticFrictionCoef (const NewtonMaterial* material, dFloat coef, int index);
NEWTON_API void NewtonMaterialSetContactNormalAcceleration (const NewtonMaterial* material, dFloat accel);
NEWTON_API void NewtonMaterialSetContactNormalDirection (const NewtonMaterial* material, const dFloat* directionVector);
NEWTON_API void NewtonMaterialSetContactTangentAcceleration (const NewtonMaterial* material, dFloat accel, int index);
NEWTON_API void NewtonMaterialContactRotateTangentDirections (const NewtonMaterial* material, const dFloat* directionVector);
// **********************************************************************************************
//
// convex collision primitives creation functions
//
// **********************************************************************************************
NEWTON_API NewtonCollision* NewtonCreateNull (const NewtonWorld* newtonWorld);
NEWTON_API NewtonCollision* NewtonCreateSphere (const NewtonWorld* newtonWorld, dFloat radiusX, dFloat radiusY, dFloat radiusZ, const dFloat *offsetMatrix);
NEWTON_API NewtonCollision* NewtonCreateBox (const NewtonWorld* newtonWorld, dFloat dx, dFloat dy, dFloat dz, const dFloat *offsetMatrix);
NEWTON_API NewtonCollision* NewtonCreateCone (const NewtonWorld* newtonWorld, dFloat radius, dFloat height, const dFloat *offsetMatrix);
NEWTON_API NewtonCollision* NewtonCreateCapsule (const NewtonWorld* newtonWorld, dFloat radius, dFloat height, const dFloat *offsetMatrix);
NEWTON_API NewtonCollision* NewtonCreateCylinder (const NewtonWorld* newtonWorld, dFloat radius, dFloat height, const dFloat *offsetMatrix);
NEWTON_API NewtonCollision* NewtonCreateChamferCylinder (const NewtonWorld* newtonWorld, dFloat radius, dFloat height, const dFloat *offsetMatrix);
NEWTON_API NewtonCollision* NewtonCreateConvexHull (const NewtonWorld* newtonWorld, int count, const dFloat* vertexCloud, int strideInBytes, const dFloat *offsetMatrix);
NEWTON_API NewtonCollision* NewtonCreateConvexHullModifier (const NewtonWorld* newtonWorld, const NewtonCollision* convexHullCollision);
NEWTON_API void NewtonConvexHullModifierGetMatrix (const NewtonCollision* convexHullCollision, dFloat* matrix);
NEWTON_API void NewtonConvexHullModifierSetMatrix (const NewtonCollision* convexHullCollision, const dFloat* matrix);
NEWTON_API void NewtonConvexCollisionSetUserID (const NewtonCollision* convexCollision, unsigned id);
NEWTON_API unsigned NewtonConvexCollisionGetUserID (const NewtonCollision* convexCollision);
NEWTON_API dFloat NewtonConvexCollisionCalculateVolume (const NewtonCollision* convexCollision);
NEWTON_API void NewtonConvexCollisionCalculateInertialMatrix (const NewtonCollision* convexCollision, dFloat* inertia, dFloat* origin);
NEWTON_API void NewtonCollisionMakeUnique (const NewtonWorld* newtonWorld, const NewtonCollision* collision);
NEWTON_API void NewtonReleaseCollision (const NewtonWorld* newtonWorld, const NewtonCollision* collision);
// **********************************************************************************************
//
// complex collision primitives creation functions
// note: can only be used with static bodies (bodies with infinite mass)
//
// **********************************************************************************************
NEWTON_API NewtonCollision* NewtonCreateCompoundCollision (const NewtonWorld* newtonWorld, int count,
NewtonCollision* const collisionPrimitiveArray[]);
NEWTON_API NewtonCollision* NewtonCreateUserMeshCollision (const NewtonWorld* newtonWorld, const dFloat *minBox,
const dFloat *maxBox, void *userData, NewtonUserMeshCollisionCollideCallback collideCallback,
NewtonUserMeshCollisionRayHitCallback rayHitCallback, NewtonUserMeshCollisionDestroyCallback destroyCallback);
// **********************************************************************************************
//
// CollisionTree Utility functions
//
// **********************************************************************************************
NEWTON_API NewtonCollision* NewtonCreateTreeCollision (const NewtonWorld* newtonWorld, NewtonTreeCollisionCallback userCallback);
NEWTON_API void NewtonTreeCollisionBeginBuild (const NewtonCollision* treeCollision);
NEWTON_API void NewtonTreeCollisionAddFace (const NewtonCollision* treeCollision, int vertexCount, const dFloat* vertexPtr,
int strideInBytes, int faceAttribute);
NEWTON_API void NewtonTreeCollisionEndBuild (const NewtonCollision* treeCollision, int optimize);
NEWTON_API void NewtonTreeCollisionSerialize (const NewtonCollision* treeCollision, NewtonSerialize serializeFunction,
void* serializeHandle);
NEWTON_API NewtonCollision* NewtonCreateTreeCollisionFromSerialization (const NewtonWorld* newtonWorld,
NewtonTreeCollisionCallback userCallback, NewtonDeserialize deserializeFunction, void* serializeHandle);
NEWTON_API int NewtonTreeCollisionGetFaceAtribute (const NewtonCollision* treeCollision, const int* faceIndexArray);
NEWTON_API void NewtonTreeCollisionSetFaceAtribute (const NewtonCollision* treeCollision, const int* faceIndexArray,
int attribute);
// **********************************************************************************************
//
// General purpose collision library functions
//
// **********************************************************************************************
NEWTON_API int NewtonCollisionPointDistance (const NewtonWorld* newtonWorld, const dFloat *point,
const NewtonCollision* collsion, const dFloat* matrix, dFloat* contact, dFloat* normal);
NEWTON_API int NewtonCollisionClosestPoint (const NewtonWorld* newtonWorld,
const NewtonCollision* collsionA, const dFloat* matrixA, const NewtonCollision* collsionB, const dFloat* matrixB,
dFloat* contactA, dFloat* contactB, dFloat* normalAB);
NEWTON_API int NewtonCollisionCollide (const NewtonWorld* newtonWorld, int maxSize,
const NewtonCollision* collsionA, const dFloat* matrixA, const NewtonCollision* collsionB, const dFloat* matrixB,
dFloat* contacts, dFloat* normals, dFloat* penetration);
NEWTON_API int NewtonCollisionCollideContinue (const NewtonWorld* newtonWorld, int maxSize, const dFloat timestap,
const NewtonCollision* collsionA, const dFloat* matrixA, const dFloat* velocA, const dFloat* omegaA,
const NewtonCollision* collsionB, const dFloat* matrixB, const dFloat* velocB, const dFloat* omegaB,
dFloat* timeOfImpact, dFloat* contacts, dFloat* normals, dFloat* penetration);
NEWTON_API dFloat NewtonCollisionRayCast (const NewtonCollision* collision, const dFloat* p0, const dFloat* p1, dFloat* normals, int* attribute);
NEWTON_API void NewtonCollisionCalculateAABB (const NewtonCollision* collision, const dFloat *matrix, dFloat* p0, dFloat* p1);
// **********************************************************************************************
//
// transforms utility functions
//
// **********************************************************************************************
NEWTON_API void NewtonGetEulerAngle (const dFloat* matrix, dFloat* eulersAngles);
NEWTON_API void NewtonSetEulerAngle (const dFloat* eulersAngles, dFloat* matrix);
// **********************************************************************************************
//
// body manipulation functions
//
// **********************************************************************************************
NEWTON_API NewtonBody* NewtonCreateBody (const NewtonWorld* newtonWorld, const NewtonCollision* collision);
NEWTON_API void NewtonDestroyBody(const NewtonWorld* newtonWorld, const NewtonBody* body);
NEWTON_API void NewtonBodyAddForce (const NewtonBody* body, const dFloat* force);
NEWTON_API void NewtonBodyAddTorque (const NewtonBody* body, const dFloat* torque);
NEWTON_API void NewtonBodySetMatrix (const NewtonBody* body, const dFloat* matrix);
NEWTON_API void NewtonBodySetMatrixRecursive (const NewtonBody* body, const dFloat* matrix);
NEWTON_API void NewtonBodySetMassMatrix (const NewtonBody* body, dFloat mass, dFloat Ixx, dFloat Iyy, dFloat Izz);
NEWTON_API void NewtonBodySetMaterialGroupID (const NewtonBody* body, int id);
NEWTON_API void NewtonBodySetContinuousCollisionMode (const NewtonBody* body, unsigned state);
NEWTON_API void NewtonBodySetJointRecursiveCollision (const NewtonBody* body, unsigned state);
NEWTON_API void NewtonBodySetOmega (const NewtonBody* body, const dFloat* omega);
NEWTON_API void NewtonBodySetVelocity (const NewtonBody* body, const dFloat* velocity);
NEWTON_API void NewtonBodySetForce (const NewtonBody* body, const dFloat* force);
NEWTON_API void NewtonBodySetTorque (const NewtonBody* body, const dFloat* torque);
NEWTON_API void NewtonBodySetCentreOfMass (const NewtonBody* body, const dFloat* com);
NEWTON_API void NewtonBodySetLinearDamping (const NewtonBody* body, dFloat linearDamp);
NEWTON_API void NewtonBodySetAngularDamping (const NewtonBody* body, const dFloat* angularDamp);
NEWTON_API void NewtonBodySetUserData (const NewtonBody* body, void* userData);
NEWTON_API void NewtonBodyCoriolisForcesMode (const NewtonBody* body, int mode);
NEWTON_API void NewtonBodySetCollision (const NewtonBody* body, const NewtonCollision* collision);
NEWTON_API void NewtonBodySetAutoFreeze (const NewtonBody* body, int state);
NEWTON_API void NewtonBodySetFreezeTreshold (const NewtonBody* body, dFloat freezeSpeed2, dFloat freezeOmega2, int framesCount);
NEWTON_API void NewtonBodySetTransformCallback (const NewtonBody* body, NewtonSetTransform callback);
NEWTON_API void NewtonBodySetDestructorCallback (const NewtonBody* body, NewtonBodyDestructor callback);
NEWTON_API void NewtonBodySetAutoactiveCallback (const NewtonBody* body, NewtonBodyActivationState callback);
NEWTON_API void NewtonBodySetForceAndTorqueCallback (const NewtonBody* body, NewtonApplyForceAndTorque callback);
NEWTON_API NewtonApplyForceAndTorque NewtonBodyGetForceAndTorqueCallback (const NewtonBody* body);
NEWTON_API void* NewtonBodyGetUserData (const NewtonBody* body);
NEWTON_API NewtonWorld* NewtonBodyGetWorld (const NewtonBody* body);
NEWTON_API NewtonCollision* NewtonBodyGetCollision (const NewtonBody* body);
NEWTON_API int NewtonBodyGetMaterialGroupID (const NewtonBody* body);
NEWTON_API int NewtonBodyGetContinuousCollisionMode (const NewtonBody* body);
NEWTON_API int NewtonBodyGetJointRecursiveCollision (const NewtonBody* body);
NEWTON_API void NewtonBodyGetMatrix(const NewtonBody* body, dFloat* matrix);
NEWTON_API void NewtonBodyGetMassMatrix (const NewtonBody* body, dFloat* mass, dFloat* Ixx, dFloat* Iyy, dFloat* Izz);
NEWTON_API void NewtonBodyGetInvMass(const NewtonBody* body, dFloat* invMass, dFloat* invIxx, dFloat* invIyy, dFloat* invIzz);
NEWTON_API void NewtonBodyGetOmega(const NewtonBody* body, dFloat* vector);
NEWTON_API void NewtonBodyGetVelocity(const NewtonBody* body, dFloat* vector);
NEWTON_API void NewtonBodyGetForce(const NewtonBody* body, dFloat* vector);
NEWTON_API void NewtonBodyGetTorque(const NewtonBody* body, dFloat* vector);
NEWTON_API void NewtonBodyGetCentreOfMass (const NewtonBody* body, dFloat* com);
NEWTON_API int NewtonBodyGetSleepingState(const NewtonBody* body);
NEWTON_API int NewtonBodyGetAutoFreeze(const NewtonBody* body);
NEWTON_API dFloat NewtonBodyGetLinearDamping (const NewtonBody* body);
NEWTON_API void NewtonBodyGetAngularDamping (const NewtonBody* body, dFloat* vector);
NEWTON_API void NewtonBodyGetAABB (const NewtonBody* body, dFloat* p0, dFloat* p1);
NEWTON_API void NewtonBodyGetFreezeTreshold (const NewtonBody* body, dFloat* freezeSpeed2, dFloat* freezeOmega2);
NEWTON_API void NewtonBodyAddBuoyancyForce (const NewtonBody* body, dFloat fluidDensity,
dFloat fluidLinearViscosity, dFloat fluidAngularViscosity,
const dFloat* gravityVector, NewtonGetBuoyancyPlane buoyancyPlane, void *context);
NEWTON_API void NewtonBodyForEachPolygonDo (const NewtonBody* body, NewtonCollisionIterator callback);
NEWTON_API void NewtonAddBodyImpulse (const NewtonBody* body, const dFloat* pointDeltaVeloc, const dFloat* pointPosit);
// **********************************************************************************************
//
// Common joint functions
//
// **********************************************************************************************
NEWTON_API void* NewtonJointGetUserData (const NewtonJoint* joint);
NEWTON_API void NewtonJointSetUserData (const NewtonJoint* joint, void* userData);
NEWTON_API int NewtonJointGetCollisionState (const NewtonJoint* joint);
NEWTON_API void NewtonJointSetCollisionState (const NewtonJoint* joint, int state);
NEWTON_API dFloat NewtonJointGetStiffness (const NewtonJoint* joint);
NEWTON_API void NewtonJointSetStiffness (const NewtonJoint* joint, dFloat state);
NEWTON_API void NewtonDestroyJoint(const NewtonWorld* newtonWorld, const NewtonJoint* joint);
NEWTON_API void NewtonJointSetDestructor (const NewtonJoint* joint, NewtonConstraintDestructor destructor);
// **********************************************************************************************
//
// Ball and Socket joint functions
//
// **********************************************************************************************
NEWTON_API NewtonJoint* NewtonConstraintCreateBall (const NewtonWorld* newtonWorld, const dFloat* pivotPoint,
const NewtonBody* childBody, const NewtonBody* parentBody);
NEWTON_API void NewtonBallSetUserCallback (const NewtonJoint* ball, NewtonBallCallBack callback);
NEWTON_API void NewtonBallGetJointAngle (const NewtonJoint* ball, dFloat* angle);
NEWTON_API void NewtonBallGetJointOmega (const NewtonJoint* ball, dFloat* omega);
NEWTON_API void NewtonBallGetJointForce (const NewtonJoint* ball, dFloat* force);
NEWTON_API void NewtonBallSetConeLimits (const NewtonJoint* ball, const dFloat* pin, dFloat maxConeAngle, dFloat maxTwistAngle);
// **********************************************************************************************
//
// Hinge joint functions
//
// **********************************************************************************************
NEWTON_API NewtonJoint* NewtonConstraintCreateHinge (const NewtonWorld* newtonWorld,
const dFloat* pivotPoint, const dFloat* pinDir,
const NewtonBody* childBody, const NewtonBody* parentBody);
NEWTON_API void NewtonHingeSetUserCallback (const NewtonJoint* hinge, NewtonHingeCallBack callback);
NEWTON_API dFloat NewtonHingeGetJointAngle (const NewtonJoint* hinge);
NEWTON_API dFloat NewtonHingeGetJointOmega (const NewtonJoint* hinge);
NEWTON_API void NewtonHingeGetJointForce (const NewtonJoint* hinge, dFloat* force);
NEWTON_API dFloat NewtonHingeCalculateStopAlpha (const NewtonJoint* hinge, const NewtonHingeSliderUpdateDesc* desc, dFloat angle);
// **********************************************************************************************
//
// Slider joint functions
//
// **********************************************************************************************
NEWTON_API NewtonJoint* NewtonConstraintCreateSlider (const NewtonWorld* newtonWorld,
const dFloat* pivotPoint, const dFloat* pinDir,
const NewtonBody* childBody, const NewtonBody* parentBody);
NEWTON_API void NewtonSliderSetUserCallback (const NewtonJoint* slider, NewtonSliderCallBack callback);
NEWTON_API dFloat NewtonSliderGetJointPosit (const NewtonJoint* slider);
NEWTON_API dFloat NewtonSliderGetJointVeloc (const NewtonJoint* slider);
NEWTON_API void NewtonSliderGetJointForce (const NewtonJoint* slider, dFloat* force);
NEWTON_API dFloat NewtonSliderCalculateStopAccel (const NewtonJoint* slider, const NewtonHingeSliderUpdateDesc* desc, dFloat position);
// **********************************************************************************************
//
// Corkscrew joint functions
//
// **********************************************************************************************
NEWTON_API NewtonJoint* NewtonConstraintCreateCorkscrew (const NewtonWorld* newtonWorld,
const dFloat* pivotPoint, const dFloat* pinDir,
const NewtonBody* childBody, const NewtonBody* parentBody);
NEWTON_API void NewtonCorkscrewSetUserCallback (const NewtonJoint* corkscrew, NewtonCorkscrewCallBack callback);
NEWTON_API dFloat NewtonCorkscrewGetJointPosit (const NewtonJoint* corkscrew);
NEWTON_API dFloat NewtonCorkscrewGetJointAngle (const NewtonJoint* corkscrew);
NEWTON_API dFloat NewtonCorkscrewGetJointVeloc (const NewtonJoint* corkscrew);
NEWTON_API dFloat NewtonCorkscrewGetJointOmega (const NewtonJoint* corkscrew);
NEWTON_API void NewtonCorkscrewGetJointForce (const NewtonJoint* corkscrew, dFloat* force);
NEWTON_API dFloat NewtonCorkscrewCalculateStopAlpha (const NewtonJoint* corkscrew, const NewtonHingeSliderUpdateDesc* desc, dFloat angle);
NEWTON_API dFloat NewtonCorkscrewCalculateStopAccel (const NewtonJoint* corkscrew, const NewtonHingeSliderUpdateDesc* desc, dFloat position);
// **********************************************************************************************
//
// Universal joint functions
//
// **********************************************************************************************
NEWTON_API NewtonJoint* NewtonConstraintCreateUniversal (const NewtonWorld* newtonWorld,
const dFloat* pivotPoint, const dFloat* pinDir0, const dFloat* pinDir1,
const NewtonBody* childBody, const NewtonBody* parentBody);
NEWTON_API void NewtonUniversalSetUserCallback (const NewtonJoint* universal, NewtonUniversalCallBack callback);
NEWTON_API dFloat NewtonUniversalGetJointAngle0 (const NewtonJoint* universal);
NEWTON_API dFloat NewtonUniversalGetJointAngle1 (const NewtonJoint* universal);
NEWTON_API dFloat NewtonUniversalGetJointOmega0 (const NewtonJoint* universal);
NEWTON_API dFloat NewtonUniversalGetJointOmega1 (const NewtonJoint* universal);
NEWTON_API void NewtonUniversalGetJointForce (const NewtonJoint* universal, dFloat* force);
NEWTON_API dFloat NewtonUniversalCalculateStopAlpha0 (const NewtonJoint* universal, const NewtonHingeSliderUpdateDesc* desc, dFloat angle);
NEWTON_API dFloat NewtonUniversalCalculateStopAlpha1 (const NewtonJoint* universal, const NewtonHingeSliderUpdateDesc* desc, dFloat angle);
// **********************************************************************************************
//
// Up vector joint functions
//
// **********************************************************************************************
NEWTON_API NewtonJoint* NewtonConstraintCreateUpVector (const NewtonWorld* newtonWorld, const dFloat* pinDir, const NewtonBody* body);
NEWTON_API void NewtonUpVectorGetPin (const NewtonJoint* upVector, dFloat *pin);
NEWTON_API void NewtonUpVectorSetPin (const NewtonJoint* upVector, const dFloat *pin);
// **********************************************************************************************
//
// User defined bilateral Joint
//
// **********************************************************************************************
NEWTON_API NewtonJoint* NewtonConstraintCreateUserJoint (const NewtonWorld* newtonWorld, int maxDOF, NewtonUserBilateralCallBack callback,
const NewtonBody* childBody, const NewtonBody* parentBody);
NEWTON_API void NewtonUserJointAddLinearRow (const NewtonJoint* joint, const dFloat *pivot0, const dFloat *pivot1, const dFloat *dir);
NEWTON_API void NewtonUserJointAddAngularRow (const NewtonJoint* joint, dFloat relativeAngle, const dFloat *dir);
NEWTON_API void NewtonUserJointAddGeneralRow (const NewtonJoint* joint, const dFloat *jacobian0, const dFloat *jacobian1);
NEWTON_API void NewtonUserJointSetRowMinimumFriction (const NewtonJoint* joint, dFloat friction);
NEWTON_API void NewtonUserJointSetRowMaximumFriction (const NewtonJoint* joint, dFloat friction);
NEWTON_API void NewtonUserJointSetRowAcceleration (const NewtonJoint* joint, dFloat acceleration);
NEWTON_API void NewtonUserJointSetRowSpringDamperAcceleration (const NewtonJoint* joint, dFloat springK, dFloat springD);
NEWTON_API void NewtonUserJointSetRowStiffness (const NewtonJoint* joint, dFloat stiffness);
NEWTON_API dFloat NewtonUserJointGetRowForce (const NewtonJoint* joint, int row);
// **********************************************************************************************
//
// Rag doll joint container functions
//
// **********************************************************************************************
NEWTON_API NewtonRagDoll* NewtonCreateRagDoll (const NewtonWorld* newtonWorld);
NEWTON_API void NewtonDestroyRagDoll (const NewtonWorld* newtonWorld, const NewtonRagDoll* ragDoll);
NEWTON_API void NewtonRagDollBegin (const NewtonRagDoll* ragDoll);
NEWTON_API void NewtonRagDollEnd (const NewtonRagDoll* ragDoll);
//NEWTON_API void NewtonRagDollSetFriction (const NewtonRagDoll* ragDoll, dFloat friction);
NEWTON_API NewtonRagDollBone* NewtonRagDollFindBone (const NewtonRagDoll* ragDoll, int id);
//NEWTON_API NewtonRagDollBone* NewtonRagDollGetRootBone (const NewtonRagDoll* ragDoll);
NEWTON_API void NewtonRagDollSetForceAndTorqueCallback (const NewtonRagDoll* ragDoll, NewtonApplyForceAndTorque callback);
NEWTON_API void NewtonRagDollSetTransformCallback (const NewtonRagDoll* ragDoll, NewtonSetRagDollTransform callback);
NEWTON_API NewtonRagDollBone* NewtonRagDollAddBone (const NewtonRagDoll* ragDoll, const NewtonRagDollBone* parent,
void *userData, dFloat mass, const dFloat* matrix,
const NewtonCollision* boneCollision, const dFloat* size);
NEWTON_API void* NewtonRagDollBoneGetUserData (const NewtonRagDollBone* bone);
NEWTON_API NewtonBody* NewtonRagDollBoneGetBody (const NewtonRagDollBone* bone);
NEWTON_API void NewtonRagDollBoneSetID (const NewtonRagDollBone* bone, int id);
NEWTON_API void NewtonRagDollBoneSetLimits (const NewtonRagDollBone* bone,
const dFloat* coneDir, dFloat minConeAngle, dFloat maxConeAngle, dFloat maxTwistAngle,
const dFloat* bilateralConeDir, dFloat negativeBilateralConeAngle, dFloat positiveBilateralConeAngle);
//NEWTON_API NewtonRagDollBone* NewtonRagDollBoneGetChild (const NewtonRagDollBone* bone);
//NEWTON_API NewtonRagDollBone* NewtonRagDollBoneGetSibling (const NewtonRagDollBone* bone);
//NEWTON_API NewtonRagDollBone* NewtonRagDollBoneGetParent (const NewtonRagDollBone* bone);
//NEWTON_API void NewtonRagDollBoneSetLocalMatrix (const NewtonRagDollBone* bone, dFloat* matrix);
//NEWTON_API void NewtonRagDollBoneSetGlobalMatrix (const NewtonRagDollBone* bone, dFloat* matrix);
NEWTON_API void NewtonRagDollBoneGetLocalMatrix (const NewtonRagDollBone* bone, dFloat* matrix);
NEWTON_API void NewtonRagDollBoneGetGlobalMatrix (const NewtonRagDollBone* bone, dFloat* matrix);
// **********************************************************************************************
//
// Vehicle joint functions
//
// **********************************************************************************************
NEWTON_API NewtonJoint* NewtonConstraintCreateVehicle (const NewtonWorld* newtonWorld, const dFloat* upDir, const NewtonBody* body);
NEWTON_API void NewtonVehicleReset (const NewtonJoint* vehicle);
NEWTON_API void NewtonVehicleSetTireCallback (const NewtonJoint* vehicle, NewtonVehicleTireUpdate update);
NEWTON_API void* NewtonVehicleAddTire (const NewtonJoint* vehicle, const dFloat* localMatrix, const dFloat* pin, dFloat mass, dFloat width, dFloat radius,
dFloat suspesionShock, dFloat suspesionSpring, dFloat suspesionLength, void* userData, int collisionID);
NEWTON_API void NewtonVehicleRemoveTire (const NewtonJoint* vehicle, void* tireId);
NEWTON_API void* NewtonVehicleGetFirstTireID (const NewtonJoint* vehicle);
NEWTON_API void* NewtonVehicleGetNextTireID (const NewtonJoint* vehicle, void* tireId);
NEWTON_API int NewtonVehicleTireIsAirBorne (const NewtonJoint* vehicle, void* tireId);
NEWTON_API int NewtonVehicleTireLostSideGrip (const NewtonJoint* vehicle, void* tireId);
NEWTON_API int NewtonVehicleTireLostTraction (const NewtonJoint* vehicle, void* tireId);
NEWTON_API void* NewtonVehicleGetTireUserData (const NewtonJoint* vehicle, void* tireId);
NEWTON_API dFloat NewtonVehicleGetTireOmega (const NewtonJoint* vehicle, void* tireId);
NEWTON_API dFloat NewtonVehicleGetTireNormalLoad (const NewtonJoint* vehicle, void* tireId);
NEWTON_API dFloat NewtonVehicleGetTireSteerAngle (const NewtonJoint* vehicle, void* tireId);
NEWTON_API dFloat NewtonVehicleGetTireLateralSpeed (const NewtonJoint* vehicle, void* tireId);
NEWTON_API dFloat NewtonVehicleGetTireLongitudinalSpeed (const NewtonJoint* vehicle, void* tireId);
NEWTON_API void NewtonVehicleGetTireMatrix (const NewtonJoint* vehicle, void* tireId, dFloat* matrix);
NEWTON_API void NewtonVehicleSetTireTorque (const NewtonJoint* vehicle, void* tireId, dFloat torque);
NEWTON_API void NewtonVehicleSetTireSteerAngle (const NewtonJoint* vehicle, void* tireId, dFloat angle);
NEWTON_API void NewtonVehicleSetTireMaxSideSleepSpeed (const NewtonJoint* vehicle, void* tireId, dFloat speed);
NEWTON_API void NewtonVehicleSetTireSideSleepCoeficient (const NewtonJoint* vehicle, void* tireId, dFloat coeficient);
NEWTON_API void NewtonVehicleSetTireMaxLongitudinalSlideSpeed (const NewtonJoint* vehicle, void* tireId, dFloat speed);
NEWTON_API void NewtonVehicleSetTireLongitudinalSlideCoeficient (const NewtonJoint* vehicle, void* tireId, dFloat coeficient);
NEWTON_API dFloat NewtonVehicleTireCalculateMaxBrakeAcceleration (const NewtonJoint* vehicle, void* tireId);
NEWTON_API void NewtonVehicleTireSetBrakeAcceleration (const NewtonJoint* vehicle, void* tireId, dFloat accelaration, dFloat torqueLimit);
#ifdef __cplusplus
}
#endif
#endif
Unstable Version/1.3.3/README
1
2
3
4
5
6
7
8
9
10
11
12
13
Irrlicht Library Wrapper
Created by Nathan Adams
Version 1.3.3
Copyright (C) 2008
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
Please leave all files intact if you redistrubte this software.
How to use:
Add all the files to your Irrlicht project, you could compile it into a DLL if you wanted too, but for now just add all the files to your project.
Then inside your complier add the directory that you have the IrrLib files and use #include "IrrLib.h" to refrence it, and you are good to go!
Unstable Version/1.3.3/_mouse.h
1
2
3
4
5
6
7
8
9
#ifndef __MOUSE_H
#define __MOUSE_H
struct _mouse {
int x;
int y;
};
#endif
Unstable Version/1.3.3/dList.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
//********************************************************************
// Newton Game dynamics
// copyright 2000-2004
// By Julio Jerez
// VC: 6.0
// simple demo list vector class with iterators
//********************************************************************
#ifndef __dList__
#define __dList__
#include <stdafx.h>
// this is a small double link list contatiner similar to STL,
// it is used to probody low level support for this demos.
// it implements a iterators, and all the basics operation on list found on the SDL class
template<class T>
class dList
{
public:
class dListNode
{
friend class dList<T>;
dListNode *m_next;
dListNode *m_prev;
T m_info;
dListNode (dListNode *prev, dListNode *next)
:m_info ()
{
m_prev = prev;
m_next = next;
if (m_prev) {
m_prev->m_next = this;
}
if (m_next) {
m_next->m_prev = this;
}
}
dListNode (const T &info, dListNode *prev, dListNode *next)
:m_info (info)
{
m_prev = prev;
m_next = next;
if (m_prev) {
m_prev->m_next = this;
}
if (m_next) {
m_next->m_prev = this;
}
}
~dListNode()
{
}
void Unlink ()
{
if (m_prev) {
m_prev->m_next = m_next;
}
if (m_next) {
m_next->m_prev = m_prev;
}
m_prev = NULL;
m_next = NULL;
}
void Remove()
{
Unlink();
delete this;
}
void AddLast(dListNode *node)
{
m_next = node;
node->m_prev = this;
}
void AddFirst(dListNode *node)
{
m_prev = node;
node->m_next = this;
}
void *operator new (size_t size)
{
return malloc(size);
}
void operator delete (void *ptr)
{
free(ptr);
}
public:
T& GetInfo()
{
return m_info;
}
dListNode *GetNext() const
{
return m_next;
}
dListNode *GetPrev() const
{
return m_prev;
}
};
class Iterator
{
dListNode *m_ptr;
dList *m_list;
public:
Iterator (const dList<T> &me)
{
m_ptr = NULL;
m_list = (dList *)&me;
}
~Iterator ()
{
}
operator int() const
{
return m_ptr != NULL;
}
bool operator== (const Iterator &target) const
{
return (m_ptr == target.m_ptr) && (m_list == target.m_list);
}
void Begin()
{
m_ptr = m_list->GetFirst();
}
void End()
{
m_ptr = m_list->GetLast();
}
void Set (dListNode *node)
{
m_ptr = node;
}
void operator++ ()
{
m_ptr = m_ptr->m_next();
}
void operator++ (int)
{
m_ptr = m_ptr->GetNext();
}
void operator-- ()
{
m_ptr = m_ptr->GetPrev();
}
void operator-- (int)
{
m_ptr = m_ptr->GetPrev();
}
T &operator* () const
{
return m_ptr->GetInfo();
}
dListNode *GetNode() const
{
return m_ptr;
}
};
// ***********************************************************
// member functions
// ***********************************************************
public:
dList ();
~dList ();
void* operator new (size_t size);
void operator delete (void *ptr);
operator int() const;
int GetCount() const;
dListNode *GetLast() const;
dListNode *GetFirst() const;
void Append ();
void Append (dListNode *node);
void Append (const T &element);
void Addtop ();
void Addtop (dListNode *node);
void Addtop (const T &element);
void RotateToEnd (dListNode *node);
void RotateToBegin (dListNode *node);
void InsertAfter (dListNode *root, dListNode *node);
dListNode *Find (const T &element) const;
dListNode *GetNodeFromInfo (T &m_info) const;
void Remove (dListNode *node);
void Remove (const T &element);
void RemoveAll ();
// ***********************************************************
// member variables
// ***********************************************************
private:
int m_count;
dListNode *m_last;
dListNode *m_first;
friend class dListNode;
};
template<class T>
dList<T>::dList ()
{
m_count = 0;
m_first = NULL;
m_last = NULL;
}
template<class T>
dList<T>::~dList ()
{
RemoveAll ();
}
template<class T>
void* dList<T>::operator new (size_t size)
{
return malloc (size);
}
template<class T>
void dList<T>::operator delete (void *ptr)
{
free (ptr);
}
template<class T>
int dList<T>::GetCount() const
{
return m_count;
}
template<class T>
dList<T>::operator int() const
{
return m_first != NULL;
}
template<class T>
typename dList<T>::dListNode *dList<T>::GetFirst() const
{
return m_first;
}
template<class T>
typename dList<T>::dListNode *dList<T>::GetLast() const
{
return m_last;
}
template<class T>
void dList<T>::Append (dListNode *node)
{
m_count++;
if (m_first == NULL) {
m_last = node;
m_first = node;
} else {
m_last->AddLast (node);
m_last = node;
}
node->AddRef();
node->Unkill();
}
template<class T>
void dList<T>::Append ()
{
m_count++;
if (m_first == NULL) {
m_first = new dListNode(NULL, NULL);
m_last = m_first;
} else {
m_last = new dListNode(m_last, NULL);
}
}
template<class T>
void dList<T>::Append (const T &element)
{
m_count++;
if (m_first == NULL) {
m_first = new dListNode(element, NULL, NULL);
m_last = m_first;
} else {
m_last = new dListNode(element, m_last, NULL);
}
}
template<class T>
void dList<T>::Addtop (dListNode *node)
{
m_count++;
if (m_last == NULL) {
m_last = node;
m_first = node;
} else {
m_first->AddFirst(node);
m_first = node;
}
node->AddRef();
node->Unkill();
}
template<class T>
void dList<T>::Addtop ()
{
m_count++;
if (m_last == NULL) {
m_last = new dListNode(NULL, NULL);
m_first = m_last;
} else {
m_first = new dListNode(NULL, m_first);
}
}
template<class T>
void dList<T>::Addtop (const T &element)
{
m_count++;
if (m_last == NULL) {
m_last = new dListNode(element, NULL, NULL);
m_first = m_last;
} else {
m_first = new dListNode(element, NULL, m_first);
}
}
template<class T>
void dList<T>::InsertAfter (dListNode *root, dListNode *node)
{
node->m_prev = root;
node->m_next = root->m_next;
if (root->m_next) {
root->m_next->m_prev = node;
}
root->m_next = node;
if (root == m_last) {
m_last = node;
}
}
template<class T>
void dList<T>::RotateToEnd (dListNode *node)
{
if (node != m_last) {
if (m_last != m_first) {
if (node == m_first) {
m_first = m_first->GetNext();
}
node->Unlink();
m_last->AddLast(node);
m_last = node;
}
}
}
template<class T>
void dList<T>::RotateToBegin (dListNode *node)
{
if (node != m_first) {
if (m_last != m_first) {
if (node == m_last) {
m_last = m_last->GetPrev();
}
node->Unlink();
m_first->AddFirst(node);
m_first = node;
}
}
}
template<class T>
typename dList<T>::dListNode *dList<T>::Find (const T &element) const
{
dListNode *node;
for (node = m_first; node; node = node->GetNext()) {
if (element== node->m_info) {
break;
}
}
return node;
}
/*
template<class T>
typename dList<T>::dListNode *dList<T>::GetNodeFromInfo (T &info) const
{
dListNode *ptr;
dgUnsigned64 offset;
ptr = (dListNode *) &info;
offset = dgUnsigned64 (&ptr->m_info) - dgUnsigned64 (ptr);
ptr = (dListNode *) (dgUnsigned64 (&info) - offset);
return ptr;
}
*/
template<class T>
void dList<T>::Remove (const T &element)
{
dListNode *node;
node = Find (element);
if (node) {
Remove (node);
}
}
template<class T>
void dList<T>::Remove (dListNode *node)
{
m_count --;
if (node == m_first) {
m_first = m_first->GetNext();
}
if (node == m_last) {
m_last = m_last->GetPrev();
}
node->Remove();
}
template<class T>
void dList<T>::RemoveAll ()
{
dListNode *node;
for (node = m_first; node; node = m_first) {
m_count --;
m_first = node->GetNext();
node->Remove();
}
m_last = NULL;
m_first = NULL;
}
#endif
Unstable Version/1.3.3/dMatrix.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
//********************************************************************
// Newton Game dynamics
// copyright 2000
// By Julio Jerez
// VC: 6.0
// simple 4d matrix class
//********************************************************************
#include <stdafx.h>
#include <dMatrix.h>
#include <dQuaternion.h>
dMatrix::dMatrix (const dQuaternion &rotation, const dVector &position)
{
dFloat x2;
dFloat y2;
dFloat z2;
dFloat w2;
dFloat xy;
dFloat xz;
dFloat xw;
dFloat yz;
dFloat yw;
dFloat zw;
w2 = dFloat (2.0f) * rotation.m_q0 * rotation.m_q0;
x2 = dFloat (2.0f) * rotation.m_q1 * rotation.m_q1;
y2 = dFloat (2.0f) * rotation.m_q2 * rotation.m_q2;
z2 = dFloat (2.0f) * rotation.m_q3 * rotation.m_q3;
_ASSERTE (dAbs (w2 + x2 + y2 + z2 - dFloat(2.0f)) < dFloat (1.5e-4f));
xy = dFloat (2.0f) * rotation.m_q1 * rotation.m_q2;
xz = dFloat (2.0f) * rotation.m_q1 * rotation.m_q3;
xw = dFloat (2.0f) * rotation.m_q1 * rotation.m_q0;
yz = dFloat (2.0f) * rotation.m_q2 * rotation.m_q3;
yw = dFloat (2.0f) * rotation.m_q2 * rotation.m_q0;
zw = dFloat (2.0f) * rotation.m_q3 * rotation.m_q0;
m_front = dVector (w2 + x2 - dFloat(1.0f), xy + zw, xz - yw , dFloat(0.0f));
m_up = dVector (xy - zw, w2 + y2 - dFloat(1.0f), yz + xw , dFloat(0.0f));
m_right = dVector (xz + yw, yz - xw, w2 + z2 - dFloat(1.0f), dFloat(0.0f));
m_posit.m_x = position.m_x;
m_posit.m_y = position.m_y;
m_posit.m_z = position.m_z;
m_posit.m_w = dFloat(1.0f);
}
Unstable Version/1.3.3/dMatrix.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
//********************************************************************
// Newton Game dynamics
// copyright 2000
// By Julio Jerez
// VC: 6.0
// simple 4d matrix class
//********************************************************************
#ifndef __dMatrix__
#define __dMatrix__
#include <Newton.h>
#include <stdafx.h>
#include <dVector.h>
class dQuaternion;
// small but fully operational 4x4 matrix class
class dQuaternion;
class dMatrix
{
public:
dMatrix ();
dMatrix (const dVector &front, const dVector &up, const dVector &right, const dVector &posit);
dMatrix (const dQuaternion &rotation, const dVector &position);
dVector& operator[] (int i);
const dVector& operator[] (int i) const;
dMatrix Inverse () const;
dMatrix Transpose () const;
dMatrix Transpose4X4 () const;
dVector RotateVector (const dVector &v) const;
dVector UnrotateVector (const dVector &v) const;
dVector TransformVector (const dVector &v) const;
dVector UntransformVector (const dVector &v) const;
void TransformTriplex (void* const dst, int dstStrideInBytes,
void* const src, int srcStrideInBytes, int count) const;
dMatrix operator* (const dMatrix &B) const;
dVector m_front;
dVector m_up;
dVector m_right;
dVector m_posit;
};
inline dMatrix GetIdentityMatrix()
{
return dMatrix (dVector (1.0f, 0.0f, 0.0f, 0.0f),
dVector (0.0f, 1.0f, 0.0f, 0.0f),
dVector (0.0f, 0.0f, 1.0f, 0.0f),
dVector (0.0f, 0.0f, 0.0f, 1.0f));
}
inline dMatrix GetZeroMatrix ()
{
return dMatrix (dVector (0.0f, 0.0f, 0.0f, 0.0f),
dVector (0.0f, 0.0f, 0.0f, 0.0f),
dVector (0.0f, 0.0f, 0.0f, 0.0f),
dVector (0.0f, 0.0f, 0.0f, 0.0f));
}
inline dMatrix::dMatrix ()
{
}
inline dMatrix::dMatrix (
const dVector &front,
const dVector &up,
const dVector &right,
const dVector &posit)
:m_front (front), m_up(up), m_right(right), m_posit(posit)
{
}
inline dVector& dMatrix::operator[] (int i)
{
return (&m_front)[i];
}
inline const dVector& dMatrix::operator[] (int i) const
{
return (&m_front)[i];
}
inline dMatrix dMatrix::Inverse () const
{
return dMatrix (dVector (m_front.m_x, m_up.m_x, m_right.m_x, 0.0f),
dVector (m_front.m_y, m_up.m_y, m_right.m_y, 0.0f),
dVector (m_front.m_z, m_up.m_z, m_right.m_z, 0.0f),
dVector (- (m_posit % m_front), - (m_posit % m_up), - (m_posit % m_right), 1.0f));
}
inline dMatrix dMatrix::Transpose () const
{
return dMatrix (dVector (m_front.m_x, m_up.m_x, m_right.m_x, 0.0f),
dVector (m_front.m_y, m_up.m_y, m_right.m_y, 0.0f),
dVector (m_front.m_z, m_up.m_z, m_right.m_z, 0.0f),
dVector (0.0f, 0.0f, 0.0f, 1.0f));
}
inline dMatrix dMatrix::Transpose4X4 () const
{
return dMatrix (dVector (m_front.m_x, m_up.m_x, m_right.m_x, m_posit.m_x),
dVector (m_front.m_y, m_up.m_y, m_right.m_y, m_posit.m_y),
dVector (m_front.m_z, m_up.m_z, m_right.m_z, m_posit.m_z),
dVector (m_front.m_w, m_up.m_w, m_right.m_w, m_posit.m_w));
}
inline dVector dMatrix::RotateVector (const dVector &v) const
{
return dVector (v.m_x * m_front.m_x + v.m_y * m_up.m_x + v.m_z * m_right.m_x,
v.m_x * m_front.m_y + v.m_y * m_up.m_y + v.m_z * m_right.m_y,
v.m_x * m_front.m_z + v.m_y * m_up.m_z + v.m_z * m_right.m_z);
}
inline dVector dMatrix::UnrotateVector (const dVector &v) const
{
return dVector (v % m_front, v % m_up, v % m_right);
}
inline dVector dMatrix::TransformVector (const dVector &v) const
{
return m_posit + RotateVector(v);
}
inline dVector dMatrix::UntransformVector (const dVector &v) const
{
return UnrotateVector(v - m_posit);
}
inline void dMatrix::TransformTriplex (
void* const dstPtr,
int dstStrideInBytes,
void* const srcPtr,
int srcStrideInBytes,
int count) const
{
int i;
dFloat x;
dFloat y;
dFloat z;
dFloat* dst;
dFloat* src;
dst = (dFloat*) dstPtr;
src = (dFloat*) srcPtr;
dstStrideInBytes /= sizeof (dFloat);
srcStrideInBytes /= sizeof (dFloat);
for (i = 0 ; i < count; i ++ ) {
x = src[0];
y = src[1];
z = src[2];
dst[0] = x * m_front.m_x + y * m_up.m_x + z * m_right.m_x + m_posit.m_x;
dst[1] = x * m_front.m_y + y * m_up.m_y + z * m_right.m_y + m_posit.m_y;
dst[2] = x * m_front.m_z + y * m_up.m_z + z * m_right.m_z + m_posit.m_z;
dst += dstStrideInBytes;
src += srcStrideInBytes;
}
}
inline dMatrix dMatrix::operator* (const dMatrix &B) const
{
const dMatrix& A = *this;
return dMatrix (dVector (A[0][0] * B[0][0] + A[0][1] * B[1][0] + A[0][2] * B[2][0] + A[0][3] * B[3][0],
A[0][0] * B[0][1] + A[0][1] * B[1][1] + A[0][2] * B[2][1] + A[0][3] * B[3][1],
A[0][0] * B[0][2] + A[0][1] * B[1][2] + A[0][2] * B[2][2] + A[0][3] * B[3][2],
A[0][0] * B[0][3] + A[0][1] * B[1][3] + A[0][2] * B[2][3] + A[0][3] * B[3][3]),
dVector (A[1][0] * B[0][0] + A[1][1] * B[1][0] + A[1][2] * B[2][0] + A[1][3] * B[3][0],
A[1][0] * B[0][1] + A[1][1] * B[1][1] + A[1][2] * B[2][1] + A[1][3] * B[3][1],
A[1][0] * B[0][2] + A[1][1] * B[1][2] + A[1][2] * B[2][2] + A[1][3] * B[3][2],
A[1][0] * B[0][3] + A[1][1] * B[1][3] + A[1][2] * B[2][3] + A[1][3] * B[3][3]),
dVector (A[2][0] * B[0][0] + A[2][1] * B[1][0] + A[2][2] * B[2][0] + A[2][3] * B[3][0],
A[2][0] * B[0][1] + A[2][1] * B[1][1] + A[2][2] * B[2][1] + A[2][3] * B[3][1],
A[2][0] * B[0][2] + A[2][1] * B[1][2] + A[2][2] * B[2][2] + A[2][3] * B[3][2],
A[2][0] * B[0][3] + A[2][1] * B[1][3] + A[2][2] * B[2][3] + A[2][3] * B[3][3]),
dVector (A[3][0] * B[0][0] + A[3][1] * B[1][0] + A[3][2] * B[2][0] + A[3][3] * B[3][0],
A[3][0] * B[0][1] + A[3][1] * B[1][1] + A[3][2] * B[2][1] + A[3][3] * B[3][1],
A[3][0] * B[0][2] + A[3][1] * B[1][2] + A[3][2] * B[2][2] + A[3][3] * B[3][2],
A[3][0] * B[0][3] + A[3][1] * B[1][3] + A[3][2] * B[2][3] + A[3][3] * B[3][3]));
}
// calculate an orthonormal matrix with the front vector pointing on the
// dir direction, and the up and right are determined by using the Gramm Schidth procedure
inline dMatrix dgGrammSchmidt(const dVector& dir)
{
dVector up;
dVector right;
dVector front (dir);
front = front.Scale(1.0f / dSqrt (front % front));
if (dAbs (front.m_z) > 0.577f) {
right = front * dVector (-front.m_y, front.m_z, 0.0f);
} else {
right = front * dVector (-front.m_y, front.m_x, 0.0f);
}
right = right.Scale (1.0f / dSqrt (right % right));
up = right * front;
front.m_w = 0.0f;
up.m_w = 0.0f;
right.m_w = 0.0f;
return dMatrix (front, up, right, dVector (0.0f, 0.0f, 0.0f, 1.0f));
}
inline dMatrix dgPitchMatrix(dFloat ang)
{
dFloat cosAng;
dFloat sinAng;
sinAng = dSin (ang);
cosAng = dCos (ang);
return dMatrix (dVector (1.0f, 0.0f, 0.0f, 0.0f),
dVector (0.0f, cosAng, sinAng, 0.0f),
dVector (0.0f, -sinAng, cosAng, 0.0f),
dVector (0.0f, 0.0f, 0.0f, 1.0f));
}
inline dMatrix dgYawMatrix(dFloat ang)
{
dFloat cosAng;
dFloat sinAng;
sinAng = dSin (ang);
cosAng = dCos (ang);
return dMatrix (dVector (cosAng, 0.0f, -sinAng, 0.0f),
dVector (0.0f, 1.0f, 0.0f, 0.0f),
dVector (sinAng, 0.0f, cosAng, 0.0f),
dVector (0.0f, 0.0f, 0.0f, 1.0f));
}
inline dMatrix dgRollMatrix(dFloat ang)
{
dFloat cosAng;
dFloat sinAng;
sinAng = dSin (ang);
cosAng = dCos (ang);
return dMatrix (dVector ( cosAng, sinAng, 0.0f, 0.0f),
dVector (-sinAng, cosAng, 0.0f, 0.0f),
dVector ( 0.0f, 0.0f, 1.0f, 0.0f),
dVector ( 0.0f, 0.0f, 0.0f, 1.0f));
}
#endif
Unstable Version/1.3.3/dQuaternion.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
//********************************************************************
// Newton Game dynamics
// copyright 2000-2004
// By Julio Jerez
// VC: 6.0
// basic Hierarchical Scene Node Class
//********************************************************************
#include <stdafx.h>
#include <dVector.h>
#include <dMatrix.h>
#include <dQuaternion.h>
enum QUAT_INDEX
{
X_INDEX=0,
Y_INDEX=1,
Z_INDEX=2
};
static QUAT_INDEX QIndex [] = {Y_INDEX, Z_INDEX, X_INDEX};
dQuaternion::dQuaternion (const dMatrix &matrix)
{
dFloat *ptr;
dFloat trace;
QUAT_INDEX i;
QUAT_INDEX j;
QUAT_INDEX k;
trace = matrix[0][0] + matrix[1][1] + matrix[2][2];
if (trace > dFloat(0.0f)) {
trace = dSqrt (trace + dFloat(1.0f));
m_q0 = dFloat (0.5f) * trace;
trace = dFloat (0.5f) / trace;
m_q1 = (matrix[2][1] - matrix[1][2]) * trace;
m_q2 = (matrix[0][2] - matrix[2][0]) * trace;
m_q3 = (matrix[1][0] - matrix[0][1]) * trace;
} else {
i = X_INDEX;
if (matrix[Y_INDEX][Y_INDEX] > matrix[X_INDEX][X_INDEX]) {
i = Y_INDEX;
}
if (matrix[Z_INDEX][Z_INDEX] > matrix[i][i]) {
i = Z_INDEX;
}
j = QIndex [i];
k = QIndex [j];
trace = dFloat(1.0f) + matrix[i][i] - matrix[j][j] - matrix[k][k];
trace = dSqrt (trace);
ptr = &m_q1;
ptr[i] = dFloat (0.5f) * trace;
trace = dFloat (0.5f) / trace;
ptr[3] = (matrix[k][j] - matrix[j][k]) * trace;
ptr[j] = (matrix[j][i] + matrix[i][j]) * trace;
ptr[k] = (matrix[k][i] + matrix[i][k]) * trace;
}
m_q1 *= dFloat (-1.0f);
m_q2 *= dFloat (-1.0f);;
m_q3 *= dFloat (-1.0f);;
#if _DEBUG
dFloat err = dAbs (DotProduct(*this) - dFloat(1.0f));
_ASSERTE (err < dFloat(1.0e-3f));
#endif
}
dQuaternion::dQuaternion (const dVector &unitAxis, dFloat Angle)
{
dFloat sinAng;
Angle *= dFloat (0.5f);
m_q0 = dCos (Angle);
sinAng = dSin (Angle);
#ifdef _DEBUG
if (dAbs (Angle) > dFloat(1.0e-6f)) {
_ASSERTE (dAbs (dFloat(1.0f) - unitAxis % unitAxis) < dFloat(1.0e-3f));
}
#endif
m_q1 = unitAxis.m_x * sinAng;
m_q2 = unitAxis.m_y * sinAng;
m_q3 = unitAxis.m_z * sinAng;
}
dVector dQuaternion::CalcAverageOmega (const dQuaternion &QB, dFloat dt) const
{
dFloat dirMag;
dFloat dirMag2;
dFloat omegaMag;
dFloat dirMagInv;
dQuaternion dq (Inverse() * QB);
dVector omegaDir (dq.m_q1, dq.m_q2, dq.m_q3);
dirMag2 = omegaDir % omegaDir;
if (dirMag2< dFloat(dFloat (1.0e-5f) * dFloat (1.0e-5f))) {
return dVector (dFloat(0.0f), dFloat(0.0f), dFloat(0.0f), dFloat(0.0f));
}
dirMagInv = dFloat (1.0f) / dSqrt (dirMag2);
dirMag = dirMag2 * dirMagInv;
omegaMag = dFloat(2.0f) * dAtan2 (dirMag, dq.m_q0) / dt;
return omegaDir.Scale (dirMagInv * omegaMag);
}
dQuaternion dQuaternion::Slerp (const dQuaternion &QB, dFloat t) const
{
dFloat dot;
dFloat ang;
dFloat Sclp;
dFloat Sclq;
dFloat den;
dFloat sinAng;
dQuaternion Q;
dot = DotProduct (QB);
if ((dot + dFloat(1.0f)) > dFloat(1.0e-5f)) {
if (dot < dFloat(0.995f)) {
ang = dAcos (dot);
sinAng = dSin (ang);
den = dFloat(1.0f) / sinAng;
Sclp = dSin ((dFloat(1.0f) - t ) * ang) * den;
Sclq = dSin (t * ang) * den;
} else {
Sclp = dFloat(1.0f) - t;
Sclq = t;
}
Q.m_q0 = m_q0 * Sclp + QB.m_q0 * Sclq;
Q.m_q1 = m_q1 * Sclp + QB.m_q1 * Sclq;
Q.m_q2 = m_q2 * Sclp + QB.m_q2 * Sclq;
Q.m_q3 = m_q3 * Sclp + QB.m_q3 * Sclq;
} else {
Q.m_q0 = m_q3;
Q.m_q1 = -m_q2;
Q.m_q2 = m_q1;
Q.m_q3 = m_q0;
Sclp = dSin ((dFloat(1.0f) - t) * dFloat (3.1416f *0.5f));
Sclq = dSin (t * dFloat (3.1416f * 0.5f));
Q.m_q0 = m_q0 * Sclp + Q.m_q0 * Sclq;
Q.m_q1 = m_q1 * Sclp + Q.m_q1 * Sclq;
Q.m_q2 = m_q2 * Sclp + Q.m_q2 * Sclq;
Q.m_q3 = m_q3 * Sclp + Q.m_q3 * Sclq;
}
dot = Q.DotProduct (Q);
if ((dot) < (1.0f - 1.0e-4f) ) {
dot = dFloat(1.0f) / dSqrt (dot);
//dot = dgRsqrt (dot);
Q.m_q0 *= dot;
Q.m_q1 *= dot;
Q.m_q2 *= dot;
Q.m_q3 *= dot;
}
return Q;
}
Unstable Version/1.3.3/dQuaternion.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
//********************************************************************
// Newton Game dynamics
// copyright 2000
// By Julio Jerez
// VC: 6.0
// simple 4d matrix class
//********************************************************************
#ifndef __dQuaternion__
#define __dQuaternion__
#include <stdafx.h>
class dVector;
class dMatrix;
class dQuaternion
{
public:
dQuaternion ();
dQuaternion (const dMatrix &matrix);
dQuaternion (dFloat q0, dFloat q1, dFloat q2, dFloat q3);
dQuaternion (const dVector &unit_Axis, dFloat Angle = 0.0f);
void Scale (dFloat scale);
void Normalize ();
inline dFloat DotProduct (const dQuaternion &QB) const;
dQuaternion Inverse () const;
dQuaternion Slerp (const dQuaternion &q1, dFloat t) const;
dVector CalcAverageOmega (const dQuaternion &q1, dFloat dt) const;
//friend dQuaternion operator* (const dQuaternion &A, const dQuaternion &B);
//friend dQuaternion operator+ (const dQuaternion &A, const dQuaternion &B);
// friend dQuaternion operator- (const dQuaternion &A, const dQuaternion &B);
dQuaternion operator* (const dQuaternion &B) const;
dQuaternion operator+ (const dQuaternion &B) const;
dQuaternion operator- (const dQuaternion &B) const;
dFloat m_q1;
dFloat m_q2;
dFloat m_q3;
dFloat m_q0;
};
inline dQuaternion::dQuaternion ()
{
m_q0 = 1.0f;
m_q1 = 0.0f;
m_q2 = 0.0f;
m_q3 = 0.0f;
}
inline dQuaternion::dQuaternion (dFloat Q0, dFloat Q1, dFloat Q2, dFloat Q3)
{
m_q0 = Q0;
m_q1 = Q1;
m_q2 = Q2;
m_q3 = Q3;
_ASSERTE (dAbs (DotProduct (*this) - 1.0f) < 1.0e-4f);
}
inline void dQuaternion::Scale (dFloat scale)
{
m_q0 *= scale;
m_q1 *= scale;
m_q2 *= scale;
m_q3 *= scale;
}
inline void dQuaternion::Normalize ()
{
Scale (1.0f / dSqrt (DotProduct (*this)));
}
inline dFloat dQuaternion::DotProduct (const dQuaternion &QB) const
{
return m_q0 * QB.m_q0 + m_q1 * QB.m_q1 + m_q2 * QB.m_q2 + m_q3 * QB.m_q3;
}
inline dQuaternion dQuaternion::Inverse () const
{
return dQuaternion (m_q0, -m_q1, -m_q2, -m_q3);
}
/*
inline dQuaternion operator+ (const dQuaternion &A, const dQuaternion &B)
{
return dQuaternion (A.m_q0 + B.m_q0, A.m_q1 + B.m_q1, A.m_q2 + B.m_q2, A.m_q3 + B.m_q3);
}
inline dQuaternion operator- (const dQuaternion &A, const dQuaternion &B)
{
return dQuaternion (A.m_q0 - B.m_q0, A.m_q1 - B.m_q1, A.m_q2 - B.m_q2, A.m_q3 - B.m_q3);
}
*/
inline dQuaternion dQuaternion::operator+ (const dQuaternion &B) const
{
return dQuaternion (m_q0 + B.m_q0, m_q1 + B.m_q1, m_q2 + B.m_q2, m_q3 + B.m_q3);
}
inline dQuaternion dQuaternion::operator- (const dQuaternion &B) const
{
return dQuaternion (m_q0 - B.m_q0, m_q1 - B.m_q1, m_q2 - B.m_q2, m_q3 - B.m_q3);
}
inline dQuaternion dQuaternion::operator* (const dQuaternion &B) const
{
return dQuaternion (B.m_q0 * m_q0 - B.m_q1 * m_q1 - B.m_q2 * m_q2 - B.m_q3 * m_q3,
B.m_q1 * m_q0 + B.m_q0 * m_q1 - B.m_q3 * m_q2 + B.m_q2 * m_q3,
B.m_q2 * m_q0 + B.m_q3 * m_q1 + B.m_q0 * m_q2 - B.m_q1 * m_q3,
B.m_q3 * m_q0 - B.m_q2 * m_q1 + B.m_q1 * m_q2 + B.m_q0 * m_q3);
}
#endif
Unstable Version/1.3.3/dVector.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
//********************************************************************
// Newton Game dynamics
// copyright 2000-2004
// By Julio Jerez
// VC: 6.0
// simple 4d vector class
//********************************************************************
#ifndef __dVector__
#define __dVector__
//#define dFloat float
#include <stdafx.h>
#include <Newton.h>
// small but very effective 4 dimetional template vector class
template<class T>
class TemplateVector
{
public:
TemplateVector ();
TemplateVector (const T *ptr);
TemplateVector (T m_x, T m_y, T m_z, T m_w);
TemplateVector Scale (T s) const;
T& operator[] (int i);
const T& operator[] (int i) const;
TemplateVector operator+ (const TemplateVector &A) const;
TemplateVector operator- (const TemplateVector &A) const;
TemplateVector &operator+= (const TemplateVector &A);
TemplateVector &operator-= (const TemplateVector &A);
// return dot product
T operator% (const TemplateVector &A) const;
// return cross product
TemplateVector operator* (const TemplateVector &B) const;
// component wise multiplication
TemplateVector CompProduct (const TemplateVector &A) const;
T m_x;
T m_y;
T m_z;
T m_w;
};
class dVector: public TemplateVector<dFloat>
{
public:
dVector();
dVector (const TemplateVector<dFloat>& v);
dVector (const dFloat *ptr);
dVector (dFloat x, dFloat y, dFloat z, dFloat w = 1.0);
};
template<class T>
TemplateVector<T>::TemplateVector() {}
template<class T>
TemplateVector<T>::TemplateVector(const T *ptr)
{
m_x = ptr[0];
m_y = ptr[1];
m_z = ptr[2];
m_w = 1.0;
}
template<class T>
TemplateVector<T>::TemplateVector(T x, T y, T z, T w)
{
m_x = x;
m_y = y;
m_z = z;
m_w = w;
}
template<class T>
T& TemplateVector<T>::operator[] (int i)
{
return (&m_x)[i];
}
template<class T>
const T& TemplateVector<T>::operator[] (int i) const
{
return (&m_x)[i];
}
template<class T>
TemplateVector<T> TemplateVector<T>::Scale (T scale) const
{
return TemplateVector<T> (m_x * scale, m_y * scale, m_z * scale, m_w);
}
template<class T>
TemplateVector<T> TemplateVector<T>::operator+ (const TemplateVector<T> &B) const
{
return TemplateVector<T> (m_x + B.m_x, m_y + B.m_y, m_z + B.m_z, m_w);
}
template<class T>
TemplateVector<T>& TemplateVector<T>::operator+= (const TemplateVector<T> &A)
{
m_x += A.m_x;
m_y += A.m_y;
m_z += A.m_z;
return *this;
}
template<class T>
TemplateVector<T> TemplateVector<T>::operator- (const TemplateVector<T> &A) const
{
return TemplateVector<T> (m_x - A.m_x, m_y - A.m_y, m_z - A.m_z, m_w);
}
template<class T>
TemplateVector<T>& TemplateVector<T>::operator-= (const TemplateVector<T> &A)
{
m_x -= A.m_x;
m_y -= A.m_y;
m_z -= A.m_z;
return *this;
}
template<class T>
T TemplateVector<T>::operator% (const TemplateVector<T> &A) const
{
return m_x * A.m_x + m_y * A.m_y + m_z * A.m_z;
}
template<class T>
TemplateVector<T> TemplateVector<T>::operator* (const TemplateVector<T> &B) const
{
return TemplateVector<T> (m_y * B.m_z - m_z * B.m_y,
m_z * B.m_x - m_x * B.m_z,
m_x * B.m_y - m_y * B.m_x, m_w);
}
template<class T>
TemplateVector<T> TemplateVector<T>::CompProduct (const TemplateVector<T> &A) const
{
return TemplateVector<T> (m_x * A.m_x, m_y * A.m_y, m_z * A.m_z, A.m_w);
}
inline dVector::dVector()
:TemplateVector<dFloat>()
{
}
inline dVector::dVector (const TemplateVector<dFloat>& v)
:TemplateVector<dFloat>(v)
{
}
inline dVector::dVector (const dFloat *ptr)
:TemplateVector<dFloat>(ptr)
{
}
inline dVector::dVector (dFloat x, dFloat y, dFloat z, dFloat w)
:TemplateVector<dFloat>(x, y, z, w)
{
}
#endif
Unstable Version/1.3.3/glut.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
#ifndef __glut_h__
#define __glut_h__
/* Copyright (c) Mark J. Kilgard, 1994, 1995, 1996. */
/* This program is freely distributable without licensing fees and is
provided without guarantee or warrantee expressed or implied. This
program is -not- in the public domain. */
#if defined(WIN32)
#include <windows.h>
#pragma warning (disable:4244)/* disable bogus conversion warnings */
#endif
#include <GL/gl.h>
#include <GL/glu.h>
/* define APIENTRY and CALLBACK to null string if we aren't on Win32 */
#if !defined(WIN32)
#define APIENTRY
#define CALLBACK
#endif
#ifdef __cplusplus
extern "C" {
#endif
/**
GLUT API revision history:
GLUT_API_VERSION is updated to reflect incompatible GLUT
API changes (interface changes, semantic changes, deletions,
or additions).
GLUT_API_VERSION=1 First public release of GLUT. 11/29/94
GLUT_API_VERSION=2 Added support for OpenGL/GLX multisampling,
extension. Supports new input devices like tablet, dial and button
box, and Spaceball. Easy to query OpenGL extensions.
GLUT_API_VERSION=3 glutMenuStatus added.
GLUT_API_VERSION=4 glutInitDisplayString, glutWarpPointer,
glutBitmapLength, glutStrokeLength, glutWindowStatusFunc, dynamic
video resize subAPI (NOT FINALIZED!).
**/
#ifndef GLUT_API_VERSION /* allow this to be overriden */
#define GLUT_API_VERSION3
#endif
/**
GLUT implementation revision history:
GLUT_XLIB_IMPLEMENTATION is updated to reflect both GLUT
API revisions and implementation revisions (ie, bug fixes).
GLUT_XLIB_IMPLEMENTATION=1 mjk's first public release of
GLUT Xlib-based implementation. 11/29/94
GLUT_XLIB_IMPLEMENTATION=2 mjk's second public release of
GLUT Xlib-based implementation providing GLUT version 2
interfaces.
GLUT_XLIB_IMPLEMENTATION=3 mjk's GLUT 2.2 images. 4/17/95
GLUT_XLIB_IMPLEMENTATION=4 mjk's GLUT 2.3 images. 6/?/95
GLUT_XLIB_IMPLEMENTATION=5 mjk's GLUT 3.0 images. 10/?/95
GLUT_XLIB_IMPLEMENTATION=7 mjk's GLUT 3.1+ with glutWarpPoitner. 7/24/96
GLUT_XLIB_IMPLEMENTATION=8 mjk's GLUT 3.1+ with glutWarpPoitner
and video resize. 1/3/97
GLUT_XLIB_IMPLEMENTATION=9 mjk's GLUT 3.4 release with early GLUT 4 routines.
**/
#ifndef GLUT_XLIB_IMPLEMENTATION /* Allow this to be overriden. */
#define GLUT_XLIB_IMPLEMENTATION9
#endif
/* Display mode bit masks. */
#define GLUT_RGB0
#define GLUT_RGBAGLUT_RGB
#define GLUT_INDEX1
#define GLUT_SINGLE0
#define GLUT_DOUBLE2
#define GLUT_ACCUM4
#define GLUT_ALPHA8
#define GLUT_DEPTH16
#define GLUT_STENCIL32
#if (GLUT_API_VERSION >= 2)
#define GLUT_MULTISAMPLE128
#define GLUT_STEREO256
#endif
#if (GLUT_API_VERSION >= 3)
#define GLUT_LUMINANCE512
#endif
/* Mouse buttons. */
#define GLUT_LEFT_BUTTON0
#define GLUT_MIDDLE_BUTTON1
#define GLUT_RIGHT_BUTTON2
/* Mouse button state. */
#define GLUT_DOWN0
#define GLUT_UP1
#if (GLUT_API_VERSION >= 2)
/* function keys */
#define GLUT_KEY_F11
#define GLUT_KEY_F22
#define GLUT_KEY_F33
#define GLUT_KEY_F44
#define GLUT_KEY_F55
#define GLUT_KEY_F66
#define GLUT_KEY_F77
#define GLUT_KEY_F88
#define GLUT_KEY_F99
#define GLUT_KEY_F1010
#define GLUT_KEY_F1111
#define GLUT_KEY_F1212
/* directional keys */
#define GLUT_KEY_LEFT100
#define GLUT_KEY_UP101
#define GLUT_KEY_RIGHT102
#define GLUT_KEY_DOWN103
#define GLUT_KEY_PAGE_UP104
#define GLUT_KEY_PAGE_DOWN105
#define GLUT_KEY_HOME106
#define GLUT_KEY_END107
#define GLUT_KEY_INSERT108
#endif
/* Entry/exit state. */
#define GLUT_LEFT0
#define GLUT_ENTERED1
/* Menu usage state. */
#define GLUT_MENU_NOT_IN_USE0
#define GLUT_MENU_IN_USE1
/* Visibility state. */
#define GLUT_NOT_VISIBLE0
#define GLUT_VISIBLE1
/* Window status state. */
#define GLUT_HIDDEN0
#define GLUT_FULLY_RETAINED1
#define GLUT_PARTIALLY_RETAINED2
#define GLUT_FULLY_COVERED3
/* Color index component selection values. */
#define GLUT_RED0
#define GLUT_GREEN1
#define GLUT_BLUE2
/* Layers for use. */
#define GLUT_NORMAL0
#define GLUT_OVERLAY1
#if defined(WIN32)
/* Stroke font constants (use these in GLUT program). */
#define GLUT_STROKE_ROMAN((void*)0)
#define GLUT_STROKE_MONO_ROMAN((void*)1)
/* Bitmap font constants (use these in GLUT program). */
#define GLUT_BITMAP_9_BY_15((void*)2)
#define GLUT_BITMAP_8_BY_13((void*)3)
#define GLUT_BITMAP_TIMES_ROMAN_10((void*)4)
#define GLUT_BITMAP_TIMES_ROMAN_24((void*)5)
#if (GLUT_API_VERSION >= 3)
#define GLUT_BITMAP_HELVETICA_10((void*)6)
#define GLUT_BITMAP_HELVETICA_12((void*)7)
#define GLUT_BITMAP_HELVETICA_18((void*)8)
#endif
#else
/* Stroke font opaque addresses (use constants instead in source code). */
extern void *glutStrokeRoman;
extern void *glutStrokeMonoRoman;
/* Stroke font constants (use these in GLUT program). */
#define GLUT_STROKE_ROMAN(&glutStrokeRoman)
#define GLUT_STROKE_MONO_ROMAN(&glutStrokeMonoRoman)
/* Bitmap font opaque addresses (use constants instead in source code). */
extern void *glutBitmap9By15;
extern void *glutBitmap8By13;
extern void *glutBitmapTimesRoman10;
extern void *glutBitmapTimesRoman24;
extern void *glutBitmapHelvetica10;
extern void *glutBitmapHelvetica12;
extern void *glutBitmapHelvetica18;
/* Bitmap font constants (use these in GLUT program). */
#define GLUT_BITMAP_9_BY_15(&glutBitmap9By15)
#define GLUT_BITMAP_8_BY_13(&glutBitmap8By13)
#define GLUT_BITMAP_TIMES_ROMAN_10(&glutBitmapTimesRoman10)
#define GLUT_BITMAP_TIMES_ROMAN_24(&glutBitmapTimesRoman24)
#if (GLUT_API_VERSION >= 3)
#define GLUT_BITMAP_HELVETICA_10(&glutBitmapHelvetica10)
#define GLUT_BITMAP_HELVETICA_12(&glutBitmapHelvetica12)
#define GLUT_BITMAP_HELVETICA_18(&glutBitmapHelvetica18)
#endif
#endif
/* glutGet parameters. */
#define GLUT_WINDOW_X100
#define GLUT_WINDOW_Y101
#define GLUT_WINDOW_WIDTH102
#define GLUT_WINDOW_HEIGHT103
#define GLUT_WINDOW_BUFFER_SIZE104
#define GLUT_WINDOW_STENCIL_SIZE105
#define GLUT_WINDOW_DEPTH_SIZE106
#define GLUT_WINDOW_RED_SIZE107
#define GLUT_WINDOW_GREEN_SIZE108
#define GLUT_WINDOW_BLUE_SIZE109
#define GLUT_WINDOW_ALPHA_SIZE110
#define GLUT_WINDOW_ACCUM_RED_SIZE111
#define GLUT_WINDOW_ACCUM_GREEN_SIZE112
#define GLUT_WINDOW_ACCUM_BLUE_SIZE113
#define GLUT_WINDOW_ACCUM_ALPHA_SIZE114
#define GLUT_WINDOW_DOUBLEBUFFER115
#define GLUT_WINDOW_RGBA116
#define GLUT_WINDOW_PARENT117
#define GLUT_WINDOW_NUM_CHILDREN118
#define GLUT_WINDOW_COLORMAP_SIZE119
#if (GLUT_API_VERSION >= 2)
#define GLUT_WINDOW_NUM_SAMPLES120
#define GLUT_WINDOW_STEREO121
#endif
#if (GLUT_API_VERSION >= 3)
#define GLUT_WINDOW_CURSOR122
#endif
#define GLUT_SCREEN_WIDTH200
#define GLUT_SCREEN_HEIGHT201
#define GLUT_SCREEN_WIDTH_MM202
#define GLUT_SCREEN_HEIGHT_MM203
#define GLUT_MENU_NUM_ITEMS300
#define GLUT_DISPLAY_MODE_POSSIBLE400
#define GLUT_INIT_WINDOW_X500
#define GLUT_INIT_WINDOW_Y501
#define GLUT_INIT_WINDOW_WIDTH502
#define GLUT_INIT_WINDOW_HEIGHT503
#define GLUT_INIT_DISPLAY_MODE504
#if (GLUT_API_VERSION >= 2)
#define GLUT_ELAPSED_TIME700
#endif
#if (GLUT_API_VERSION >= 2)
/* glutDeviceGet parameters. */
#define GLUT_HAS_KEYBOARD600
#define GLUT_HAS_MOUSE601
#define GLUT_HAS_SPACEBALL602
#define GLUT_HAS_DIAL_AND_BUTTON_BOX603
#define GLUT_HAS_TABLET604
#define GLUT_NUM_MOUSE_BUTTONS605
#define GLUT_NUM_SPACEBALL_BUTTONS606
#define GLUT_NUM_BUTTON_BOX_BUTTONS607
#define GLUT_NUM_DIALS608
#define GLUT_NUM_TABLET_BUTTONS609
#endif
#if (GLUT_API_VERSION >= 3)
/* glutLayerGet parameters. */
#define GLUT_OVERLAY_POSSIBLE 800
#define GLUT_LAYER_IN_USE801
#define GLUT_HAS_OVERLAY802
#define GLUT_TRANSPARENT_INDEX803
#define GLUT_NORMAL_DAMAGED804
#define GLUT_OVERLAY_DAMAGED805
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
/* glutVideoResizeGet parameters. */
#define GLUT_VIDEO_RESIZE_POSSIBLE900
#define GLUT_VIDEO_RESIZE_IN_USE901
#define GLUT_VIDEO_RESIZE_X_DELTA902
#define GLUT_VIDEO_RESIZE_Y_DELTA903
#define GLUT_VIDEO_RESIZE_WIDTH_DELTA904
#define GLUT_VIDEO_RESIZE_HEIGHT_DELTA905
#define GLUT_VIDEO_RESIZE_X906
#define GLUT_VIDEO_RESIZE_Y907
#define GLUT_VIDEO_RESIZE_WIDTH908
#define GLUT_VIDEO_RESIZE_HEIGHT909
#endif
/* glutUseLayer parameters. */
#define GLUT_NORMAL0
#define GLUT_OVERLAY1
/* glutGetModifiers return mask. */
#define GLUT_ACTIVE_SHIFT 1
#define GLUT_ACTIVE_CTRL 2
#define GLUT_ACTIVE_ALT 4
/* glutSetCursor parameters. */
/* Basic arrows. */
#define GLUT_CURSOR_RIGHT_ARROW0
#define GLUT_CURSOR_LEFT_ARROW1
/* Symbolic cursor shapes. */
#define GLUT_CURSOR_INFO2
#define GLUT_CURSOR_DESTROY3
#define GLUT_CURSOR_HELP4
#define GLUT_CURSOR_CYCLE5
#define GLUT_CURSOR_SPRAY6
#define GLUT_CURSOR_WAIT7
#define GLUT_CURSOR_TEXT8
#define GLUT_CURSOR_CROSSHAIR9
/* Directional cursors. */
#define GLUT_CURSOR_UP_DOWN10
#define GLUT_CURSOR_LEFT_RIGHT11
/* Sizing cursors. */
#define GLUT_CURSOR_TOP_SIDE12
#define GLUT_CURSOR_BOTTOM_SIDE13
#define GLUT_CURSOR_LEFT_SIDE14
#define GLUT_CURSOR_RIGHT_SIDE15
#define GLUT_CURSOR_TOP_LEFT_CORNER16
#define GLUT_CURSOR_TOP_RIGHT_CORNER17
#define GLUT_CURSOR_BOTTOM_RIGHT_CORNER18
#define GLUT_CURSOR_BOTTOM_LEFT_CORNER19
/* Inherit from parent window. */
#define GLUT_CURSOR_INHERIT100
/* Blank cursor. */
#define GLUT_CURSOR_NONE101
/* Fullscreen crosshair (if available). */
#define GLUT_CURSOR_FULL_CROSSHAIR102
#endif
/* GLUT initialization sub-API. */
extern void APIENTRY glutInit(int *argcp, char **argv);
extern void APIENTRY glutInitDisplayMode(unsigned int mode);
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
extern void APIENTRY glutInitDisplayString(const char *string);
#endif
extern void APIENTRY glutInitWindowPosition(int x, int y);
extern void APIENTRY glutInitWindowSize(int width, int height);
extern void APIENTRY glutMainLoop(void);
/* GLUT window sub-API. */
extern int APIENTRY glutCreateWindow(const char *title);
extern int APIENTRY glutCreateSubWindow(int win, int x, int y, int width, int height);
extern void APIENTRY glutDestroyWindow(int win);
extern void APIENTRY glutPostRedisplay(void);
extern void APIENTRY glutSwapBuffers(void);
extern int APIENTRY glutGetWindow(void);
extern void APIENTRY glutSetWindow(int win);
extern void APIENTRY glutSetWindowTitle(const char *title);
extern void APIENTRY glutSetIconTitle(const char *title);
extern void APIENTRY glutPositionWindow(int x, int y);
extern void APIENTRY glutReshapeWindow(int width, int height);
extern void APIENTRY glutPopWindow(void);
extern void APIENTRY glutPushWindow(void);
extern void APIENTRY glutIconifyWindow(void);
extern void APIENTRY glutShowWindow(void);
extern void APIENTRY glutHideWindow(void);
#if (GLUT_API_VERSION >= 3)
extern void APIENTRY glutFullScreen(void);
extern void APIENTRY glutSetCursor(int cursor);
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
extern void APIENTRY glutWarpPointer(int x, int y);
#endif
/* GLUT overlay sub-API. */
extern void APIENTRY glutEstablishOverlay(void);
extern void APIENTRY glutRemoveOverlay(void);
extern void APIENTRY glutUseLayer(GLenum layer);
extern void APIENTRY glutPostOverlayRedisplay(void);
extern void APIENTRY glutShowOverlay(void);
extern void APIENTRY glutHideOverlay(void);
#endif
/* GLUT menu sub-API. */
extern int APIENTRY glutCreateMenu(void (*)(int));
extern void APIENTRY glutDestroyMenu(int menu);
extern int APIENTRY glutGetMenu(void);
extern void APIENTRY glutSetMenu(int menu);
extern void APIENTRY glutAddMenuEntry(const char *label, int value);
extern void APIENTRY glutAddSubMenu(const char *label, int submenu);
extern void APIENTRY glutChangeToMenuEntry(int item, const char *label, int value);
extern void APIENTRY glutChangeToSubMenu(int item, const char *label, int submenu);
extern void APIENTRY glutRemoveMenuItem(int item);
extern void APIENTRY glutAttachMenu(int button);
extern void APIENTRY glutDetachMenu(int button);
/* GLUT sub-API. */
extern void APIENTRY glutDisplayFunc(void (*)(void));
extern void APIENTRY glutReshapeFunc(void (*)(int width, int height));
extern void APIENTRY glutKeyboardFunc(void (*)(unsigned char key, int x, int y));
extern void APIENTRY glutMouseFunc(void (*)(int button, int state, int x, int y));
extern void APIENTRY glutMotionFunc(void (*)(int x, int y));
extern void APIENTRY glutPassiveMotionFunc(void (*)(int x, int y));
extern void APIENTRY glutEntryFunc(void (*)(int state));
extern void APIENTRY glutVisibilityFunc(void (*)(int state));
extern void APIENTRY glutIdleFunc(void (*)(void));
extern void APIENTRY glutTimerFunc(unsigned int millis, void (*)(int value), int value);
extern void APIENTRY glutMenuStateFunc(void (*)(int state));
#if (GLUT_API_VERSION >= 2)
extern void APIENTRY glutSpecialFunc(void (*)(int key, int x, int y));
extern void APIENTRY glutSpaceballMotionFunc(void (*)(int x, int y, int z));
extern void APIENTRY glutSpaceballRotateFunc(void (*)(int x, int y, int z));
extern void APIENTRY glutSpaceballButtonFunc(void (*)(int button, int state));
extern void APIENTRY glutButtonBoxFunc(void (*)(int button, int state));
extern void APIENTRY glutDialsFunc(void (*)(int dial, int value));
extern void APIENTRY glutTabletMotionFunc(void (*)(int x, int y));
extern void APIENTRY glutTabletButtonFunc(void (*)(int button, int state, int x, int y));
#if (GLUT_API_VERSION >= 3)
extern void APIENTRY glutMenuStatusFunc(void (*)(int status, int x, int y));
extern void APIENTRY glutOverlayDisplayFunc(void (*)(void));
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
extern void APIENTRY glutWindowStatusFunc(void (*)(int state));
#endif
#endif
#endif
/* GLUT color index sub-API. */
extern void APIENTRY glutSetColor(int, GLfloat red, GLfloat green, GLfloat blue);
extern GLfloat APIENTRY glutGetColor(int ndx, int component);
extern void APIENTRY glutCopyColormap(int win);
/* GLUT state retrieval sub-API. */
extern int APIENTRY glutGet(GLenum type);
extern int APIENTRY glutDeviceGet(GLenum type);
#if (GLUT_API_VERSION >= 2)
/* GLUT extension support sub-API */
extern int APIENTRY glutExtensionSupported(const char *name);
#endif
#if (GLUT_API_VERSION >= 3)
extern int APIENTRY glutGetModifiers(void);
extern int APIENTRY glutLayerGet(GLenum type);
#endif
/* GLUT font sub-API */
extern void APIENTRY glutBitmapCharacter(void *font, int character);
extern int APIENTRY glutBitmapWidth(void *font, int character);
extern void APIENTRY glutStrokeCharacter(void *font, int character);
extern int APIENTRY glutStrokeWidth(void *font, int character);
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
extern int APIENTRY glutBitmapLength(void *font, const unsigned char *string);
extern int APIENTRY glutStrokeLength(void *font, const unsigned char *string);
#endif
/* GLUT pre-built models sub-API */
extern void APIENTRY glutWireSphere(GLdouble radius, GLint slices, GLint stacks);
extern void APIENTRY glutSolidSphere(GLdouble radius, GLint slices, GLint stacks);
extern void APIENTRY glutWireCone(GLdouble base, GLdouble height, GLint slices, GLint stacks);
extern void APIENTRY glutSolidCone(GLdouble base, GLdouble height, GLint slices, GLint stacks);
extern void APIENTRY glutWireCube(GLdouble size);
extern void APIENTRY glutSolidCube(GLdouble size);
extern void APIENTRY glutWireTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings);
extern void APIENTRY glutSolidTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings);
extern void APIENTRY glutWireDodecahedron(void);
extern void APIENTRY glutSolidDodecahedron(void);
extern void APIENTRY glutWireTeapot(GLdouble size);
extern void APIENTRY glutSolidTeapot(GLdouble size);
extern void APIENTRY glutWireOctahedron(void);
extern void APIENTRY glutSolidOctahedron(void);
extern void APIENTRY glutWireTetrahedron(void);
extern void APIENTRY glutSolidTetrahedron(void);
extern void APIENTRY glutWireIcosahedron(void);
extern void APIENTRY glutSolidIcosahedron(void);
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
/* GLUT video resize sub-API. */
extern int APIENTRY glutVideoResizeGet(GLenum param);
extern void APIENTRY glutSetupVideoResizing(void);
extern void APIENTRY glutStopVideoResizing(void);
extern void APIENTRY glutVideoResize(int x, int y, int width, int height);
extern void APIENTRY glutVideoPan(int x, int y, int width, int height);
/* GLUT debugging sub-API. */
extern void APIENTRY glutReportErrors(void);
#endif
#ifdef __cplusplus
}
#endif
#endif /* __glut_h__ */
Unstable Version/1.3.3/main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#include <iostream>
#include "IrrLib.h"
#include <irrlicht.h>
using namespace std;
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
int main(){
IrrLib Irrlicht(5, 640, 480, 16, false, true, false);
Irr3DObjColor col1;
Irr3DObjColor col2;
int vel = 1;
int nHits;
//int nTimes = 0;
//Color 1
col1.a = 255;
col1.r = 0;
col1.g = 255;
col1.b = 5;
//color 2
col2.a = 255;
col2.r = 0;
col2.g = 255;
col2.b = 255;
//Pos 1
Irr3DPos pos1;
Irr3DPos pos2, pos3;
pos3.x = -200;
pos3.y = 0;
pos3.z = 0;
pos2.x = 200;
pos2.y = 0;
pos2.z = 0;
pos1.x = 0;
pos1.y = 0;
pos1.z = 0;
Irr3DObj obj1;
obj1->setColor(col1);
obj1->setMesh("sphere.3ds");
Irr3DObj obj2, obj3;
obj3->setMesh("cube.3ds");
obj2->setMesh("cube.3ds");
obj2->setColor(col2);
obj3->setColor(col2);
obj1->addToScene();
obj2->addToScene();
obj3->addToScene();
Irrlicht.AddFPSCam();
obj2->Move(pos2);
obj3->Move(pos3);
while (Irrlicht.DeviceIsRunning())
if (Irrlicht.IsActiveWindow())
{
pos1.x = pos1.x + vel;
obj1->Move(pos1);
nHits = CheckForCollision(obj1,obj2);
if (nHits > 0)
{
vel = vel * -1;
}
nHits = CheckForCollision(obj1,obj3);
if (nHits > 0)
{
vel = vel * -1;
}
/*if (nHits > 0)
{
cout << "The sphere collided with the squre " << nTimes << endl;
nTimes++;
}*/
if (Irrlicht.IrrEvent.keyStates[KEY_KEY_W]){
Irrlicht.IrrEvent.keyStates[KEY_KEY_W] = false;
pos1.x = pos1.x + 10;
obj1->Move(pos1);
}
/*
if (Irrlicht.IrrEvent.keyStates[KEY_KEY_S]){
Irrlicht.IrrEvent.keyStates[KEY_KEY_S] = false;
pos1.x = pos1.x - 10;
obj1->Move(pos1);
}*/
Irrlicht.BeginScene(Irrlicht.Color.RED);
Irrlicht.DrawAll();
Irrlicht.EndScene();
nHits = 0;
}
Irrlicht.EndIrrlicht();
return 0;
}
Unstable Version/1.3.3/stdafx.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
#if !defined(AFX_STDAFX_H__AE78B9E2_A5B8_11D4_A1FB_00500C0076C8__INCLUDED_)
#define AFX_STDAFX_H__AE78B9E2_A5B8_11D4_A1FB_00500C0076C8__INCLUDED_
// Insert your headers here
#define WIN32_LEAN_AND_MEAN// Exclude rarely-used stuff from Windows headers
typedef char dInt8;
typedef unsigned char dUnsigned8;
typedef short dInt16;
typedef unsigned short dUnsigned16;
typedef int dInt32;
typedef unsigned dUnsigned32;
typedef unsigned int dUnsigned32;
#include <stddef.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <stdio.h>
#include <math.h>
#include <float.h>
#include <ctype.h>
#ifdef _MSC_VER
#include <windows.h>
#include <crtdbg.h>
#include <gl/glut.h>
#include <malloc.h>
#else
#ifdef _MIPS_ARCH
#include <Glut/glut.h>
#else
#include <glut.h>
#endif
#include <unistd.h>
#endif
// transcendental functions
#definedAbs(x)dFloat (fabs (dFloat(x)))
#definedSqrt(x)dFloat (sqrt (dFloat(x)))
#definedFloor(x)dFloat (floor (dFloat(x)))
#definedMod(x,y)dFloat (fmod (dFloat(x), dFloat(y)))
#define dSin(x)dFloat (sin (dFloat(x)))
#define dCos(x)dFloat (cos (dFloat(x)))
#define dAsin(x)dFloat (asin (dFloat(x)))
#define dAcos(x)dFloat (acos (dFloat(x)))
#definedAtan2(x,y) dFloat (atan2 (dFloat(x), dFloat(y)))
#ifdef __USE_DOUBLE_PRECISION__
#define glMultMatrix(x) glMultMatrixd(x)
#define glGetFloat(x,y) glGetDoublev(x,(GLdouble *)y)
#else
#define glMultMatrix(x) glMultMatrixf(x)
#define glGetFloat(x,y) glGetFloatv(x,(GLfloat *)y)
#endif
// SDK include
#include <dList.h>
#include <dVector.h>
#include <dMatrix.h>
//#include <dQuaternion.h>
#include <Newton.h>
#ifdef _MSC_VER
#pragma warning (disable: 4100) //unreferenced formal parameter
#pragma warning (disable: 4505) //unreferenced local function has been removed
#pragma warning (disable: 4201) //nonstandard extension used : nameless struct/union
#pragma warning (disable: 4127) //conditional expression is constant
#if (_MSC_VER >= 1400)
#pragma warning (disable: 4996) // for 2005 users declared deprecated
#endif
#else
//#define _ASSERTE(x) assert(x)
#define _ASSERTE(x)
#define min(a,b) (a < b ? a : b)
#define max(a,b) (a > b ? a : b)
#ifndef dAsin
#define dAsin(x) ((dFloat) dAsin(x))
#define dAcos(x) ((dFloat) dAcos(x))
#endif
#endif
// for some reason specifying a relative does not seem to work in Linus
// and i have to specify a absolute path
// #define ASSETS_PATH "."
#ifdef _MSC_VER
// Windows user assets path
#define ASSETS_PATH "."
inline void GetWorkingFileName (const char* name, char* outPathName)
{
sprintf (outPathName, "%s/%s", ASSETS_PATH, name);
}
#else
#ifdef _MIPS_ARCH
// Mac user assets path
#define ASSETS_PATH "../../.."
inline void GetWorkingFileName (const char* name, char* outPathName)
{
sprintf (outPathName, "%s/%s", ASSETS_PATH, name);
}
#else
// Linux user assets path
#define ASSETS_PATH "newtonSDK/samples/bin"
inline void GetWorkingFileName (const char* name, char* outPathName)
{
char *env;
env = getenv("HOME");
sprintf (outPathName, "%s/%s/%s", env, ASSETS_PATH, name);
}
#endif
#endif
// little Indian/big Indian conversion
#ifdef __ppc__
#define SWAP_INT16(x) (((x >> 8) & 0xff) + ((x & 0xff) << 8))
#define SWAP_INT32(x) ((SWAP_INT16 ( x >> 16)) + (SWAP_INT16 (x) << 16))
inline void SWAP_FLOAT32_ARRAY (dFloat *array, dInt32 count)
{
dInt32 i;
dInt32 x;
for (i = 0; i < count; i ++) {
x = SWAP_INT32 (*((dInt32*) &array[i]));
array[i] = *((dFloat*)&x);
}
}
#else
#define SWAP_INT16(x) x
#define SWAP_INT32(x) x
inline void SWAP_FLOAT32_ARRAY (float *array, dInt32 count)
{
}
#endif
#endif
WIP/INFO
1
2
3
Coding etiquette:
+ All code must line up
+ All functions must be written in the order that they are declared in the respected header file
WIP/Irr2D.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#ifndef _IRR2D_H_
#define_IRR2D_H_
#include "Irrlicht.h"
#include <vector>
#include "Irr2DObj.h"
class Irr2D{
private:
irr::IrrlichtDevice* device;
std::vector<irr::video::ITexture*> texture;//
std::vector<irr::core::position2d<irr::s32> > start;//
std::vector<irr::core::position2d<irr::s32> > end;//
std::vector<irr::video::SColor> color;//
int numLines, numTextures;//
std::vector<irr::core::rect<irr::s32>> text;//
irr::video::ITexture* textmap;
irr::core::stringwstrText;//
std::vector<irr::gui::IGUIFont*> fonts;
int numFonts;
public:
/*
Todo: Add a Move function to increment by current position
*/
Irr2D(): numLines(0), numTextures(0), numFonts(0), strText(L"") {};
Irr2D(irr::IrrlichtDevice* dev) : device(dev) {};
voidaddLine(irr::core::position2d<irr::s32>,irr::core::position2d<irr::s32>,
irr::video::SColor);
voiddrawLines();
voidclearLines();
voidaddTexture(irr::core::stringw, Irr2DObj &);
voidloadText(irr::core::stringw,irr::core::stringw,irr::u32);
voiddrawText(irr::core::stringw, irr::core::position2d<irr::s32>);
irr::IrrlichtDevice* getDevice();
voidsetDevice(irr::IrrlichtDevice*& );
voiddrawTexture(Irr2DObj &);
intmakeFont();
intmakeFont(irr::core::stringc);
voiddrawFont(int, irr::core::stringw, irr::core::rect<irr::s32>, irr::video::SColor);
};
#endif
WIP/Irr2DObj.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#include "Irr2DObj.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
Irr2DObj::Irr2DObj()
{
this->pos.X = 0;
this->pos.Y = 0;
}
Irr2DObj::Irr2DObj(f32 x, f32 y)
{
this->pos.X = x;
this->pos.Y = y;
}
intIrr2DObj::getObjectID()
{
return this->objectID;
}
void Irr2DObj::setObjectID(int oid)
{
this->objectID = oid;
}
f32 Irr2DObj::getX()
{
return this->pos.X;
}
f32 Irr2DObj::getY()
{
return this->pos.Y;
}
vector2d<f32> Irr2DObj::getPosition()
{
return this->pos;
}
void Irr2DObj::setX(f32 x)
{
this->pos.X = x;
}
void Irr2DObj::setY(f32 y)
{
this->pos.Y = y;
}
void Irr2DObj::setPosition(vector2d<f32> pos)
{
this->pos = pos;
}
f32 Irr2DObj::getWidth()
{
return this->width;
}
f32 Irr2DObj::getHeight()
{
return this->height;
}
void Irr2DObj::setWidth(f32 width)
{
this->width = width;
}
void Irr2DObj::setHeight(f32 height)
{
this->height = height;
}
WIP/Irr2DObj.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#ifndef IRR2DOBJ_H
#define IRR2DOBJ_H
#include "irrlicht.h"
class Irr2DObj
{
private:
irr::core::vector2d<irr::f32> pos;
irr::f32 width, height;
int eventID, objectID;
public:
Irr2DObj();
Irr2DObj(irr::f32 x, irr::f32 y);
intgetObjectID();
voidsetObjectID(int oid);
irr::f32 getX();
irr::f32 getY();
irr::core::vector2d<irr::f32>getPosition();
voidsetX(irr::f32 x);
voidsetY(irr::f32 y);
voidsetPosition(irr::core::vector2d<irr::f32> pos);
irr::f32 getWidth();
irr::f32getHeight();
voidsetWidth(irr::f32 width);
voidsetHeight(irr::f32 height);
};
#endif
WIP/Irr2d.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#include "Irr2D.h"
using namespace irr;
using namespace core;
using namespace video;
using namespace std;
using namespace gui;
voidIrr2D::addLine(position2d<s32> start, position2d<s32> end, SColor color)
{
this->start.push_back(start);
this->end.push_back(end);
this->color.push_back(color);
this->numLines++;
}
void Irr2D::drawLines()
{
for(int i = 0; i < numLines; ++i)
this->device->getVideoDriver()->draw2DLine(this->start[i], this->end[i], this->color[i]);
}
void Irr2D::clearLines()
{
this->numLines = 0;
this->start.clear();
this->end.clear();
this->color.clear();
}
voidIrr2D::addTexture(stringw path, Irr2DObj &obj)
{
texture.push_back(this->device->getVideoDriver()->getTexture(path.c_str()));
obj.setObjectID(numTextures);
this->numTextures++;
}
voidIrr2D::loadText(stringw textMapPath, stringw listofChars,u32 numColumns)
{
this->textmap = this->device->getVideoDriver()->getTexture(textMapPath.c_str());
this->strText = listofChars;
dimension2d<s32> dim;
dim = this->textmap->getSize();
u32 numRows = listofChars.size() / numColumns;
s32 width = dim.Width / numColumns;
s32 height = dim.Height / numRows;
//core::rect<s32> rect(0,0,width, height);
for(unsigned int i = 0; i < numRows; i++)
{
for (unsigned int x = 0; x < numColumns; x++)
{
this->text.push_back(rect<s32>(x*width, i*height, (x*width)+width, (i*height)+height));
}
}
}
voidIrr2D::drawText(stringw str, position2d<s32> pos)
{
s32 pos2;
for(unsigned int i = 0; i < str.size(); i++)
{
pos2 = this->strText.find(str.subString(i, 1).c_str());
this->device->getVideoDriver()->draw2DImage(this->textmap, pos, text[pos2]);
}
}
IrrlichtDevice*Irr2D::getDevice()
{
return this->device;
}
voidIrr2D::setDevice(IrrlichtDevice*& device)
{
this->device = device;
}
voidIrr2D::drawTexture(Irr2DObj & obj)
{
position2d<s32> pos;
vector2d<f32> pos2 = obj.getPosition();
pos.X = (s32)pos2.X;
pos.Y = (s32)pos2.Y;
this->device->getVideoDriver()->draw2DImage(this->texture[obj.getObjectID()], pos);
}
intIrr2D::makeFont()
{
IGUIFont* font = this->device->getGUIEnvironment()->getBuiltInFont();
this->fonts.push_back(font);
//this->numFonts++;
return this->numFonts++;
}
intIrr2D::makeFont(irr::core::stringc file)
{
IGUIFont* font = device->getGUIEnvironment()->getFont(file.c_str());
this->fonts.push_back(font);
return this->numFonts++;
}
voidIrr2D::drawFont(int fontID, irr::core::stringw text, irr::core::rect<s32> pos, irr::video::SColor color)
{
this->fonts[fontID]->draw(text.c_str(), pos, color);
}
WIP/Irr3D.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#include "Irr3D.h"
#include "Irr3DObj.h"
#include <cstdlib>
#include "Newton.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
Irr3D::Irr3D()
{
this->nObjects = 0;
}
Irr3DObjIrr3D::create()
{
Irr3DObj obj;
obj.setObjectID(this->nObjects);
this->nObjects++;
return obj;
}
Irr3DObjIrr3D::create(irr::core::stringc fmesh)
{
IMeshSceneNode * node = this->device->getSceneManager()->addMeshSceneNode(this->device->getSceneManager()->getMesh(fmesh.c_str())->getMesh(0));
Irr3DObj obj;
obj.setObjectID(this->objects.size());
this->objects.push_back(node);
return obj;
}
voidIrr3D::setTexture(Irr3DObj & obj, irr::core::stringw fname)
{
}
voidIrr3D::setMesh(Irr3DObj & obj, irr::core::stringc fmesh)
{
//this->irr_node = smgr->addMeshSceneNode(smgr->getMesh(this->texture.c_str())->getMesh(0));
this->objects.push_back(this->device->getSceneManager()->addMeshSceneNode(this->device->getSceneManager()->getMesh(fmesh.c_str())->getMesh(0)));
}
vector3dfIrr3D::getPosition(Irr3DObj & obj)
{
if (obj.getObjectID() == -1)
return vector3df(0,0,0);
else
return this->objects[obj.getObjectID()]->getPosition();
}
voidIrr3D::setPosition(Irr3DObj & obj, irr::f32 x,irr::f32 y,irr::f32 z)
{
if (obj.getObjectID() != -1)
this->objects[obj.getObjectID()]->setPosition(vector3df(x, y, z));
}
voidIrr3D::move(Irr3DObj & obj, float dx, float dy, float dz)
{
vector3df mv(dx, dy, dz);
mv += this->getPosition(obj);
this->setPosition(obj, mv.X, mv.Y, mv.Z);
}
voidIrr3D::setDevice(IrrlichtDevice* dev)
{
this->device = dev;
}
void Irr3D::setColor(Irr3DObj & obj, irr::u32 a, irr::u32 r, irr::u32 g, irr::u32 b)
{
this->objects[obj.getObjectID()]->getMaterial(0).EmissiveColor.set(a, r, g, b);
}
WIP/Irr3DObj.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include "Irr3DObj.h"
Irr3DObj::Irr3DObj()
{
this->objectID = -1;
}
intIrr3DObj::getObjectID()
{
return this->objectID;
}
voidIrr3DObj::setObjectID(int oid)
{
this->objectID = oid;
}
WIP/Irr3DObj.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#ifndef IRR3DOBJ_H
#define IRR3DOBJ_H
#include "irrlicht.h"
class Irr3DObj
{
private:
int objectID;
public:
Irr3DObj();
intgetObjectID();
voidsetObjectID(int oid);
};
#endif
WIP/Irr3d.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#ifndef IRR3D_H
#define IRR3D_H
#include <vector>
#include "irrlicht.h"
#include "Newton.h"
class Irr3DObj;
class Irr3D {
private:
irr::IrrlichtDevice* device;
std::vector<irr::scene::IMeshSceneNode*> objects;
int nObjects;
std::vector<NewtonCollision*> ncobj;
//std::vector<NewtonCollision*> col_objects;
public:
Irr3D();
Irr3DObjcreate();
Irr3DObjcreate(irr::core::stringc);
voidsetTexture(Irr3DObj & obj, irr::core::stringw);
voidsetMesh(Irr3DObj & obj, irr::core::stringc);
irr::core::vector3dfgetPosition(Irr3DObj & obj);
voidsetPosition(Irr3DObj & obj, irr::f32 x,irr::f32 y,irr::f32 z);
voidmove(Irr3DObj & obj, float dx, float dy, float dz);
voidsetDevice(irr::IrrlichtDevice* dev);
voidsetColor(Irr3DObj & obj, irr::u32 r, irr::u32 g, irr::u32 b, irr::u32 a);
//voidsetNewtonCollision(NewtonCollision*& nc);
//NewtonCollision*getNewtonCollision();
};
#endif
WIP/IrrColor.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#include <iostream>
#include <irrlicht.h>
#include <string>
#include "IrrColor.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
void IrrColor::Init(){
/*SColor * temp;
temp = new SColor(alpha, 255, 0, 0);
this->RED = temp;
delete temp;*/
this->RED = SColor(alpha, 255, 0, 0);
this->ORANGE = SColor(alpha, 255, 165, 0);
this->YELLOW = SColor(alpha, 255, 255, 0);
this->GREEN = SColor(alpha, 0, 255, 0);
this->BLUE = SColor(alpha, 0, 0, 255);
this->DARK_GREEN = SColor(alpha, 0, 100, 0);
this->PINK = SColor(alpha, 255, 192, 203);
this->GREY = SColor(alpha, 190, 190, 190);
this->WHITE = SColor(alpha, 0, 0, 0);
this->BLACK = SColor(alpha, 0, 0, 0);
}
IrrColor::~IrrColor(){
/*delete this->RED;
delete this->ORANGE;
delete this->YELLOW;
delete this->GREEN;
delete this->BLUE;
delete this->DARK_GREEN;
delete this->PINK;
delete this->GREY;
delete this->WHITE;
delete this->BLACK;*/
}
IrrColor::IrrColor(){
this->alpha = 255;
Init();
}
IrrColor::IrrColor(irr::u32 alpha){
this->alpha = alpha;
Init();
}
int IrrColor::getAlpha(){
return this->alpha;
}
void IrrColor::setAlpha(int alpha){
this->alpha = alpha;
}
SColor IrrColor::returnColor(stringw color){
int nColor = -1;
if (color == "red")
nColor = 1;
else if (color == "green")
nColor = 2;
else if (color == "blue")
nColor = 3;
else if (color == "dark green")
nColor = 4;
else if (color == "pink")
nColor = 5;
else if (color == "grey")
nColor = 6;
switch (nColor){
case 1:
return SColor(255, 255, 0, 0);
break;
case 2:
return SColor(255, 0, 255, 0);
break;
case 3:
return SColor(255, 0, 0, 255);
break;
case 4:
return SColor(255, 0, 50, 0);
break;
case 5:
return SColor(255, 255, 10, 255);
break;
case 6:
return SColor(255,200,200,200);
break;
default:
return SColor(255,200,200,200);
break;
}// TODO: Make this function modular
}
WIP/IrrColor.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#ifndef IRRCOLOR_H
#define IRRCOLOR_H
#include <iostream>
#include <string>
#include "irrlicht.h"
//#include "IrrLib.h"
class IrrColor {
private:
irr::u32 alpha;
void Init();
//who knows?
public:
//irr::video::SColor(alpha, 255, 0, 0);
irr::video::SColor RED;
irr::video::SColor ORANGE;
irr::video::SColor YELLOW;
irr::video::SColor GREEN;
irr::video::SColor BLUE;
irr::video::SColor DARK_GREEN;
irr::video::SColor PINK;
irr::video::SColor GREY;
irr::video::SColor WHITE;
irr::video::SColor BLACK;
/*const ORANGE = irr::video::SColor(alpha, 255, 165, 0);
const YELLOW = irr::video::SColor(alpha, 255, 255, 0);
const GREEN = irr::video::SColor(alpha, 0, 255, 0);
const BLUE = irr::video::SColor(alpha, 0, 0, 255);
const DARK_GREEN = irr::video::SColor(alpha, 0, 100, 0);
const PINK = irr::video::SColor(alpha, 255, 192, 203);
const GREY = irr::video::Scolor(alpha, 190, 190, 190);*/
//void IrrColor::test();
IrrColor();
IrrColor(irr::u32 alpha);
~IrrColor();
int getAlpha();
void setAlpha(int alpha);
irr::video::SColor returnColor(irr::core::stringw color);
};
#endif
WIP/IrrLib.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#include "IrrLib.h"
#include "irrlicht.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
IrrLib::IrrLib(video::E_DRIVER_TYPE drivertype, core::dimension2d<s32> & res, u32 bits, bool fullscreen, bool stencilbuffer, bool vsync)
{
this->device = createDevice(drivertype, res, bits, fullscreen, stencilbuffer, vsync);
if (this->device == 0)
exit(1);
this->Lib2D.setDevice(this->device);
this->Lib3D.setDevice(this->device);
}
bool IrrLib::DeviceIsRunning()
{
return this->device->run();
}
void IrrLib::BeginScene()
{
this->device->getVideoDriver()->beginScene(true, true, video::SColor(0,200,200,200));
//smgr->addCameraSceneNode(0, vector3df(0,1,-7), vector3df(0,0,0));
}
void IrrLib::BeginScene(irr::video::SColor color)
{
this->device->getVideoDriver()->beginScene(true, true, color);
}
void IrrLib::BeginScene(bool usebackBuffer, bool usezBuffer, irr::video::SColor color)
{
this->device->getVideoDriver()->beginScene(usebackBuffer, usezBuffer, color);
}
void IrrLib::SetWindowCaption(stringw str)
{
this->device->setWindowCaption(str.c_str());
}
void IrrLib::DrawAll()
{
this->device->getGUIEnvironment()->drawAll();
this->device->getSceneManager()->drawAll();
}
void IrrLib::EndScene()
{
this->device->getVideoDriver()->endScene();
}
void IrrLib::EndIrrlicht()
{
if(this->device != NULL){
this->device->drop();
this->device = NULL;
}
}
void IrrLib::AddFPSCam()
{
this->cam = this->device->getSceneManager()->addCameraSceneNodeFPS();
}
WIP/IrrLib.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#ifndef IRRLIB_H
#define IRRLIB_H
#include "irrlicht.h"
#include "Irr3D.h"
#include "Irr2D.h"
#include "IrrColor.h"
#include "Irr3DObj.h"
#include "Irr2DObj.h"
class IrrLib {
private:
irr::IrrlichtDevice* device;
irr::scene::ICameraSceneNode * cam;
public:
IrrLib(irr::video::E_DRIVER_TYPE drivertype, irr::core::dimension2d<irr::s32> & res, irr::u32 bits, bool fullscreen, bool stencilbuffer, bool vsync);
Irr3D Lib3D;
Irr2D Lib2D;
IrrColor Color;
bool DeviceIsRunning();
void BeginScene();
void BeginScene(irr::video::SColor color);
void BeginScene(bool usebackBuffer, bool usezBuffer, irr::video::SColor color);
void SetWindowCaption(irr::core::stringw str);
void DrawAll();
void EndScene();
void EndIrrlicht();
void AddFPSCam();
};
#endif
WIP/Newton.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
//********************************************************************
// Newton Game dynamics
// copyright 2000-2004
// By Julio Jerez
// VC: 6.0
// One and only header file.
//********************************************************************
#ifndef NEWTON_H__736495_6495_076__INCLUDED_
#define NEWTON_H__736495_6495_076__INCLUDED_
#define NEWTON_MAJOR_VERSION 2
#define NEWTON_MINOR_VERSION 00
// force all not visual studio platform to be in library form
#ifndef _MSC_VER
#ifndef _NEWTON_USE_LIB
#define _NEWTON_USE_LIB
#endif
#endif
#ifdef _NEWTON_USE_LIB
#define NEWTON_API
#else
#ifdef _NEWTON_BUILD_DLL
#define NEWTON_API __declspec(dllexport)
#else
#define NEWTON_API __declspec(dllimport)
#endif
#endif
//#define __USE_DOUBLE_PRECISION__
#ifdef __USE_DOUBLE_PRECISION__
#define dFloat double
#else
#define dFloat float
#endif
#ifdef __cplusplus
extern "C" {
#endif
#define NEWTON_PROFILER_WORLD_UPDATE0
#define NEWTON_PROFILER_COLLISION_UPDATE1
#define NEWTON_PROFILER_COLLISION_UPDATE_BROAD_PHASE2
#define NEWTON_PROFILER_COLLISION_UPDATE_NARROW_PHASE3
#define NEWTON_PROFILER_DYNAMICS_UPDATE4
#define NEWTON_PROFILER_DYNAMICS_CONSTRAINT_GRAPH5
#define NEWTON_PROFILER_DYNAMICS_SOLVE_CONSTRAINT_GRAPH6
typedef struct NewtonMesh{} NewtonMesh;
typedef struct NewtonBody{} NewtonBody;
typedef struct NewtonWorld{} NewtonWorld;
typedef struct NewtonJoint{} NewtonJoint;
typedef struct NewtonMaterial{} NewtonMaterial;
typedef struct NewtonCollision{} NewtonCollision;
typedef struct NewtonSceneProxy{} NewtonSceneProxy;
//typedef struct NewtonRagDoll{} NewtonRagDoll;
//typedef struct NewtonRagDollBone{} NewtonRagDollBone;
#define SERIALIZE_ID_BOX0
#define SERIALIZE_ID_CONE1
#define SERIALIZE_ID_SPHERE2
#define SERIALIZE_ID_CAPSULE3
#define SERIALIZE_ID_CYLINDER4
#define SERIALIZE_ID_COMPOUND5
#define SERIALIZE_ID_CONVEXHULL6
#define SERIALIZE_ID_CONVEXMODIFIER7
#define SERIALIZE_ID_CHAMFERCYLINDER8
#define SERIALIZE_ID_TREE9
#define SERIALIZE_ID_NULL10
#define SERIALIZE_ID_HEIGHTFIELD11
#define SERIALIZE_ID_USERMESH12
#define SERIALIZE_ID_SCENE13
struct NewtonCollisionInfoRecord
{
struct NewtonBoxParam
{
dFloat m_x;
dFloat m_y;
dFloat m_z;
};
struct NewtonSphereParam
{
dFloat m_r0;
dFloat m_r1;
dFloat m_r2;
};
struct NewtonCylinderParam
{
dFloat m_r0;
dFloat m_r1;
dFloat m_height;
};
struct NewtonCapsuleParam
{
dFloat m_r0;
dFloat m_r1;
dFloat m_height;
};
struct NewtonConeParam
{
dFloat m_r;
dFloat m_height;
};
struct NewtonChamferCylinderParam
{
dFloat m_r;
dFloat m_height;
};
struct NewtonConvexHullModifierParam
{
NewtonCollision* m_chidren;
};
struct NewtonCompoundCollisionParam
{
int m_chidrenCount;
NewtonCollision** m_chidren;
};
struct NewtonHeightFieldCollisionParam
{
int m_width;
int m_height;
int m_gridsDiagonals;
dFloat m_horizonalScale;
dFloat m_verticalScale;
unsigned short *m_elevation;
char *m_atributes;
};
struct NewtonSceneCollisionParam
{
int m_childrenProxyCount;
};
dFloat m_offsetMatrix[4][4];
int m_collisionType;// tag id to identify the collision primitive
int m_referenceCount;// the current reference count for this collision
int m_collisionUserID;
union {
NewtonBoxParam m_box;
NewtonConeParam m_cone;
NewtonSphereParam m_sphere;
NewtonCapsuleParam m_capsule;
NewtonCylinderParam m_cylinder;
NewtonChamferCylinderParam m_chamferCylinder;
NewtonCompoundCollisionParam m_compoundCollision;
NewtonConvexHullModifierParam m_convexHullModifier;
NewtonHeightFieldCollisionParam m_heightField;
NewtonSceneCollisionParam m_sceneCollision;
dFloat m_paramArray[64]; // user define collision can use this to store information
};
};
struct NewtonJointRecord
{
dFloat m_attachmenMatrix_0[4][4];
dFloat m_attachmenMatrix_1[4][4];
dFloat m_minLinearDof[3];
dFloat m_maxLinearDof[3];
dFloat m_minAngularDof[3];
dFloat m_maxAngularDof[3];
const NewtonBody* m_attachBody_0;
const NewtonBody* m_attachBody_1;
dFloat m_extraParameters[16];
intm_bodiesCollisionOn;
char m_descriptionType[32];
} ;
struct NewtonUserMeshCollisionCollideDesc
{
dFloat m_boxP0[4];// lower bounding box of intersection query in local space
dFloat m_boxP1[4];// upper bounding box of intersection query in local space
int m_threadNumber;// current thread executing this query
intm_faceCount; // the application should set here how many polygons intersect the query box
int m_vertexStrideInBytes; // the application should set here the size of each vertex
void* m_userData; // user data passed to the collision geometry at creation time
dFloat* m_vertex; // the application should the pointer to the vertex array.
int* m_userAttribute; // the application should set here the pointer to the user data, one for each face
int* m_faceIndexCount; // the application should set here the pointer to the vertex count of each face.
int* m_faceVertexIndex; // the application should set here the pointer index array for each vertex on a face.
NewtonBody* m_objBody; // pointer to the colliding body
NewtonBody* m_polySoupBody; // pointer to the rigid body owner of this collision tree
};
struct NewtonWorldConvexCastReturnInfo
{
dFloat m_point[4];// collision point in global space
dFloat m_normal[4];// surface normal at collision point in global space
dFloat m_penetration; // contact penetration at collision point
int m_contactID; // collision ID at contact point
const NewtonBody* m_hitBody;// body hit at contact point
};
struct NewtonUserMeshCollisionRayHitDesc
{
dFloat m_p0[4];// ray origin in collision local space
dFloat m_p1[4]; // ray destination in collision local space
dFloat m_normalOut[4];// copy here the normal at the ray intersection
int m_userIdOut; // copy here a user defined id for further feedback
void* m_userData; // user data passed to the collision geometry at creation time
};
struct NewtonHingeSliderUpdateDesc
{
dFloat m_accel;
dFloat m_minFriction;
dFloat m_maxFriction;
dFloat m_timestep;
} ;
// Newton callback functions
typedef void* (*NewtonAllocMemory) (int sizeInBytes);
typedef void (*NewtonFreeMemory) (void *ptr, int sizeInBytes);
typedef unsigned (*NewtonGetTicksCountCallback) ();
typedef void (*NewtonSerialize) (void* serializeHandle, const void* buffer, int size);
typedef void (*NewtonDeserialize) (void* serializeHandle, void* buffer, int size);
// user collision callbacks
typedef void (*NewtonUserMeshCollisionDestroyCallback) (void* userData);
typedef void (*NewtonUserMeshCollisionCollideCallback) (NewtonUserMeshCollisionCollideDesc* collideDescData);
typedef dFloat (*NewtonUserMeshCollisionRayHitCallback) (NewtonUserMeshCollisionRayHitDesc* lineDescData);
typedef void (*NewtonUserMeshCollisionGetCollisionInfo) (void* userData, NewtonCollisionInfoRecord* infoRecord);
typedef void (*NewtonUserMeshCollisionGetFacesInAABB) (void* userData, const dFloat* p0, const dFloat* p1,
const dFloat** vertexArray, int* vertexCount, int* vertexStrideInBytes,
const int* indexList, int maxIndexCount, const int* userDataList);
typedef dFloat (*NewtonCollisionTreeRayCastCallback) (dFloat interception, dFloat* normal, int faceId, void* usedData);
// collision tree call back (obsoleted no recommended)
typedef void (*NewtonTreeCollisionCallback) (const NewtonBody* bodyWithTreeCollision, const NewtonBody* body, int faceID,
int vertexCount, const dFloat* vertex, int vertexStrideInBytes);
typedef void (*NewtonBodyDestructor) (const NewtonBody* body);
typedef void (*NewtonBodyLeaveWorld) (const NewtonBody* body, int threadIndex);
typedef void (*NewtonApplyForceAndTorque) (const NewtonBody* body, dFloat timestep, int threadIndex);
typedef void (*NewtonSetTransform) (const NewtonBody* body, const dFloat* matrix, int threadIndex);
typedef int (*NewtonIslandUpdate) (const void* islandHandle, int bodyCount);
typedef int (*NewtonGetBuoyancyPlane) (const int collisionID, void *context, const dFloat* globalSpaceMatrix, dFloat* globalSpacePlane);
typedef unsigned (*NewtonWorldRayPrefilterCallback)(const NewtonBody* body, const NewtonCollision* collision, void* userData);
typedef dFloat (*NewtonWorldRayFilterCallback)(const NewtonBody* body, const dFloat* hitNormal, int collisionID, void* userData, dFloat intersectParam);
typedef int (*NewtonOnAABBOverlap) (const NewtonMaterial* material, const NewtonBody* body0, const NewtonBody* body1, int threadIndex);
typedef void (*NewtonContactsProcess) (const NewtonJoint* contact, dFloat timestep, int threadIndex);
//typedef void (*NewtonContactEnd) (const NewtonMaterial* material, const NewtonBody* body0, const NewtonBody* body1, int threadIndex);
typedef void (*NewtonBodyIterator) (const NewtonBody* body);
typedef void (*NewtonJointIterator) (const NewtonJoint* joint);
typedef void (*NewtonCollisionIterator) (void* userData, int vertexCount, const dFloat* faceArray, int faceId);
typedef void (*NewtonBallCallBack) (const NewtonJoint* ball, dFloat timestep);
typedef unsigned (*NewtonHingeCallBack) (const NewtonJoint* hinge, NewtonHingeSliderUpdateDesc* desc);
typedef unsigned (*NewtonSliderCallBack) (const NewtonJoint* slider, NewtonHingeSliderUpdateDesc* desc);
typedef unsigned (*NewtonUniversalCallBack) (const NewtonJoint* universal, NewtonHingeSliderUpdateDesc* desc);
typedef unsigned (*NewtonCorkscrewCallBack) (const NewtonJoint* corkscrew, NewtonHingeSliderUpdateDesc* desc);
typedef void (*NewtonUserBilateralCallBack) (const NewtonJoint* userJoint, dFloat timestep, int threadIndex);
typedef void (*NewtonUserBilateralGetInfoCallBack) (const NewtonJoint* userJoint, NewtonJointRecord* info);
typedef void (*NewtonConstraintDestructor) (const NewtonJoint* me);
//typedef void (*NewtonSetRagDollTransform) (const NewtonRagDollBone* bone);
//typedef void (*NewtonBodyActivationState) (const NewtonBody* body, unsigned state);
//typedef void (*NewtonVehicleTireUpdate) (const NewtonJoint* vehicle, dFloat timestep);
// **********************************************************************************************
//
// world control functions
//
// **********************************************************************************************
NEWTON_API NewtonWorld* NewtonCreate (NewtonAllocMemory malloc, NewtonFreeMemory mfree);
NEWTON_API void NewtonDestroy (const NewtonWorld* newtonWorld);
NEWTON_API void NewtonDestroyAllBodies (const NewtonWorld* newtonWorld);
NEWTON_API int NewtonGetMemoryUsed ();
NEWTON_API void NewtonUpdate (const NewtonWorld* newtonWorld, dFloat timestep);
NEWTON_API void NewtonInvalidateCache (const NewtonWorld* newtonWorld);
NEWTON_API void NewtonCollisionUpdate (const NewtonWorld* newtonWorld);
NEWTON_API void NewtonSetSolverModel (const NewtonWorld* newtonWorld, int model);
NEWTON_API void NewtonSetPlatformArchitecture (const NewtonWorld* newtonWorld, int mode);
NEWTON_API int NewtonGetPlatformArchitecture(const NewtonWorld* newtonWorld, char* description);
NEWTON_API void NewtonSetMultiThreadSolverOnSingleIsland (const NewtonWorld* newtonWorld, int mode);
NEWTON_API void NewtonSetPerformanceClock (const NewtonWorld* newtonWorld, NewtonGetTicksCountCallback callback);
NEWTON_API unsigned NewtonReadPerformanceTicks (const NewtonWorld* newtonWorld, unsigned thread, unsigned performanceEntry);
NEWTON_API void NewtonWorldCriticalSectionLock (const NewtonWorld* newtonWorld);
NEWTON_API void NewtonWorldCriticalSectionUnlock (const NewtonWorld* newtonWorld);
NEWTON_API void NewtonSetThreadsCount (const NewtonWorld* newtonWorld, int threads);
NEWTON_API int NewtonGetThreadsCount(const NewtonWorld* newtonWorld);
NEWTON_API void NewtonSetFrictionModel (const NewtonWorld* newtonWorld, int model);
NEWTON_API void NewtonSetMinimumFrameRate (const NewtonWorld* newtonWorld, dFloat frameRate);
NEWTON_API void NewtonSetBodyLeaveWorldEvent (const NewtonWorld* newtonWorld, NewtonBodyLeaveWorld callback);
NEWTON_API void NewtonSetWorldSize (const NewtonWorld* newtonWorld, const dFloat* minPoint, const dFloat* maxPoint);
NEWTON_API void NewtonSetIslandUpdateEvent (const NewtonWorld* newtonWorld, NewtonIslandUpdate islandUpdate);
//NEWTON_API void NewtonWorldForEachBodyDo (const NewtonWorld* newtonWorld, NewtonBodyIterator callback);
NEWTON_API void NewtonWorldForEachJointDo (const NewtonWorld* newtonWorld, NewtonJointIterator callback);
NEWTON_API void NewtonWorldForEachBodyInAABBDo (const NewtonWorld* newtonWorld, const dFloat* p0, const dFloat* p1, NewtonBodyIterator callback);
NEWTON_API void NewtonWorldSetUserData (const NewtonWorld* newtonWorld, void* userData);
NEWTON_API void* NewtonWorldGetUserData (const NewtonWorld* newtonWorld);
NEWTON_API int NewtonWorldGetVersion (const NewtonWorld* newtonWorld);
NEWTON_API void NewtonWorldRayCast (const NewtonWorld* newtonWorld, const dFloat* p0, const dFloat* p1, NewtonWorldRayFilterCallback filter, void* userData,
NewtonWorldRayPrefilterCallback prefilter);
NEWTON_API int NewtonWorldConvexCast (const NewtonWorld* newtonWorld, const dFloat* matrix, const dFloat* target, const NewtonCollision* shape, dFloat* hitParam, void* userData,
NewtonWorldRayPrefilterCallback prefilter, NewtonWorldConvexCastReturnInfo* info, int maxContactsCount, int threadIndex);
// world utility functions
NEWTON_API int NewtonWorldGetBodyCount(const NewtonWorld* newtonWorld);
NEWTON_API int NewtonWorldGetConstraintCount(const NewtonWorld* newtonWorld);
// NEWTON_API int NewtonGetActiveBodiesCount();
// NEWTON_API int NewtonGetActiveConstraintsCount();
// NEWTON_API dFloat NewtonGetGlobalScale (const NewtonWorld* newtonWorld);
// **********************************************************************************************
//
// Simulation islands
//
// **********************************************************************************************
NEWTON_API NewtonBody* NewtonIslandGetBody (const void* island, int bodyIndex);
NEWTON_API void NewtonIslandGetBodyAABB (const void* island, int bodyIndex, const dFloat* p0, const dFloat* p1);
// **********************************************************************************************
//
// Physics Material Section
//
// **********************************************************************************************
NEWTON_API int NewtonMaterialCreateGroupID(const NewtonWorld* newtonWorld);
NEWTON_API int NewtonMaterialGetDefaultGroupID(const NewtonWorld* newtonWorld);
NEWTON_API void NewtonMaterialDestroyAllGroupID(const NewtonWorld* newtonWorld);
// material definitions that can not be overwritten in function callback
NEWTON_API void* NewtonMaterialGetUserData (const NewtonWorld* newtonWorld, int id0, int id1);
NEWTON_API void NewtonMaterialSetSurfaceThickness (const NewtonWorld* newtonWorld, int id0, int id1, dFloat thickness);
NEWTON_API void NewtonMaterialSetContinuousCollisionMode (const NewtonWorld* newtonWorld, int id0, int id1, int state);
NEWTON_API void NewtonMaterialSetCollisionCallback (const NewtonWorld* newtonWorld, int id0, int id1, void* userData,
NewtonOnAABBOverlap aabbOverlap, NewtonContactsProcess process);
NEWTON_API void NewtonMaterialSetDefaultSoftness (const NewtonWorld* newtonWorld, int id0, int id1, dFloat value);
NEWTON_API void NewtonMaterialSetDefaultElasticity (const NewtonWorld* newtonWorld, int id0, int id1, dFloat elasticCoef);
NEWTON_API void NewtonMaterialSetDefaultCollidable (const NewtonWorld* newtonWorld, int id0, int id1, int state);
NEWTON_API void NewtonMaterialSetDefaultFriction (const NewtonWorld* newtonWorld, int id0, int id1,
dFloat staticFriction, dFloat kineticFriction);
NEWTON_API NewtonMaterial* NewtonWorldGetFirstMaterial (const NewtonWorld* world);
NEWTON_API NewtonMaterial* NewtonWorldGetNextMaterial (const NewtonWorld* world, const NewtonMaterial* material);
NEWTON_API NewtonBody* NewtonWorldGetFirstBody (const NewtonWorld* world);
NEWTON_API NewtonBody* NewtonWorldGetNextBody (const NewtonWorld* world, const NewtonBody* curBody);
// **********************************************************************************************
//
// Physics Contact control functions
//
// **********************************************************************************************
NEWTON_API void *NewtonMaterialGetMaterialPairUserData (const NewtonMaterial* material);
NEWTON_API unsigned NewtonMaterialGetContactFaceAttribute (const NewtonMaterial* material);
NEWTON_API unsigned NewtonMaterialGetBodyCollisionID (const NewtonMaterial* material, const NewtonBody* body);
NEWTON_API dFloat NewtonMaterialGetContactNormalSpeed (const NewtonMaterial* material);
NEWTON_API void NewtonMaterialGetContactForce (const NewtonMaterial* material, dFloat* force);
NEWTON_API void NewtonMaterialGetContactPositionAndNormal (const NewtonMaterial* material, dFloat* posit, dFloat* normal);
NEWTON_API void NewtonMaterialGetContactTangentDirections (const NewtonMaterial* material, dFloat* dir0, dFloat* dir1);
NEWTON_API dFloat NewtonMaterialGetContactTangentSpeed (const NewtonMaterial* material, int index);
NEWTON_API void NewtonMaterialSetContactSoftness (const NewtonMaterial* material, dFloat softness);
NEWTON_API void NewtonMaterialSetContactElasticity (const NewtonMaterial* material, dFloat restitution);
NEWTON_API void NewtonMaterialSetContactFrictionState (const NewtonMaterial* material, int state, int index);
NEWTON_API void NewtonMaterialSetContactFrictionCoef (const NewtonMaterial* material, dFloat staticFrictionCoef, dFloat kineticFrictionCoef, int index);
NEWTON_API void NewtonMaterialSetContactNormalAcceleration (const NewtonMaterial* material, dFloat accel);
NEWTON_API void NewtonMaterialSetContactNormalDirection (const NewtonMaterial* material, const dFloat* directionVector);
NEWTON_API void NewtonMaterialSetContactTangentAcceleration (const NewtonMaterial* material, dFloat accel, int index);
NEWTON_API void NewtonMaterialContactRotateTangentDirections (const NewtonMaterial* material, const dFloat* directionVector);
// **********************************************************************************************
//
// convex collision primitives creation functions
//
// **********************************************************************************************
NEWTON_API NewtonCollision* NewtonCreateNull (const NewtonWorld* newtonWorld);
NEWTON_API NewtonCollision* NewtonCreateSphere (const NewtonWorld* newtonWorld, dFloat radiusX, dFloat radiusY, dFloat radiusZ, const dFloat *offsetMatrix);
NEWTON_API NewtonCollision* NewtonCreateBox (const NewtonWorld* newtonWorld, dFloat dx, dFloat dy, dFloat dz, const dFloat *offsetMatrix);
NEWTON_API NewtonCollision* NewtonCreateCone (const NewtonWorld* newtonWorld, dFloat radius, dFloat height, const dFloat *offsetMatrix);
NEWTON_API NewtonCollision* NewtonCreateCapsule (const NewtonWorld* newtonWorld, dFloat radius, dFloat height, const dFloat *offsetMatrix);
NEWTON_API NewtonCollision* NewtonCreateCylinder (const NewtonWorld* newtonWorld, dFloat radius, dFloat height, const dFloat *offsetMatrix);
NEWTON_API NewtonCollision* NewtonCreateChamferCylinder (const NewtonWorld* newtonWorld, dFloat radius, dFloat height, const dFloat *offsetMatrix);
NEWTON_API NewtonCollision* NewtonCreateConvexHull (const NewtonWorld* newtonWorld, int count, const dFloat* vertexCloud, int strideInBytes, dFloat tolerance, const dFloat *offsetMatrix);
NEWTON_API NewtonCollision* NewtonCreateConvexHullFromMesh (const NewtonWorld* newtonWorld, const NewtonMesh* mesh, dFloat tolerance);
NEWTON_API NewtonCollision* NewtonCreateConvexHullModifier (const NewtonWorld* newtonWorld, const NewtonCollision* convexHullCollision);
NEWTON_API void NewtonConvexHullModifierGetMatrix (const NewtonCollision* convexHullCollision, dFloat* matrix);
NEWTON_API void NewtonConvexHullModifierSetMatrix (const NewtonCollision* convexHullCollision, const dFloat* matrix);
NEWTON_API int NewtonCollisionIsTriggerVolume(const NewtonCollision* convexCollision);
NEWTON_API void NewtonCollisionSetAsTriggerVolume(const NewtonCollision* convexCollision, int trigger);
NEWTON_API void NewtonCollisionSetUserID (const NewtonCollision* convexCollision, unsigned id);
NEWTON_API unsigned NewtonCollisionGetUserID (const NewtonCollision* convexCollision);
NEWTON_API dFloat NewtonConvexCollisionCalculateVolume (const NewtonCollision* convexCollision);
NEWTON_API void NewtonConvexCollisionCalculateInertialMatrix (const NewtonCollision* convexCollision, dFloat* inertia, dFloat* origin);
NEWTON_API void NewtonCollisionMakeUnique (const NewtonWorld* newtonWorld, const NewtonCollision* collision);
NEWTON_API void NewtonReleaseCollision (const NewtonWorld* newtonWorld, const NewtonCollision* collision);
NEWTON_API int NewtonAddCollisionReference (const NewtonCollision* collision);
// **********************************************************************************************
//
// mass/spring/damper collision shape
//
// **********************************************************************************************
//NEWTON_API NewtonCollision* NewtonCreateSoftShape (const NewtonWorld* newtonWorld);
//NEWTON_API void NewtonSoftBodySetMassCount (const NewtonCollision* convexCollision, int count);
//NEWTON_API void NewtonSoftBodySetSpringCount (const NewtonCollision* convexCollision, int count);
//NEWTON_API void NewtonSoftBodySetMass (const NewtonCollision* convexCollision, int index, dFloat mass, dFloat* position);
//NEWTON_API int NewtonSoftBodySetSpring (const NewtonCollision* convexCollision, int index, int mass0, int mass1, dFloat stiffness, dFloat damper);
//NEWTON_API int NewtonSoftBodyGetMassArray (const NewtonCollision* convexCollision, dFloat* masses, dFloat** positions);
// **********************************************************************************************
//
// complex collision primitives creation functions
//
// **********************************************************************************************
NEWTON_API NewtonCollision* NewtonCreateCompoundCollision (const NewtonWorld* newtonWorld, int count, NewtonCollision* const collisionPrimitiveArray[]);
NEWTON_API NewtonCollision* NewtonCreateCompoundCollisionFromMesh (const NewtonWorld* newtonWorld, const NewtonMesh* mesh, dFloat concavity, int maxShapeCount);
NEWTON_API NewtonCollision* NewtonCreateUserMeshCollision (const NewtonWorld* newtonWorld, const dFloat *minBox,
const dFloat *maxBox, void *userData, NewtonUserMeshCollisionCollideCallback collideCallback,
NewtonUserMeshCollisionRayHitCallback rayHitCallback, NewtonUserMeshCollisionDestroyCallback destroyCallback,
NewtonUserMeshCollisionGetCollisionInfo getInfoCallback, NewtonUserMeshCollisionGetFacesInAABB facesInAABBCallback);
NEWTON_API NewtonCollision* NewtonCreateSceneCollision (const NewtonWorld* newtonWorld);
NEWTON_API NewtonSceneProxy* NewtonSceneCollisionCreateProxy (NewtonCollision* scene, NewtonCollision* collision);
NEWTON_API void NewtonSceneCollisionDestroyProxy (NewtonCollision* scene, NewtonSceneProxy* Proxy);
NEWTON_API void NewtonSceneProxySetMatrix (NewtonSceneProxy* proxy, const dFloat* matrix);
NEWTON_API void NewtonSceneProxyGetMatrix (NewtonSceneProxy* proxy, dFloat* matrix);
NEWTON_API void NewtonSceneCollisionOptimize (NewtonCollision* scene);
// ***********************************************************************************************************
//
//Collision serialization functions
//
// ***********************************************************************************************************
NEWTON_API NewtonCollision* NewtonCreateCollisionFromSerialization (const NewtonWorld* newtonWorld, NewtonDeserialize deserializeFunction, void* serializeHandle);
NEWTON_API void NewtonCollisionSerialize (const NewtonWorld* newtonWorld, const NewtonCollision* collision, NewtonSerialize serializeFunction, void* serializeHandle);
NEWTON_API void NewtonCollisionGetInfo (const NewtonCollision* collision, NewtonCollisionInfoRecord* collisionInfo);
// **********************************************************************************************
//
// Static collision shapes functions
//
// **********************************************************************************************
NEWTON_API NewtonCollision* NewtonCreateHeightFieldCollision (const NewtonWorld* newtonWorld, int width, int height, int gridsDiagonals,
unsigned short* elevationMap, char* attributeMap,
dFloat horizontalScale, dFloat verticalScale);
NEWTON_API NewtonCollision* NewtonCreateTreeCollision (const NewtonWorld* newtonWorld);
NEWTON_API void NewtonTreeCollisionSetUserRayCastCallback (const NewtonCollision* treeCollision, NewtonCollisionTreeRayCastCallback rayHitCallback);
NEWTON_API void NewtonTreeCollisionBeginBuild (const NewtonCollision* treeCollision);
NEWTON_API void NewtonTreeCollisionAddFace (const NewtonCollision* treeCollision, int vertexCount, const dFloat* vertexPtr, int strideInBytes, int faceAttribute);
NEWTON_API void NewtonTreeCollisionEndBuild (const NewtonCollision* treeCollision, int optimize);
NEWTON_API int NewtonTreeCollisionGetFaceAtribute (const NewtonCollision* treeCollision, const int* faceIndexArray);
NEWTON_API void NewtonTreeCollisionSetFaceAtribute (const NewtonCollision* treeCollision, const int* faceIndexArray, int attribute);
NEWTON_API int NewtonTreeCollisionGetVertexListIndexListInAABB (const NewtonCollision* treeCollision, const dFloat* p0, const dFloat* p1, const dFloat** vertexArray, int* vertexCount, int* vertexStrideInBytes, const int* indexList, int maxIndexCount, const int* faceAttribute);
NEWTON_API void NewtonStaticCollisionSetDebugCallback (const NewtonCollision* staticCollision, NewtonTreeCollisionCallback userCallback);
// **********************************************************************************************
//
// General purpose collision library functions
//
// **********************************************************************************************
NEWTON_API int NewtonCollisionPointDistance (const NewtonWorld* newtonWorld, const dFloat *point,
const NewtonCollision* collision, const dFloat* matrix, dFloat* contact, dFloat* normal, int threadIndex);
NEWTON_API int NewtonCollisionClosestPoint (const NewtonWorld* newtonWorld,
const NewtonCollision* collisionA, const dFloat* matrixA, const NewtonCollision* collisionB, const dFloat* matrixB,
dFloat* contactA, dFloat* contactB, dFloat* normalAB, int threadIndex);
NEWTON_API int NewtonCollisionCollide (const NewtonWorld* newtonWorld, int maxSize,
const NewtonCollision* collisionA, const dFloat* matrixA, const NewtonCollision* collisionB, const dFloat* matrixB,
dFloat* contacts, dFloat* normals, dFloat* penetration, int threadIndex);
NEWTON_API int NewtonCollisionCollideContinue (const NewtonWorld* newtonWorld, int maxSize, const dFloat timestep,
const NewtonCollision* collisionA, const dFloat* matrixA, const dFloat* velocA, const dFloat* omegaA,
const NewtonCollision* collisionB, const dFloat* matrixB, const dFloat* velocB, const dFloat* omegaB,
dFloat* timeOfImpact, dFloat* contacts, dFloat* normals, dFloat* penetration, int threadIndex);
NEWTON_API void NewtonCollisionSupportVertex (const NewtonCollision* collision, const dFloat* dir, dFloat* vertex);
NEWTON_API dFloat NewtonCollisionRayCast (const NewtonCollision* collision, const dFloat* p0, const dFloat* p1, dFloat* normals, int* attribute);
NEWTON_API void NewtonCollisionCalculateAABB (const NewtonCollision* collision, const dFloat *matrix, dFloat* p0, dFloat* p1);
NEWTON_API void NewtonCollisionForEachPolygonDo (const NewtonCollision* collision, const dFloat* matrix, NewtonCollisionIterator callback, void* userData);
// **********************************************************************************************
//
// transforms utility functions
//
// **********************************************************************************************
NEWTON_API void NewtonGetEulerAngle (const dFloat* matrix, dFloat* eulersAngles);
NEWTON_API void NewtonSetEulerAngle (const dFloat* eulersAngles, dFloat* matrix);
NEWTON_API dFloat NewtonCalculateSpringDamperAcceleration (dFloat dt, dFloat ks, dFloat x, dFloat kd, dFloat s);
// **********************************************************************************************
//
// body manipulation functions
//
// **********************************************************************************************
NEWTON_API NewtonBody* NewtonCreateBody (const NewtonWorld* newtonWorld, const NewtonCollision* collision);
NEWTON_API void NewtonDestroyBody(const NewtonWorld* newtonWorld, const NewtonBody* body);
NEWTON_API void NewtonBodyAddForce (const NewtonBody* body, const dFloat* force);
NEWTON_API void NewtonBodyAddTorque (const NewtonBody* body, const dFloat* torque);
NEWTON_API void NewtonBodyCalculateInverseDynamicsForce (const NewtonBody* body, dFloat timestep, const dFloat* desiredVeloc, dFloat* forceOut);
NEWTON_API void NewtonBodySetMatrix (const NewtonBody* body, const dFloat* matrix);
NEWTON_API void NewtonBodySetMatrixRecursive (const NewtonBody* body, const dFloat* matrix);
NEWTON_API void NewtonBodySetMassMatrix (const NewtonBody* body, dFloat mass, dFloat Ixx, dFloat Iyy, dFloat Izz);
NEWTON_API void NewtonBodySetMaterialGroupID (const NewtonBody* body, int id);
NEWTON_API void NewtonBodySetContinuousCollisionMode (const NewtonBody* body, unsigned state);
NEWTON_API void NewtonBodySetJointRecursiveCollision (const NewtonBody* body, unsigned state);
NEWTON_API void NewtonBodySetOmega (const NewtonBody* body, const dFloat* omega);
NEWTON_API void NewtonBodySetVelocity (const NewtonBody* body, const dFloat* velocity);
NEWTON_API void NewtonBodySetForce (const NewtonBody* body, const dFloat* force);
NEWTON_API void NewtonBodySetTorque (const NewtonBody* body, const dFloat* torque);
NEWTON_API void NewtonBodySetCentreOfMass (const NewtonBody* body, const dFloat* com);
NEWTON_API void NewtonBodySetLinearDamping (const NewtonBody* body, dFloat linearDamp);
NEWTON_API void NewtonBodySetAngularDamping (const NewtonBody* body, const dFloat* angularDamp);
NEWTON_API void NewtonBodySetUserData (const NewtonBody* body, void* userData);
NEWTON_API void NewtonBodySetCollision (const NewtonBody* body, const NewtonCollision* collision);
NEWTON_API int NewtonBodyGetSleepState (const NewtonBody* body);
NEWTON_API int NewtonBodyGetAutoSleep (const NewtonBody* body);
NEWTON_API void NewtonBodySetAutoSleep (const NewtonBody* body, int state);
NEWTON_API int NewtonBodyGetFreezeState(const NewtonBody* body);
NEWTON_API void NewtonBodySetFreezeState (const NewtonBody* body, int state);
//NEWTON_API void NewtonBodySetAutoFreeze(const NewtonBody* body, int state);
//NEWTON_API void NewtonBodyCoriolisForcesMode (const NewtonBody* body, int mode);
//NEWTON_API void NewtonBodySetGyroscopicForcesMode (const NewtonBody* body, int mode);
//NEWTON_API int NewtonBodyGetGyroscopicForcesMode (const NewtonBody* body);
//NEWTON_API int NewtonBodyGetFreezeState (const NewtonBody* body);
//NEWTON_API void NewtonBodySetFreezeState (const NewtonBody* body, int state);
//NEWTON_API void NewtonBodyGetFreezeTreshold (const NewtonBody* body, dFloat* freezeSpeed2, dFloat* freezeOmega2);
//NEWTON_API void NewtonBodySetFreezeTreshold (const NewtonBody* body, dFloat freezeSpeed2, dFloat freezeOmega2, int framesCount);
//NEWTON_API void NewtonBodySetAutoactiveCallback (const NewtonBody* body, NewtonBodyActivationState callback);
NEWTON_API void NewtonBodySetTransformCallback (const NewtonBody* body, NewtonSetTransform callback);
NEWTON_API void NewtonBodySetDestructorCallback (const NewtonBody* body, NewtonBodyDestructor callback);
NEWTON_API void NewtonBodySetForceAndTorqueCallback (const NewtonBody* body, NewtonApplyForceAndTorque callback);
NEWTON_API NewtonApplyForceAndTorque NewtonBodyGetForceAndTorqueCallback (const NewtonBody* body);
NEWTON_API void* NewtonBodyGetUserData (const NewtonBody* body);
NEWTON_API NewtonWorld* NewtonBodyGetWorld (const NewtonBody* body);
NEWTON_API NewtonCollision* NewtonBodyGetCollision (const NewtonBody* body);
NEWTON_API int NewtonBodyGetMaterialGroupID (const NewtonBody* body);
NEWTON_API int NewtonBodyGetContinuousCollisionMode (const NewtonBody* body);
NEWTON_API int NewtonBodyGetJointRecursiveCollision (const NewtonBody* body);
NEWTON_API void NewtonBodyGetMatrix(const NewtonBody* body, dFloat* matrix);
NEWTON_API void NewtonBodyGetRotation(const NewtonBody* body, dFloat* rotation);
NEWTON_API void NewtonBodyGetMassMatrix (const NewtonBody* body, dFloat* mass, dFloat* Ixx, dFloat* Iyy, dFloat* Izz);
NEWTON_API void NewtonBodyGetInvMass(const NewtonBody* body, dFloat* invMass, dFloat* invIxx, dFloat* invIyy, dFloat* invIzz);
NEWTON_API void NewtonBodyGetOmega(const NewtonBody* body, dFloat* vector);
NEWTON_API void NewtonBodyGetVelocity(const NewtonBody* body, dFloat* vector);
NEWTON_API void NewtonBodyGetForce(const NewtonBody* body, dFloat* vector);
NEWTON_API void NewtonBodyGetTorque(const NewtonBody* body, dFloat* vector);
NEWTON_API void NewtonBodyGetForceAcc(const NewtonBody* body, dFloat* vector);
NEWTON_API void NewtonBodyGetTorqueAcc(const NewtonBody* body, dFloat* vector);
NEWTON_API void NewtonBodyGetCentreOfMass (const NewtonBody* body, dFloat* com);
NEWTON_API dFloat NewtonBodyGetLinearDamping (const NewtonBody* body);
NEWTON_API void NewtonBodyGetAngularDamping (const NewtonBody* body, dFloat* vector);
NEWTON_API void NewtonBodyGetAABB (const NewtonBody* body, dFloat* p0, dFloat* p1);
NEWTON_API NewtonJoint* NewtonBodyGetFirstJoint (const NewtonBody* body);
NEWTON_API NewtonJoint* NewtonBodyGetNextJoint (const NewtonBody* body, const NewtonJoint* joint);
NEWTON_API NewtonJoint* NewtonBodyGetFirstContactJoint (const NewtonBody* body);
NEWTON_API NewtonJoint* NewtonBodyGetNextContactJoint (const NewtonBody* body, const NewtonJoint* contactJoint);
NEWTON_API void* NewtonContactJointGetFirstContact (const NewtonJoint* contactJoint);
NEWTON_API void* NewtonContactJointGetNextContact (const NewtonJoint* contactJoint, void* contact);
NEWTON_API int NewtonContactJointGetContactCount(const NewtonJoint* contactJoint);
NEWTON_API void NewtonContactJointRemoveContact(const NewtonJoint* contactJoint, void* contact);
NEWTON_API NewtonMaterial* NewtonContactGetMaterial (const void* contact);
NEWTON_API void NewtonBodyAddBuoyancyForce (const NewtonBody* body, dFloat fluidDensity,
dFloat fluidLinearViscosity, dFloat fluidAngularViscosity,
const dFloat* gravityVector, NewtonGetBuoyancyPlane buoyancyPlane, void *context);
//NEWTON_API void NewtonBodyForEachPolygonDo (const NewtonBody* body, NewtonCollisionIterator callback);
NEWTON_API void NewtonBodyAddImpulse (const NewtonBody* body, const dFloat* pointDeltaVeloc, const dFloat* pointPosit);
// **********************************************************************************************
//
// Common joint functions
//
// **********************************************************************************************
NEWTON_API void* NewtonJointGetUserData (const NewtonJoint* joint);
NEWTON_API void NewtonJointSetUserData (const NewtonJoint* joint, void* userData);
NEWTON_API NewtonBody* NewtonJointGetBody0 (const NewtonJoint* joint);
NEWTON_API NewtonBody* NewtonJointGetBody1 (const NewtonJoint* joint);
NEWTON_API void NewtonJointGetInfo (const NewtonJoint* joint, NewtonJointRecord* info);
NEWTON_API int NewtonJointGetCollisionState (const NewtonJoint* joint);
NEWTON_API void NewtonJointSetCollisionState (const NewtonJoint* joint, int state);
NEWTON_API dFloat NewtonJointGetStiffness (const NewtonJoint* joint);
NEWTON_API void NewtonJointSetStiffness (const NewtonJoint* joint, dFloat state);
NEWTON_API void NewtonDestroyJoint(const NewtonWorld* newtonWorld, const NewtonJoint* joint);
NEWTON_API void NewtonJointSetDestructor (const NewtonJoint* joint, NewtonConstraintDestructor destructor);
// **********************************************************************************************
//
// Ball and Socket joint functions
//
// **********************************************************************************************
NEWTON_API NewtonJoint* NewtonConstraintCreateBall (const NewtonWorld* newtonWorld, const dFloat* pivotPoint,
const NewtonBody* childBody, const NewtonBody* parentBody);
NEWTON_API void NewtonBallSetUserCallback (const NewtonJoint* ball, NewtonBallCallBack callback);
NEWTON_API void NewtonBallGetJointAngle (const NewtonJoint* ball, dFloat* angle);
NEWTON_API void NewtonBallGetJointOmega (const NewtonJoint* ball, dFloat* omega);
NEWTON_API void NewtonBallGetJointForce (const NewtonJoint* ball, dFloat* force);
NEWTON_API void NewtonBallSetConeLimits (const NewtonJoint* ball, const dFloat* pin, dFloat maxConeAngle, dFloat maxTwistAngle);
// **********************************************************************************************
//
// Hinge joint functions
//
// **********************************************************************************************
NEWTON_API NewtonJoint* NewtonConstraintCreateHinge (const NewtonWorld* newtonWorld,
const dFloat* pivotPoint, const dFloat* pinDir,
const NewtonBody* childBody, const NewtonBody* parentBody);
NEWTON_API void NewtonHingeSetUserCallback (const NewtonJoint* hinge, NewtonHingeCallBack callback);
NEWTON_API dFloat NewtonHingeGetJointAngle (const NewtonJoint* hinge);
NEWTON_API dFloat NewtonHingeGetJointOmega (const NewtonJoint* hinge);
NEWTON_API void NewtonHingeGetJointForce (const NewtonJoint* hinge, dFloat* force);
NEWTON_API dFloat NewtonHingeCalculateStopAlpha (const NewtonJoint* hinge, const NewtonHingeSliderUpdateDesc* desc, dFloat angle);
// **********************************************************************************************
//
// Slider joint functions
//
// **********************************************************************************************
NEWTON_API NewtonJoint* NewtonConstraintCreateSlider (const NewtonWorld* newtonWorld,
const dFloat* pivotPoint, const dFloat* pinDir,
const NewtonBody* childBody, const NewtonBody* parentBody);
NEWTON_API void NewtonSliderSetUserCallback (const NewtonJoint* slider, NewtonSliderCallBack callback);
NEWTON_API dFloat NewtonSliderGetJointPosit (const NewtonJoint* slider);
NEWTON_API dFloat NewtonSliderGetJointVeloc (const NewtonJoint* slider);
NEWTON_API void NewtonSliderGetJointForce (const NewtonJoint* slider, dFloat* force);
NEWTON_API dFloat NewtonSliderCalculateStopAccel (const NewtonJoint* slider, const NewtonHingeSliderUpdateDesc* desc, dFloat position);
// **********************************************************************************************
//
// Corkscrew joint functions
//
// **********************************************************************************************
NEWTON_API NewtonJoint* NewtonConstraintCreateCorkscrew (const NewtonWorld* newtonWorld,
const dFloat* pivotPoint, const dFloat* pinDir,
const NewtonBody* childBody, const NewtonBody* parentBody);
NEWTON_API void NewtonCorkscrewSetUserCallback (const NewtonJoint* corkscrew, NewtonCorkscrewCallBack callback);
NEWTON_API dFloat NewtonCorkscrewGetJointPosit (const NewtonJoint* corkscrew);
NEWTON_API dFloat NewtonCorkscrewGetJointAngle (const NewtonJoint* corkscrew);
NEWTON_API dFloat NewtonCorkscrewGetJointVeloc (const NewtonJoint* corkscrew);
NEWTON_API dFloat NewtonCorkscrewGetJointOmega (const NewtonJoint* corkscrew);
NEWTON_API void NewtonCorkscrewGetJointForce (const NewtonJoint* corkscrew, dFloat* force);
NEWTON_API dFloat NewtonCorkscrewCalculateStopAlpha (const NewtonJoint* corkscrew, const NewtonHingeSliderUpdateDesc* desc, dFloat angle);
NEWTON_API dFloat NewtonCorkscrewCalculateStopAccel (const NewtonJoint* corkscrew, const NewtonHingeSliderUpdateDesc* desc, dFloat position);
// **********************************************************************************************
//
// Universal joint functions
//
// **********************************************************************************************
NEWTON_API NewtonJoint* NewtonConstraintCreateUniversal (const NewtonWorld* newtonWorld,
const dFloat* pivotPoint, const dFloat* pinDir0, const dFloat* pinDir1,
const NewtonBody* childBody, const NewtonBody* parentBody);
NEWTON_API void NewtonUniversalSetUserCallback (const NewtonJoint* universal, NewtonUniversalCallBack callback);
NEWTON_API dFloat NewtonUniversalGetJointAngle0 (const NewtonJoint* universal);
NEWTON_API dFloat NewtonUniversalGetJointAngle1 (const NewtonJoint* universal);
NEWTON_API dFloat NewtonUniversalGetJointOmega0 (const NewtonJoint* universal);
NEWTON_API dFloat NewtonUniversalGetJointOmega1 (const NewtonJoint* universal);
NEWTON_API void NewtonUniversalGetJointForce (const NewtonJoint* universal, dFloat* force);
NEWTON_API dFloat NewtonUniversalCalculateStopAlpha0 (const NewtonJoint* universal, const NewtonHingeSliderUpdateDesc* desc, dFloat angle);
NEWTON_API dFloat NewtonUniversalCalculateStopAlpha1 (const NewtonJoint* universal, const NewtonHingeSliderUpdateDesc* desc, dFloat angle);
// **********************************************************************************************
//
// Up vector joint functions
//
// **********************************************************************************************
NEWTON_API NewtonJoint* NewtonConstraintCreateUpVector (const NewtonWorld* newtonWorld, const dFloat* pinDir, const NewtonBody* body);
NEWTON_API void NewtonUpVectorGetPin (const NewtonJoint* upVector, dFloat *pin);
NEWTON_API void NewtonUpVectorSetPin (const NewtonJoint* upVector, const dFloat *pin);
// **********************************************************************************************
//
// User defined bilateral Joint
//
// **********************************************************************************************
NEWTON_API NewtonJoint* NewtonConstraintCreateUserJoint (const NewtonWorld* newtonWorld, int maxDOF,
NewtonUserBilateralCallBack callback,
NewtonUserBilateralGetInfoCallBack getInfo,
const NewtonBody* childBody, const NewtonBody* parentBody) ;
NEWTON_API void NewtonUserJointSetFeedbackCollectorCallback (const NewtonJoint* joint, NewtonUserBilateralCallBack getFeedback);
NEWTON_API void NewtonUserJointAddLinearRow (const NewtonJoint* joint, const dFloat *pivot0, const dFloat *pivot1, const dFloat *dir);
NEWTON_API void NewtonUserJointAddAngularRow (const NewtonJoint* joint, dFloat relativeAngle, const dFloat *dir);
NEWTON_API void NewtonUserJointAddGeneralRow (const NewtonJoint* joint, const dFloat *jacobian0, const dFloat *jacobian1);
NEWTON_API void NewtonUserJointSetRowMinimumFriction (const NewtonJoint* joint, dFloat friction);
NEWTON_API void NewtonUserJointSetRowMaximumFriction (const NewtonJoint* joint, dFloat friction);
NEWTON_API void NewtonUserJointSetRowAcceleration (const NewtonJoint* joint, dFloat acceleration);
NEWTON_API void NewtonUserJointSetRowSpringDamperAcceleration (const NewtonJoint* joint, dFloat springK, dFloat springD);
NEWTON_API void NewtonUserJointSetRowStiffness (const NewtonJoint* joint, dFloat stiffness);
NEWTON_API dFloat NewtonUserJointGetRowForce (const NewtonJoint* joint, int row);
// **********************************************************************************************
//
// Mesh joint functions
//
// **********************************************************************************************
NEWTON_API NewtonMesh* NewtonMeshCreate();
NEWTON_API NewtonMesh* NewtonMeshCreateFromCollision(const NewtonCollision* collision);
NEWTON_API void NewtonMeshDestroy(const NewtonMesh*mesh);
NEWTON_API void NewtonMeshCalculateVertexNormals(const NewtonMesh* mesh, dFloat angleInRadians);
NEWTON_API void NewtonMeshApplySphericalMapping(const NewtonMesh* mesh, int material);
NEWTON_API void NewtonMeshApplyBoxMapping(const NewtonMesh* mesh, int front, int side, int top);
NEWTON_API void NewtonMeshApplyCylindricalMapping(const NewtonMesh* mesh, int cylinderMaterial, int capMaterial);
NEWTON_API int NewtonMeshPlaneClip (const NewtonMesh* mesh,
const dFloat* plane, const dFloat* textureProjectionMatrix,
NewtonMesh** meshOut, int maxMeshCount, int capMaterial);
NEWTON_API void NewtonMeshBeginFace(const NewtonMesh *mesh);
NEWTON_API void NewtonMeshAddFace(const NewtonMesh *mesh, int vertexCount, const dFloat* vertex, int strideInBytes, int materialIndex);
NEWTON_API void NewtonMeshEndFace(const NewtonMesh *mesh);
NEWTON_API int NewtonMeshGetVertexCount (const NewtonMesh *mesh);
NEWTON_API void NewtonMeshGetVertexStreams (const NewtonMesh *mesh,
int vertexStrideInByte, dFloat* vertex,
int normalStrideInByte, dFloat* normal,
int uvStrideInByte, dFloat* uv);
NEWTON_API void NewtonMeshGetIndirectVertexStreams(const NewtonMesh *mesh,
int vertexStrideInByte, dFloat* vertex, int* vertexIndices, int* vertexCount,
int normalStrideInByte, dFloat* normal, int* normalIndices, int* normalCount,
int uvStrideInByte, dFloat* uv, int* uvIndices, int* uvCount);
NEWTON_API int NewtonMeshFirstMaterial (const NewtonMesh *mesh);
NEWTON_API int NewtonMeshNextMaterial (const NewtonMesh *mesh, int materialHandle);
NEWTON_API int NewtonMeshMaterialGetMaterial (const NewtonMesh *mesh, int materialHandle);
NEWTON_API int NewtonMeshMaterialGetIndexCount (const NewtonMesh *mesh, int materialHandle);
NEWTON_API void NewtonMeshMaterialGetIndexStream (const NewtonMesh *mesh, int materialHandle, int* index);
NEWTON_API void NewtonMeshMaterialGetIndexStreamShort (const NewtonMesh *mesh, int materialHandle, short int* index);
// **********************************************************************************************
//
// Rag doll joint container functions
//
// **********************************************************************************************
//NEWTON_API NewtonRagDoll* NewtonCreateRagDoll (const NewtonWorld* newtonWorld);
//NEWTON_API void NewtonDestroyRagDoll (const NewtonWorld* newtonWorld, const NewtonRagDoll* ragDoll);
//NEWTON_API void NewtonRagDollBegin (const NewtonRagDoll* ragDoll);
//NEWTON_API void NewtonRagDollEnd (const NewtonRagDoll* ragDoll);
//NEWTON_API NewtonRagDollBone* NewtonRagDollFindBone (const NewtonRagDoll* ragDoll, int id);
//NEWTON_API void NewtonRagDollSetForceAndTorqueCallback (const NewtonRagDoll* ragDoll, NewtonApplyForceAndTorque callback);
//NEWTON_API void NewtonRagDollSetTransformCallback (const NewtonRagDoll* ragDoll, NewtonSetRagDollTransform callback);
//NEWTON_API NewtonRagDollBone* NewtonRagDollAddBone (const NewtonRagDoll* ragDoll, const NewtonRagDollBone* parent,
//void *userData, dFloat mass, const dFloat* matrix,
//const NewtonCollision* boneCollision, const dFloat* size);
//NEWTON_API void* NewtonRagDollBoneGetUserData (const NewtonRagDollBone* bone);
//NEWTON_API NewtonBody* NewtonRagDollBoneGetBody (const NewtonRagDollBone* bone);
//NEWTON_API void NewtonRagDollBoneSetID (const NewtonRagDollBone* bone, int id);
//NEWTON_API void NewtonRagDollBoneSetLimits (const NewtonRagDollBone* bone,
//const dFloat* coneDir, dFloat minConeAngle, dFloat maxConeAngle, dFloat maxTwistAngle,
//const dFloat* bilateralConeDir, dFloat negativeBilateralConeAngle, dFloat positiveBilateralConeAngle);
//NEWTON_API void NewtonRagDollBoneGetLocalMatrix (const NewtonRagDollBone* bone, dFloat* matrix);
//NEWTON_API void NewtonRagDollBoneGetGlobalMatrix (const NewtonRagDollBone* bone, dFloat* matrix);
// **********************************************************************************************
//
// Vehicle joint functions
//
// **********************************************************************************************
//NEWTON_API NewtonJoint* NewtonConstraintCreateVehicle (const NewtonWorld* newtonWorld, const dFloat* upDir, const NewtonBody* body);
//NEWTON_API void NewtonVehicleReset (const NewtonJoint* vehicle);
//NEWTON_API void NewtonVehicleSetTireCallback (const NewtonJoint* vehicle, NewtonVehicleTireUpdate update);
//NEWTON_API void* NewtonVehicleAddTire (const NewtonJoint* vehicle, const dFloat* localMatrix, const dFloat* pin, dFloat mass, dFloat width, dFloat radius, dFloat suspesionShock, dFloat suspesionSpring, dFloat suspesionLength, void* userData, int collisionID);
//NEWTON_API void NewtonVehicleRemoveTire (const NewtonJoint* vehicle, void* tireId);
//NEWTON_API void* NewtonVehicleGetFirstTireID (const NewtonJoint* vehicle);
//NEWTON_API void* NewtonVehicleGetNextTireID (const NewtonJoint* vehicle, void* tireId);
//NEWTON_API int NewtonVehicleTireIsAirBorne (const NewtonJoint* vehicle, void* tireId);
//NEWTON_API int NewtonVehicleTireLostSideGrip (const NewtonJoint* vehicle, void* tireId);
//NEWTON_API int NewtonVehicleTireLostTraction (const NewtonJoint* vehicle, void* tireId);
//NEWTON_API void* NewtonVehicleGetTireUserData (const NewtonJoint* vehicle, void* tireId);
//NEWTON_API dFloat NewtonVehicleGetTireOmega (const NewtonJoint* vehicle, void* tireId);
//NEWTON_API dFloat NewtonVehicleGetTireNormalLoad (const NewtonJoint* vehicle, void* tireId);
//NEWTON_API dFloat NewtonVehicleGetTireSteerAngle (const NewtonJoint* vehicle, void* tireId);
//NEWTON_API dFloat NewtonVehicleGetTireLateralSpeed (const NewtonJoint* vehicle, void* tireId);
//NEWTON_API dFloat NewtonVehicleGetTireLongitudinalSpeed (const NewtonJoint* vehicle, void* tireId);
//NEWTON_API void NewtonVehicleGetTireMatrix (const NewtonJoint* vehicle, void* tireId, dFloat* matrix);
//NEWTON_API void NewtonVehicleSetTireTorque (const NewtonJoint* vehicle, void* tireId, dFloat torque);
//NEWTON_API void NewtonVehicleSetTireSteerAngle (const NewtonJoint* vehicle, void* tireId, dFloat angle);
//NEWTON_API void NewtonVehicleSetTireMaxSideSleepSpeed (const NewtonJoint* vehicle, void* tireId, dFloat speed);
//NEWTON_API void NewtonVehicleSetTireSideSleepCoeficient (const NewtonJoint* vehicle, void* tireId, dFloat coeficient);
//NEWTON_API void NewtonVehicleSetTireMaxLongitudinalSlideSpeed (const NewtonJoint* vehicle, void* tireId, dFloat speed);
//NEWTON_API void NewtonVehicleSetTireLongitudinalSlideCoeficient (const NewtonJoint* vehicle, void* tireId, dFloat coeficient);
//NEWTON_API dFloat NewtonVehicleTireCalculateMaxBrakeAcceleration (const NewtonJoint* vehicle, void* tireId);
//NEWTON_API void NewtonVehicleTireSetBrakeAcceleration (const NewtonJoint* vehicle, void* tireId, dFloat accelaration, dFloat torqueLimit);
#ifdef __cplusplus
}
#endif
#endif
WIP/dlls/newton.map
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
newton
Timestamp is 498f8e01 (Sun Feb 08 17:59:29 2009)
Preferred load address is 10000000
Start Length Name Class
0001:00000000 0008cdb4H .text CODE
0001:0008cdc0 0000000cH .text$yc CODE
0001:0008cdd0 00000001H .text$yd CODE
0002:00000000 0000014cH .idata$5 DATA
0002:0000014c 00000004H .CRT$XCA DATA
0002:00000150 00000004H .CRT$XCU DATA
0002:00000154 00000004H .CRT$XCZ DATA
0002:00000158 00000004H .CRT$XIA DATA
0002:0000015c 00000014H .CRT$XIC DATA
0002:00000170 00000004H .CRT$XIZ DATA
0002:00000174 00000004H .CRT$XPA DATA
0002:00000178 00000004H .CRT$XPX DATA
0002:0000017c 00000004H .CRT$XPXA DATA
0002:00000180 00000004H .CRT$XPZ DATA
0002:00000184 00000004H .CRT$XTA DATA
0002:00000188 00000004H .CRT$XTZ DATA
0002:00000190 00006938H .rdata DATA
0002:00006ac8 00000055H .rdata$debug DATA
0002:00006b20 00000010H .rdata$sxdata DATA
0002:00006b30 00000004H .rtc$IAA DATA
0002:00006b34 00000004H .rtc$IZZ DATA
0002:00006b38 00000004H .rtc$TAA DATA
0002:00006b3c 00000004H .rtc$TZZ DATA
0002:00006b40 00000404H .xdata$x DATA
0002:00006f44 00000014H .idata$2 DATA
0002:00006f58 00000014H .idata$3 DATA
0002:00006f6c 0000014cH .idata$4 DATA
0002:000070b8 000005f0H .idata$6 DATA
0002:000076b0 0000267dH .edata DATA
0003:00000000 00001e10H .data DATA
0003:00001e20 000040c4H .bss DATA
Address Publics by Value Rva+Base Lib:Object
0000:00000000 __except_list 00000000 <absolute>
0000:00000004 ___safe_se_handler_count 00000004 <absolute>
0000:00000000 ___ImageBase 10000000 <linker-defined>
0001:00000000 _DllMain@12 10001000 f Newton.obj
0001:00000010 _NewtonGetMemoryUsed 10001010 f Newton.obj
0001:00000020 _NewtonInvalidateCache 10001020 f Newton.obj
0001:00000030 _NewtonSetPlatformArchitecture 10001030 f Newton.obj
0001:00000040 _NewtonGetPlatformArchitecture 10001040 f Newton.obj
0001:00000050 _NewtonSetThreadsCount 10001050 f Newton.obj
0001:00000060 _NewtonGetThreadsCount 10001060 f Newton.obj
0001:00000070 _NewtonSetMultiThreadSolverOnSingleIsland 10001070 f Newton.obj
0001:00000080 _NewtonSetSolverModel 10001080 f Newton.obj
0001:00000090 _NewtonSetFrictionModel 10001090 f Newton.obj
0001:000000a0 _NewtonSetPerformanceClock 100010a0 f Newton.obj
0001:000000b0 _NewtonReadPerformanceTicks 100010b0 f Newton.obj
0001:000000d0 _NewtonCollisionUpdate 100010d0 f Newton.obj
0001:00000100 _NewtonSetIslandUpdateEvent 10001100 f Newton.obj
0001:00000110 _NewtonSetBodyLeaveWorldEvent 10001110 f Newton.obj
0001:00000120 _NewtonWorldGetVersion 10001120 f Newton.obj
0001:00000130 _NewtonWorldSetUserData 10001130 f Newton.obj
0001:00000140 _NewtonWorldGetUserData 10001140 f Newton.obj
0001:00000150 _NewtonWorldGetBodyCount 10001150 f Newton.obj
0001:00000160 _NewtonWorldGetConstraintCount 10001160 f Newton.obj
0001:00000170 _NewtonIslandGetBody 10001170 f Newton.obj
0001:00000190 _NewtonMaterialGetDefaultGroupID 10001190 f Newton.obj
0001:000001a0 _NewtonMaterialCreateGroupID 100011a0 f Newton.obj
0001:000001b0 _NewtonMaterialDestroyAllGroupID 100011b0 f Newton.obj
0001:000001c0 _NewtonMaterialSetDefaultCollidable 100011c0 f Newton.obj
0001:000001f0 _NewtonMaterialSetContinuousCollisionMode 100011f0 f Newton.obj
0001:00000220 _NewtonWorldGetFirstMaterial 10001220 f Newton.obj
0001:00000230 _NewtonWorldGetNextMaterial 10001230 f Newton.obj
0001:00000240 _NewtonMaterialGetContactFaceAttribute 10001240 f Newton.obj
0001:00000250 _NewtonMaterialGetContactPositionAndNormal 10001250 f Newton.obj
0001:00000280 _NewtonMaterialGetContactTangentDirections 10001280 f Newton.obj
0001:000002b0 _NewtonMaterialSetContactFrictionState 100012b0 f Newton.obj
0001:00000300 _NewtonMaterialSetContactNormalAcceleration 10001300 f Newton.obj
0001:00000320 _NewtonMaterialSetContactTangentAcceleration 10001320 f Newton.obj
0001:00000350 _NewtonCreateNull 10001350 f Newton.obj
0001:00000360 _NewtonCreateBox 10001360 f Newton.obj
0001:000003c0 _NewtonCreateSphere 100013c0 f Newton.obj
0001:000004b0 _NewtonCreateCone 100014b0 f Newton.obj
0001:00000510 _NewtonCreateCapsule 10001510 f Newton.obj
0001:00000570 _NewtonCreateCylinder 10001570 f Newton.obj
0001:000005d0 _NewtonCreateChamferCylinder 100015d0 f Newton.obj
0001:00000630 _NewtonCreateConvexHullFromMesh 10001630 f Newton.obj
0001:00000650 _NewtonCreateConvexHullModifier 10001650 f Newton.obj
0001:00000660 _NewtonConvexHullModifierGetMatrix 10001660 f Newton.obj
0001:00000690 _NewtonConvexHullModifierSetMatrix 10001690 f Newton.obj
0001:000006b0 _NewtonCreateCompoundCollision 100016b0 f Newton.obj
0001:000006d0 _NewtonCreateCompoundCollisionFromMesh 100016d0 f Newton.obj
0001:000006f0 _NewtonCollisionIsTriggerVolume 100016f0 f Newton.obj
0001:00000710 _NewtonCollisionSetAsTriggerVolume 10001710 f Newton.obj
0001:00000730 _NewtonConvexCollisionCalculateVolume 10001730 f Newton.obj
0001:00000740 _NewtonCreateTreeCollision 10001740 f Newton.obj
0001:00000750 _NewtonTreeCollisionSetUserRayCastCallback 10001750 f Newton.obj
0001:00000760 _NewtonTreeCollisionBeginBuild 10001760 f Newton.obj
0001:00000770 _NewtonTreeCollisionAddFace 10001770 f Newton.obj
0001:00000790 _NewtonTreeCollisionEndBuild 10001790 f Newton.obj
0001:000007a0 _NewtonCreateHeightFieldCollision 100017a0 f Newton.obj
0001:000007e0 _NewtonCreateSceneCollision 100017e0 f Newton.obj
0001:000007f0 _NewtonSceneCollisionCreateProxy 100017f0 f Newton.obj
0001:00000800 _NewtonSceneCollisionOptimize 10001800 f Newton.obj
0001:00000810 _NewtonCollisionPointDistance 10001810 f Newton.obj
0001:00000840 _NewtonCollisionClosestPoint 10001840 f Newton.obj
0001:00000880 _NewtonCollisionCollide 10001880 f Newton.obj
0001:000008c0 _NewtonCollisionCollideContinue 100018c0 f Newton.obj
0001:00000920 _NewtonCollisionForEachPolygonDo 10001920 f Newton.obj
0001:00000960 _NewtonCollisionMakeUnique 10001960 f Newton.obj
0001:00000970 _NewtonReleaseCollision 10001970 f Newton.obj
0001:00000980 _NewtonCollisionSerialize 10001980 f Newton.obj
0001:000009a0 _NewtonCreateCollisionFromSerialization 100019a0 f Newton.obj
0001:000009c0 _NewtonCollisionGetInfo 100019c0 f Newton.obj
0001:000009e0 _NewtonGetEulerAngle 100019e0 f Newton.obj
0001:00000a10 _NewtonCalculateSpringDamperAcceleration 10001a10 f Newton.obj
0001:00000a80 _NewtonCreateBody 10001a80 f Newton.obj
0001:00000a90 _NewtonDestroyBody 10001a90 f Newton.obj
0001:00000aa0 _NewtonBodySetMatrix 10001aa0 f Newton.obj
0001:00000ae0 _NewtonBodyGetFirstJoint 10001ae0 f Newton.obj
0001:00000af0 _NewtonBodyGetNextJoint 10001af0 f Newton.obj
0001:00000b00 _NewtonBodyGetFirstContactJoint 10001b00 f Newton.obj
0001:00000b10 _NewtonBodyGetNextContactJoint 10001b10 f Newton.obj
0001:00000b20 _NewtonBodySetCollision 10001b20 f Newton.obj
0001:00000b30 _NewtonBodySetFreezeState 10001b30 f Newton.obj
0001:00000b50 _NewtonBallSetUserCallback 10001b50 f Newton.obj
0001:00000b60 _NewtonBallGetJointAngle 10001b60 f Newton.obj
0001:00000b90 _NewtonBallGetJointOmega 10001b90 f Newton.obj
0001:00000bc0 _NewtonBallGetJointForce 10001bc0 f Newton.obj
0001:00000bf0 _NewtonSliderSetUserCallback 10001bf0 f Newton.obj
0001:00000bf0 _NewtonHingeSetUserCallback 10001bf0 f Newton.obj
0001:00000c00 _NewtonHingeGetJointAngle 10001c00 f Newton.obj
0001:00000c00 _NewtonSliderGetJointPosit 10001c00 f Newton.obj
0001:00000c00 _NewtonCorkscrewGetJointAngle 10001c00 f Newton.obj
0001:00000c00 _NewtonUniversalGetJointAngle0 10001c00 f Newton.obj
0001:00000c10 _NewtonHingeCalculateStopAlpha 10001c10 f Newton.obj
0001:00000c30 _NewtonHingeGetJointForce 10001c30 f Newton.obj
0001:00000c60 _NewtonSliderCalculateStopAccel 10001c60 f Newton.obj
0001:00000c80 _NewtonSliderGetJointForce 10001c80 f Newton.obj
0001:00000cb0 _NewtonUniversalSetUserCallback 10001cb0 f Newton.obj
0001:00000cb0 _NewtonCorkscrewSetUserCallback 10001cb0 f Newton.obj
0001:00000cc0 _NewtonSliderGetJointVeloc 10001cc0 f Newton.obj
0001:00000cc0 _NewtonCorkscrewGetJointVeloc 10001cc0 f Newton.obj
0001:00000cd0 _NewtonCorkscrewCalculateStopAccel 10001cd0 f Newton.obj
0001:00000cf0 _NewtonCorkscrewGetJointPosit 10001cf0 f Newton.obj
0001:00000cf0 _NewtonUniversalGetJointAngle1 10001cf0 f Newton.obj
0001:00000d00 _NewtonCorkscrewGetJointOmega 10001d00 f Newton.obj
0001:00000d00 _NewtonUniversalGetJointOmega0 10001d00 f Newton.obj
0001:00000d00 _NewtonHingeGetJointOmega 10001d00 f Newton.obj
0001:00000d10 _NewtonUniversalGetJointOmega1 10001d10 f Newton.obj
0001:00000d20 _NewtonCorkscrewCalculateStopAlpha 10001d20 f Newton.obj
0001:00000d20 _NewtonUniversalCalculateStopAlpha0 10001d20 f Newton.obj
0001:00000d40 _NewtonUniversalCalculateStopAlpha1 10001d40 f Newton.obj
0001:00000d60 _NewtonUniversalGetJointForce 10001d60 f Newton.obj
0001:00000d60 _NewtonCorkscrewGetJointForce 10001d60 f Newton.obj
0001:00000d90 _NewtonUpVectorGetPin 10001d90 f Newton.obj
0001:00000dc0 _NewtonUserJointAddGeneralRow 10001dc0 f Newton.obj
0001:00000de0 _NewtonUserJointSetRowMaximumFriction 10001de0 f Newton.obj
0001:00000e00 _NewtonUserJointSetRowMinimumFriction 10001e00 f Newton.obj
0001:00000e20 _NewtonUserJointSetRowAcceleration 10001e20 f Newton.obj
0001:00000e40 _NewtonUserJointSetRowSpringDamperAcceleration 10001e40 f Newton.obj
0001:00000e60 _NewtonUserJointSetRowStiffness 10001e60 f Newton.obj
0001:00000e80 _NewtonUserJointGetRowForce 10001e80 f Newton.obj
0001:00000e90 _NewtonUserJointSetFeedbackCollectorCallback 10001e90 f Newton.obj
0001:00000ea0 _NewtonJointSetUserData 10001ea0 f Newton.obj
0001:00000eb0 _NewtonJointGetUserData 10001eb0 f Newton.obj
0001:00000ec0 _NewtonJointGetInfo 10001ec0 f Newton.obj
0001:00000ee0 _NewtonJointSetStiffness 10001ee0 f Newton.obj
0001:00000f00 _NewtonJointGetStiffness 10001f00 f Newton.obj
0001:00000f10 _NewtonJointSetDestructor 10001f10 f Newton.obj
0001:00000f20 _NewtonDestroyJoint 10001f20 f Newton.obj
0001:00000f30 _NewtonMeshDestroy 10001f30 f Newton.obj
0001:00000f50 _NewtonMeshCalculateVertexNormals 10001f50 f Newton.obj
0001:00000f70 _NewtonMeshApplySphericalMapping 10001f70 f Newton.obj
0001:00000f80 _NewtonMeshApplyBoxMapping 10001f80 f Newton.obj
0001:00000fa0 _NewtonMeshApplyCylindricalMapping 10001fa0 f Newton.obj
0001:00000fc0 _NewtonMeshBeginFace 10001fc0 f Newton.obj
0001:00000fd0 _NewtonMeshAddFace 10001fd0 f Newton.obj
0001:00000ff0 _NewtonMeshEndFace 10001ff0 f Newton.obj
0001:00001000 _NewtonMeshGetVertexCount 10002000 f Newton.obj
0001:00001010 _NewtonMeshGetVertexStreams 10002010 f Newton.obj
0001:00001040 _NewtonMeshGetIndirectVertexStreams 10002040 f Newton.obj
0001:00001090 _NewtonMeshFirstMaterial 10002090 f Newton.obj
0001:000010a0 _NewtonMeshNextMaterial 100020a0 f Newton.obj
0001:000010b0 _NewtonMeshMaterialGetMaterial 100020b0 f Newton.obj
0001:000010c0 _NewtonMeshMaterialGetIndexCount 100020c0 f Newton.obj
0001:000010e0 _NewtonMeshMaterialGetIndexStream 100020e0 f Newton.obj
0001:00001100 _NewtonMeshMaterialGetIndexStreamShort 10002100 f Newton.obj
0001:00001120 ?dgGetUserLock@dgWorld@@QAEXXZ 10002120 f i Newton.obj
0001:00001140 ?dgReleasedUserLock@dgWorld@@QAEXXZ 10002140 f i Newton.obj
0001:00001160 ?Scale@?$dgTemplateVector@M@@QBE?AV1@M@Z 10002160 f i Newton.obj
0001:00001190 ??H?$dgTemplateVector@M@@QBE?AV0@ABV0@@Z 10002190 f i Newton.obj
0001:000011c0 ??G?$dgTemplateVector@M@@QBE?AV0@ABV0@@Z 100021c0 f i Newton.obj
0001:000011f0 ??L?$dgTemplateVector@M@@QBEMABV0@@Z 100021f0 f i Newton.obj
0001:00001220 ??D?$dgTemplateVector@M@@QBE?AV0@ABV0@@Z 10002220 f i Newton.obj
0001:00001260 _NewtonDestroy 10002260 f Newton.obj
0001:000012a0 _NewtonWorldCriticalSectionLock 100022a0 f Newton.obj
0001:000012c0 _NewtonWorldCriticalSectionUnlock 100022c0 f Newton.obj
0001:000012e0 _NewtonUpdate 100022e0 f Newton.obj
0001:000013b0 _NewtonSetMinimumFrameRate 100023b0 f Newton.obj
0001:00001410 _NewtonWorldGetFirstBody 10002410 f Newton.obj
0001:00001430 _NewtonWorldGetNextBody 10002430 f Newton.obj
0001:00001450 _NewtonIslandGetBodyAABB 10002450 f Newton.obj
0001:000014b0 _NewtonMaterialSetSurfaceThickness 100024b0 f Newton.obj
0001:00001510 _NewtonMaterialSetDefaultFriction 10002510 f Newton.obj
0001:000015f0 _NewtonMaterialSetDefaultElasticity 100025f0 f Newton.obj
0001:00001650 _NewtonMaterialSetDefaultSoftness 10002650 f Newton.obj
0001:000016b0 _NewtonMaterialSetCollisionCallback 100026b0 f Newton.obj
0001:000016f0 _NewtonMaterialGetUserData 100026f0 f Newton.obj
0001:00001710 _NewtonMaterialGetMaterialPairUserData 10002710 f Newton.obj
0001:00001720 _NewtonMaterialGetContactNormalSpeed 10002720 f Newton.obj
0001:000018c0 _NewtonMaterialGetContactForce 100028c0 f Newton.obj
0001:000019b0 _NewtonMaterialGetBodyCollisionID 100029b0 f Newton.obj
0001:000019d0 _NewtonMaterialSetContactSoftness 100029d0 f Newton.obj
0001:00001a30 _NewtonMaterialSetContactElasticity 10002a30 f Newton.obj
0001:00001a90 _NewtonMaterialSetContactFrictionCoef 10002a90 f Newton.obj
0001:00001ba0 _NewtonCreateConvexHull 10002ba0 f Newton.obj
0001:00001c20 _NewtonCollisionSetUserID 10002c20 f Newton.obj
0001:00001c30 _NewtonCollisionGetUserID 10002c30 f Newton.obj
0001:00001c40 _NewtonStaticCollisionSetDebugCallback 10002c40 f Newton.obj
0001:00001c70 _NewtonTreeCollisionGetFaceAtribute 10002c70 f Newton.obj
0001:00001c80 _NewtonTreeCollisionSetFaceAtribute 10002c80 f Newton.obj
0001:00001c90 _NewtonSceneProxySetMatrix 10002c90 f Newton.obj
0001:00001cb0 _NewtonSceneProxyGetMatrix 10002cb0 f Newton.obj
0001:00001ce0 _NewtonAddCollisionReference 10002ce0 f Newton.obj
0001:00001cf0 _NewtonBodySetUserData 10002cf0 f Newton.obj
0001:00001d00 _NewtonBodyGetUserData 10002d00 f Newton.obj
0001:00001d10 _NewtonBodyGetWorld 10002d10 f Newton.obj
0001:00001d20 _NewtonBodySetTransformCallback 10002d20 f Newton.obj
0001:00001d30 _NewtonBodySetForceAndTorqueCallback 10002d30 f Newton.obj
0001:00001d40 _NewtonBodyGetForceAndTorqueCallback 10002d40 f Newton.obj
0001:00001d50 _NewtonBodySetDestructorCallback 10002d50 f Newton.obj
0001:00001d60 _NewtonBodyGetMassMatrix 10002d60 f Newton.obj
0001:00001de0 _NewtonBodyGetInvMass 10002de0 f Newton.obj
0001:00001e60 _NewtonBodySetMatrixRecursive 10002e60 f Newton.obj
0001:00001ea0 _NewtonBodyGetMatrix 10002ea0 f Newton.obj
0001:00001ec0 _NewtonBodyGetRotation 10002ec0 f Newton.obj
0001:00001ef0 _NewtonBodyGetForceAcc 10002ef0 f Newton.obj
0001:00001f40 _NewtonBodyGetForce 10002f40 f Newton.obj
0001:00001f90 _NewtonBodyGetTorque 10002f90 f Newton.obj
0001:00001fe0 _NewtonBodyGetTorqueAcc 10002fe0 f Newton.obj
0001:00002030 _NewtonBodyGetCentreOfMass 10003030 f Newton.obj
0001:00002080 _NewtonContactJointGetContactCount 10003080 f Newton.obj
0001:000020a0 _NewtonContactJointGetFirstContact 100030a0 f Newton.obj
0001:000020d0 _NewtonContactJointGetNextContact 100030d0 f Newton.obj
0001:00002100 _NewtonContactGetMaterial 10003100 f Newton.obj
0001:00002110 _NewtonBodyGetCollision 10003110 f Newton.obj
0001:00002120 _NewtonBodySetMaterialGroupID 10003120 f Newton.obj
0001:00002130 _NewtonBodyGetMaterialGroupID 10003130 f Newton.obj
0001:00002140 _NewtonBodySetContinuousCollisionMode 10003140 f Newton.obj
0001:00002160 _NewtonBodyGetContinuousCollisionMode 10003160 f Newton.obj
0001:00002180 _NewtonBodySetJointRecursiveCollision 10003180 f Newton.obj
0001:000021b0 _NewtonBodyGetJointRecursiveCollision 100031b0 f Newton.obj
0001:000021d0 _NewtonBodyGetFreezeState 100031d0 f Newton.obj
0001:000021e0 _NewtonBodySetAutoSleep 100031e0 f Newton.obj
0001:00002210 _NewtonBodyGetAutoSleep 10003210 f Newton.obj
0001:00002230 _NewtonBodyGetSleepState 10003230 f Newton.obj
0001:00002240 _NewtonBodyGetVelocity 10003240 f Newton.obj
0001:00002290 _NewtonBodyGetOmega 10003290 f Newton.obj
0001:000022e0 _NewtonBodyGetLinearDamping 100032e0 f Newton.obj
0001:00002300 _NewtonConstraintCreateUserJoint 10003300 f Newton.obj
0001:00002340 _NewtonJointGetBody0 10003340 f Newton.obj
0001:00002350 _NewtonJointGetBody1 10003350 f Newton.obj
0001:00002370 _NewtonJointSetCollisionState 10003370 f Newton.obj
0001:00002390 _NewtonJointGetCollisionState 10003390 f Newton.obj
0001:000023a0 _NewtonMeshCreate 100033a0 f Newton.obj
0001:000023c0 _NewtonMeshCreateFromCollision 100033c0 f Newton.obj
0001:000023e0 ?Unlink@?$dgList@VdgContactMaterial@@@@QAEXPAVdgListNode@1@@Z 100033e0 f i Newton.obj
0001:00002450 ?SetCentreOfMass@dgBody@@QAEXABVdgVector@@@Z 10003450 f i Newton.obj
0001:00002530 ?SetAngularDamping@dgBody@@QAEXABVdgVector@@@Z 10003530 f i Newton.obj
0001:00002620 ?SetForce@dgBody@@QAEXABVdgVector@@@Z 10003620 f i Newton.obj
0001:000026e0 ?SetTorque@dgBody@@QAEXABVdgVector@@@Z 100036e0 f i Newton.obj
0001:000027a0 _NewtonSetWorldSize 100037a0 f Newton.obj
0001:00002800 _NewtonWorldForEachBodyInAABBDo 10003800 f Newton.obj
0001:00002860 _NewtonWorldRayCast 10003860 f Newton.obj
0001:000028d0 _NewtonWorldConvexCast 100038d0 f Newton.obj
0001:00002930 _NewtonMaterialGetContactTangentSpeed 10003930 f Newton.obj
0001:00002b10 _NewtonMaterialContactRotateTangentDirections 10003b10 f Newton.obj
0001:00002c80 _NewtonConvexCollisionCalculateInertialMatrix 10003c80 f Newton.obj
0001:00002cd0 _NewtonCreateUserMeshCollision 10003cd0 f Newton.obj
0001:00002d60 _NewtonTreeCollisionGetVertexListIndexListInAABB 10003d60 f Newton.obj
0001:00002e20 _NewtonCollisionSupportVertex 10003e20 f Newton.obj
0001:00002fb0 _NewtonCollisionCalculateAABB 10003fb0 f Newton.obj
0001:00003010 _NewtonSetEulerAngle 10004010 f Newton.obj
0001:00003410 _NewtonBodySetMassMatrix 10004410 f Newton.obj
0001:00003590 _NewtonBodySetForce 10004590 f Newton.obj
0001:000035d0 _NewtonBodyCalculateInverseDynamicsForce 100045d0 f Newton.obj
0001:00003630 _NewtonBodySetTorque 10004630 f Newton.obj
0001:00003670 _NewtonBodySetCentreOfMass 10004670 f Newton.obj
0001:000036b0 _NewtonBodyAddBuoyancyForce 100046b0 f Newton.obj
0001:00003710 _NewtonBodyGetAABB 10004710 f Newton.obj
0001:00003790 _NewtonBodySetVelocity 10004790 f Newton.obj
0001:000037f0 _NewtonBodySetOmega 100047f0 f Newton.obj
0001:00003850 _NewtonBodySetLinearDamping 10004850 f Newton.obj
0001:000038a0 _NewtonBodySetAngularDamping 100048a0 f Newton.obj
0001:000038e0 _NewtonBodyGetAngularDamping 100048e0 f Newton.obj
0001:00003940 _NewtonBodyAddImpulse 10004940 f Newton.obj
0001:000039a0 _NewtonConstraintCreateBall 100049a0 f Newton.obj
0001:000039e0 _NewtonBallSetConeLimits 100049e0 f Newton.obj
0001:00003d40 _NewtonConstraintCreateHinge 10004d40 f Newton.obj
0001:00003da0 _NewtonConstraintCreateSlider 10004da0 f Newton.obj
0001:00003e00 _NewtonConstraintCreateCorkscrew 10004e00 f Newton.obj
0001:00003e60 _NewtonConstraintCreateUniversal 10004e60 f Newton.obj
0001:00003ee0 _NewtonConstraintCreateUpVector 10004ee0 f Newton.obj
0001:00003f20 _NewtonUpVectorSetPin 10004f20 f Newton.obj
0001:00003f60 _NewtonUserJointAddLinearRow 10004f60 f Newton.obj
0001:00004060 _NewtonUserJointAddAngularRow 10005060 f Newton.obj
0001:00004120 _NewtonMeshPlaneClip 10005120 f Newton.obj
0001:00004170 ?AddForce@dgBody@@QAEXABVdgVector@@@Z 10005170 f i Newton.obj
0001:000041e0 ?AddTorque@dgBody@@QAEXABVdgVector@@@Z 100051e0 f i Newton.obj
0001:00004250 _NewtonCreate 10005250 f Newton.obj
0001:00004320 _NewtonDestroyAllBodies 10005320 f Newton.obj
0001:00004370 _NewtonCollisionRayCast 10005370 f Newton.obj
0001:00004570 _NewtonBodyAddForce 10005570 f Newton.obj
0001:000045b0 _NewtonBodyAddTorque 100055b0 f Newton.obj
0001:000045f0 _NewtonContactJointRemoveContact 100055f0 f Newton.obj
0001:00004630 _NewtonWorldForEachJointDo 10005630 f Newton.obj
0001:000046e0 ?Append@?$dgList@UNewtonMeshPartition@@@@QAEPAVdgListNode@1@XZ 100056e0 f i NewtonAproximateConvexPartition.obj
0001:00004770 ?CalculateHulls@NewtonAproximateConvexPartition@@QAEXPBVdgVector@@H@Z 10005770 f NewtonAproximateConvexPartition.obj
0001:00004880 ?RemoveAll@?$dgList@UNewtonMeshPartition@@@@QAEXXZ 10005880 f i NewtonAproximateConvexPartition.obj
0001:000048f0 ??0NewtonAproximateConvexPartition@@QAE@ABVNewtonMeshEffect@@MH@Z 100058f0 f NewtonAproximateConvexPartition.obj
0001:00004970 ??1NewtonAproximateConvexPartition@@QAE@XZ 10005970 f NewtonAproximateConvexPartition.obj
0001:00004980 ?JacobianDerivative@NewtonUserJoint@@UAEIAAVdgContraintDescritor@@@Z 10005980 f NewtonClass.obj
0001:000049c0 ?SetAcceleration@NewtonUserJoint@@QAEXM@Z 100059c0 f NewtonClass.obj
0001:000049f0 ?SetSpringDamperAcceleration@NewtonUserJoint@@QAEXMM@Z 100059f0 f NewtonClass.obj
0001:00004a70 ?GetRowForce@NewtonUserJoint@@QBEMH@Z 10005a70 f NewtonClass.obj
0001:00004aa0 ?GetInfo@NewtonUserJoint@@UBEXPAVdgConstraintInfo@@@Z 10005aa0 f NewtonClass.obj
0001:00004ae0 ??_ENewtonUserJoint@@UAEPAXI@Z 10005ae0 f i NewtonClass.obj
0001:00004ae0 ??_GNewtonUserJoint@@UAEPAXI@Z 10005ae0 f i NewtonClass.obj
0001:00004b20 ?SetHighFriction@NewtonUserJoint@@QAEXM@Z 10005b20 f NewtonClass.obj
0001:00004b90 ?SetLowerFriction@NewtonUserJoint@@QAEXM@Z 10005b90 f NewtonClass.obj
0001:00004c10 ?SetRowStiffness@NewtonUserJoint@@QAEXM@Z 10005c10 f NewtonClass.obj
0001:00004c80 ?SetUpdateFeedbackFunction@NewtonUserJoint@@QAEXP6AXPBUNewtonJoint@@MH@Z@Z 10005c80 f NewtonClass.obj
0001:00004c90 ?DestroyJoints@NewtonDeadJoints@@QAEXAAVNewton@@@Z 10005c90 f NewtonClass.obj
0001:00004cf0 ??1Newton@@QAE@XZ 10005cf0 f NewtonClass.obj
0001:00004d40 ??0NewtonUserJoint@@QAE@PAVdgWorld@@HP6AXPBUNewtonJoint@@MH@ZP6AX1PAUNewtonJointRecord@@@ZPAVdgBody@@5@Z 10005d40 f NewtonClass.obj
0001:00004df0 ?AddAngularRowJacobian@NewtonUserJoint@@QAEXABVdgVector@@M@Z 10005df0 f NewtonClass.obj
0001:00004ec0 ?AddGeneralRowJacobian@NewtonUserJoint@@QAEXPBM0@Z 10005ec0 f NewtonClass.obj
0001:00004f80 ?AddLinearRowJacobian@NewtonUserJoint@@QAEXABVdgVector@@00@Z 10005f80 f NewtonClass.obj
0001:00005040 ??0Newton@@QAE@M@Z 10006040 f NewtonClass.obj
0001:000050b0 ?DestroyJoint@Newton@@QAEXPAVdgConstraint@@@Z 100060b0 f NewtonClass.obj
0001:000050e0 ?DestroyBody@Newton@@QAEXPAVdgBody@@@Z 100060e0 f NewtonClass.obj
0001:00005110 ?DestroyBodies@NewtonDeadBodies@@QAEXAAVNewton@@@Z 10006110 f NewtonClass.obj
0001:00005190 ?UpdatePhysics@Newton@@QAEXM@Z 10006190 f NewtonClass.obj
0001:000051d0 ?GetShapeFromCollision@NewtonMeshEffectBuilder@@SAXPAXHPBMH@Z 100061d0 f i NewtonMeshEffect.obj
0001:000052b0 ?BeginPolygon@NewtonMeshEffect@@QAEXXZ 100062b0 f NewtonMeshEffect.obj
0001:000052c0 ?AddVertex@NewtonMeshEffect@@AAEXPBMH@Z 100062c0 f NewtonMeshEffect.obj
0001:00005420 ?AddPolygon@NewtonMeshEffect@@QAEXHPBMHH@Z 10006420 f NewtonMeshEffect.obj
0001:00005490 ?GetVertexStreams@NewtonMeshEffect@@QAEXHPAMH0H0@Z 10006490 f NewtonMeshEffect.obj
0001:00005550 ?GetIndirectVertexStreams@NewtonMeshEffect@@QAEXHPAMPAH1H011H011@Z 10006550 f NewtonMeshEffect.obj
0001:00005720 ?GetNextMaterial@NewtonMeshEffect@@QAEHH@Z 10006720 f NewtonMeshEffect.obj
0001:00005750 ?GetMaterialGetIndexStream@NewtonMeshEffect@@QAEXHPAH@Z 10006750 f NewtonMeshEffect.obj
0001:000057c0 ?GetMaterialGetIndexStreamShort@NewtonMeshEffect@@QAEXHPAF@Z 100067c0 f NewtonMeshEffect.obj
0001:00005830 ?CreateConvexAproximationCollision@NewtonMeshEffect@@QBEPAVdgCollision@@MH@Z 10006830 f NewtonMeshEffect.obj
0001:00005860 ??Y?$dgTemplateVector@M@@QAEAAV0@ABV0@@Z 10006860 f i NewtonMeshEffect.obj
0001:00005890 ??0NewtonMeshEffect@@QAE@_N@Z 10006890 f NewtonMeshEffect.obj
0001:000058f0 ??_ENewtonMeshEffect@@UAEPAXI@Z 100068f0 f i NewtonMeshEffect.obj
0001:000058f0 ??_GNewtonMeshEffect@@UAEPAXI@Z 100068f0 f i NewtonMeshEffect.obj
0001:00005940 ?EndPolygon@NewtonMeshEffect@@QAEXXZ 10006940 f NewtonMeshEffect.obj
0001:00005b30 ?CreateConvexCollision@NewtonMeshEffect@@QBEPAVdgCollision@@M@Z 10006b30 f NewtonMeshEffect.obj
0001:00005b90 ??0NewtonMeshEffect@@QAE@PAVdgCollision@@@Z 10006b90 f NewtonMeshEffect.obj
0001:00005dd0 ?GetAttriubeArray@NewtonMeshEffect@@AAEXPAUdgVertexAtribute@1@@Z 10006dd0 f NewtonMeshEffect.obj
0001:00005e60 ?ApplyAttriubeArray@NewtonMeshEffect@@AAEXPAUdgVertexAtribute@1@@Z 10006e60 f NewtonMeshEffect.obj
0001:00005f20 ?GetOrigin@NewtonMeshEffect@@ABE?AVdgVector@@XZ 10006f20 f NewtonMeshEffect.obj
0001:00006090 ?FixCylindricalMapping@NewtonMeshEffect@@ABEXPAUdgVertexAtribute@1@@Z 10007090 f NewtonMeshEffect.obj
0001:000061e0 ?SphericalMapping@NewtonMeshEffect@@QAEXH@Z 100071e0 f NewtonMeshEffect.obj
0001:00006400 ?CylindricalMapping@NewtonMeshEffect@@QAEXHH@Z 10007400 f NewtonMeshEffect.obj
0001:00006890 ?BoxMapping@NewtonMeshEffect@@QAEXHHH@Z 10007890 f NewtonMeshEffect.obj
0001:00006c30 ?CalcualetNormals@NewtonMeshEffect@@QAEXM@Z 10007c30 f NewtonMeshEffect.obj
0001:000070e0 ?GetFirstMaterial@NewtonMeshEffect@@QAEHXZ 100080e0 f NewtonMeshEffect.obj
0001:000072e0 ?CapClipFace@NewtonMeshEffect@@AAE_NABVdgPlane@@ABVdgMatrix@@HH@Z 100082e0 f NewtonMeshEffect.obj
0001:00007530 ?PlaneClip@NewtonMeshEffect@@QAEHABVdgPlane@@ABVdgMatrix@@PAPAV1@HH@Z 10008530 f NewtonMeshEffect.obj
0001:00008110 _NewtonMaterialSetContactNormalDirection 10009110 f Newton.obj
0001:00008110 ?BeginFace@dgPolyhedra@@QAEXXZ 10009110 f corelib_2009:dgPolyhedra.obj
0001:00008110 ??1dgBody@@QAE@XZ 10009110 f physics_2009:dgBody.obj
0001:00008110 ??1dgCollidingPairCollector@@QAE@XZ 10009110 f physics_2009:dgContact.obj
0001:00008110 ??3@YAXPAX@Z 10009110 f NewtonStdAfx.obj
0001:00008110 ?Init@dgBilateralConstraint@@MAEXXZ 10009110 f NewtonClass.obj
0001:00008120 ?ModifierGetMatrix@dgCollision@@UBE?AVdgMatrix@@XZ 10009120 f i physics_2009:dgWorld.obj
0001:00008140 ?Release@dgCollision@@UAEHXZ 10009140 f i physics_2009:dgWorld.obj
0001:00008160 ?GetSentinelBody@dgWorld@@QBEPAVdgBody@@XZ 10009160 f physics_2009:dgWorld.obj
0001:00008170 ?SetFrictionMode@dgWorld@@QAEXH@Z 10009170 f physics_2009:dgWorld.obj
0001:00008180 ?SetHardwareMode@dgWorld@@QAEXH@Z 10009180 f physics_2009:dgWorld.obj
0001:000081b0 ?GetHardwareMode@dgWorld@@QAEHPAD@Z 100091b0 f physics_2009:dgWorld.obj
0001:00008210 ?ThreadExecute@dgSetTrreadRoundMode@dgWorld@@UAEXXZ 10009210 f physics_2009:dgWorld.obj
0001:00008230 ?SetThreadsCount@dgWorld@@QAEXH@Z 10009230 f physics_2009:dgWorld.obj
0001:00008290 ?GetThreadsCount@dgWorld@@QBEHXZ 10009290 f physics_2009:dgWorld.obj
0001:000082a0 ?EnableThreadOnSingleIsland@dgWorld@@QAEXH@Z 100092a0 f physics_2009:dgWorld.obj
0001:000082c0 ?DestroyConstraint@dgWorld@@QAEXPAVdgConstraint@@@Z 100092c0 f physics_2009:dgWorld.obj
0001:000082e0 ?UpdateCollision@dgWorld@@QAEXXZ 100092e0 f physics_2009:dgWorld.obj
0001:00008400 ?Update@dgWorld@@QAEXM@Z 10009400 f physics_2009:dgWorld.obj
0001:00008510 ?SetPerfomanceCounter@dgWorld@@QAEXP6AIXZ@Z 10009510 f physics_2009:dgWorld.obj
0001:00008540 ?SetUserData@dgWorld@@QAEXPAX@Z 10009540 f physics_2009:dgWorld.obj
0001:00008550 ?GetUserData@dgWorld@@QBEPAXXZ 10009550 f physics_2009:dgWorld.obj
0001:00008560 ?SetIslandUpdateCallback@dgWorld@@QAEXP6AIPAXH@Z@Z 10009560 f physics_2009:dgWorld.obj
0001:00008570 ?SetLeavingWorldCallback@dgWorld@@QAEXP6AXPAVdgBody@@H@Z@Z 10009570 f physics_2009:dgWorld.obj
0001:00008580 ?CreateBallConstraint@dgWorld@@QAEPAVdgBallConstraint@@ABVdgVector@@PAVdgBody@@1@Z 10009580 f physics_2009:dgWorld.obj
0001:000085d0 ?CreateHingeConstraint@dgWorld@@QAEPAVdgHingeConstraint@@ABVdgVector@@0PAVdgBody@@1@Z 100095d0 f physics_2009:dgWorld.obj
0001:00008620 ?CreateUpVectorConstraint@dgWorld@@QAEPAVdgUpVectorConstraint@@ABVdgVector@@PAVdgBody@@@Z 10009620 f physics_2009:dgWorld.obj
0001:00008670 ?CreateSlidingConstraint@dgWorld@@QAEPAVdgSlidingConstraint@@ABVdgVector@@0PAVdgBody@@1@Z 10009670 f physics_2009:dgWorld.obj
0001:000086c0 ?CreateCorkscrewConstraint@dgWorld@@QAEPAVdgCorkscrewConstraint@@ABVdgVector@@0PAVdgBody@@1@Z 100096c0 f physics_2009:dgWorld.obj
0001:00008710 ?CreateUniversalConstraint@dgWorld@@QAEPAVdgUniversalConstraint@@ABVdgVector@@00PAVdgBody@@1@Z 10009710 f physics_2009:dgWorld.obj
0001:00008770 ?GetConstraintsCount@dgWorld@@QBEHXZ 10009770 f physics_2009:dgWorld.obj
0001:00008780 ?AddBodyImpulse@dgWorld@@QAEXPAVdgBody@@ABVdgVector@@1@Z 10009780 f physics_2009:dgWorld.obj
0001:000087b0 ??_EdgCollisionPoint@@UAEPAXI@Z 100097b0 f i physics_2009:dgWorld.obj
0001:000087b0 ??_GdgCollisionPoint@@UAEPAXI@Z 100097b0 f i physics_2009:dgWorld.obj
0001:000087d0 ??_EdgParallelSolverCalculateForces@@UAEPAXI@Z 100097d0 f i physics_2009:dgWorld.obj
0001:000087d0 ??_EdgParallelSolverBodyInertia@@UAEPAXI@Z 100097d0 f i physics_2009:dgWorld.obj
0001:000087d0 ??_GdgParallelSolverBodyInertia@@UAEPAXI@Z 100097d0 f i physics_2009:dgWorld.obj
0001:000087d0 ??_GdgParallelSolverInitFeedbackUpdate@@UAEPAXI@Z 100097d0 f i physics_2009:dgWorld.obj
0001:000087d0 ??_EdgParallelSolverClear@@UAEPAXI@Z 100097d0 f i physics_2009:dgWorld.obj
0001:000087d0 ??_EdgSetTrreadRoundMode@dgWorld@@UAEPAXI@Z 100097d0 f i physics_2009:dgWorld.obj
0001:000087d0 ??_EdgSolverWorlkerThreads@@UAEPAXI@Z 100097d0 f i physics_2009:dgWorld.obj
0001:000087d0 ??_GdgBroadPhaseMaterialCallbackWorkerThread@@UAEPAXI@Z 100097d0 f i physics_2009:dgBroadPhaseCollision.obj
0001:000087d0 ??_GdgWorkerThread@@UAEPAXI@Z 100097d0 f i physics_2009:dgWorld.obj
0001:000087d0 ??_EdgParallelSolverInitInternalForces@@UAEPAXI@Z 100097d0 f i physics_2009:dgWorld.obj
0001:000087d0 ??_EdgParallelSolverJointAcceleration@@UAEPAXI@Z 100097d0 f i physics_2009:dgWorld.obj
0001:000087d0 ??_GdgBroadPhaseApplyExternalForce@@UAEPAXI@Z 100097d0 f i physics_2009:dgBroadPhaseCollision.obj
0001:000087d0 ??_EdgParallelSolverBuildJacobianMatrix@@UAEPAXI@Z 100097d0 f i physics_2009:dgWorld.obj
0001:000087d0 ??_GdgBroadPhaseCalculateContactsWorkerThread@@UAEPAXI@Z 100097d0 f i physics_2009:dgBroadPhaseCollision.obj
0001:000087d0 ??_GdgBroadPhaseCellPairsWorkerThread@@UAEPAXI@Z 100097d0 f i physics_2009:dgBroadPhaseCollision.obj
0001:000087d0 ??_GdgSolverWorlkerThreads@@UAEPAXI@Z 100097d0 f i physics_2009:dgWorld.obj
0001:000087d0 ??_EdgParallelSolverUpdateForce@@UAEPAXI@Z 100097d0 f i physics_2009:dgWorld.obj
0001:000087d0 ??_EdgBroadPhaseCellPairsWorkerThread@@UAEPAXI@Z 100097d0 f i physics_2009:dgBroadPhaseCollision.obj
0001:000087d0 ??_GdgParallelSolverUpdateForce@@UAEPAXI@Z 100097d0 f i physics_2009:dgWorld.obj
0001:000087d0 ??_EdgParallelSolverInitFeedbackUpdate@@UAEPAXI@Z 100097d0 f i physics_2009:dgWorld.obj
0001:000087d0 ??_GdgParallelSolverUpdateVeloc@@UAEPAXI@Z 100097d0 f i physics_2009:dgWorld.obj
0001:000087d0 ??_EdgBroadPhaseMaterialCallbackWorkerThread@@UAEPAXI@Z 100097d0 f i physics_2009:dgBroadPhaseCollision.obj
0001:000087d0 ??_GdgParallelSolverJointAcceleration@@UAEPAXI@Z 100097d0 f i physics_2009:dgWorld.obj
0001:000087d0 ??_GdgParallelSolverInitInternalForces@@UAEPAXI@Z 100097d0 f i physics_2009:dgWorld.obj
0001:000087d0 ??_EdgParallelSolverBuildJacobianRows@@UAEPAXI@Z 100097d0 f i physics_2009:dgWorld.obj
0001:000087d0 ??_GdgParallelSolverCalculateForces@@UAEPAXI@Z 100097d0 f i physics_2009:dgWorld.obj
0001:000087d0 ??_GdgParallelSolverClear@@UAEPAXI@Z 100097d0 f i physics_2009:dgWorld.obj
0001:000087d0 ??_EdgBroadPhaseApplyExternalForce@@UAEPAXI@Z 100097d0 f i physics_2009:dgBroadPhaseCollision.obj
0001:000087d0 ??_GdgParallelSolverBuildJacobianMatrix@@UAEPAXI@Z 100097d0 f i physics_2009:dgWorld.obj
0001:000087d0 ??_GdgSetTrreadRoundMode@dgWorld@@UAEPAXI@Z 100097d0 f i physics_2009:dgWorld.obj
0001:000087d0 ??_EdgParallelSolverUpdateVeloc@@UAEPAXI@Z 100097d0 f i physics_2009:dgWorld.obj
0001:000087d0 ??_EdgBroadPhaseCalculateContactsWorkerThread@@UAEPAXI@Z 100097d0 f i physics_2009:dgBroadPhaseCollision.obj
0001:000087d0 ??_EdgWorkerThread@@UAEPAXI@Z 100097d0 f i physics_2009:dgWorld.obj
0001:000087d0 ??_GdgParallelSolverBuildJacobianRows@@UAEPAXI@Z 100097d0 f i physics_2009:dgWorld.obj
0001:000087f0 ?SetSolverMode@dgWorld@@QAEXH@Z 100097f0 f physics_2009:dgWorld.obj
0001:00008810 ?RemoveAllGroupID@dgWorld@@QAEXXZ 10009810 f physics_2009:dgWorld.obj
0001:00008860 ?DestroyBody@dgWorld@@QAEXPAVdgBody@@@Z 10009860 f physics_2009:dgWorld.obj
0001:000088b0 ?GetPerfomanceTicks@dgWorld@@QBEIHI@Z 100098b0 f physics_2009:dgWorld.obj
0001:000088f0 ?GetBodiesCount@dgWorld@@QBEHXZ 100098f0 f physics_2009:dgWorld.obj
0001:00008900 ?AreBodyConnectedByJoints@dgWorld@@AAE_NPAVdgBody@@0@Z 10009900 f physics_2009:dgWorld.obj
0001:000089e0 ?FlushCache@dgWorld@@QAEXXZ 100099e0 f physics_2009:dgWorld.obj
0001:00008a30 ??0dgWorldDynamicUpdate@@QAE@XZ 10009a30 f i physics_2009:dgWorld.obj
0001:00008e90 ??1dgWorldDynamicUpdate@@QAE@XZ 10009e90 f i physics_2009:dgWorld.obj
0001:00008ff0 ?DestroyAllBodies@dgWorld@@QAEXXZ 10009ff0 f physics_2009:dgWorld.obj
0001:00009050 ?CreateBody@dgWorld@@QAEPAVdgBody@@PAVdgCollision@@@Z 1000a050 f physics_2009:dgWorld.obj
0001:000091a0 ?BodySetMatrix@dgWorld@@QAEXPAVdgBody@@ABVdgMatrix@@@Z 1000a1a0 f physics_2009:dgWorld.obj
0001:00009470 ?RemoveAll@?$dgList@PAVdgContact@@@@QAEXXZ 1000a470 f i physics_2009:dgWorld.obj
0001:00009470 ?RemoveAll@?$dgList@PAVdgEdge@@@@QAEXXZ 1000a470 f i corelib_2009:dgPolyhedra.obj
0001:000094d0 ??1dgWorld@@QAE@XZ 1000a4d0 f physics_2009:dgWorld.obj
0001:00009620 ??0dgWorld@@QAE@XZ 1000a620 f physics_2009:dgWorld.obj
0001:00009980 ?GetIslandBody@dgWorld@@QBEPAVdgBody@@PBXH@Z 1000a980 f physics_2009:dgWorldDynamicUpdate.obj
0001:000099b0 ?SortIslands@dgWorldDynamicUpdate@@AAEXXZ 1000a9b0 f physics_2009:dgWorldDynamicUpdate.obj
0001:00009c20 ?ReallocBodyMemory@dgWorldDynamicUpdate@@AAEXH@Z 1000ac20 f physics_2009:dgWorldDynamicUpdate.obj
0001:00009ce0 ?ReallocIslandMemory@dgWorldDynamicUpdate@@AAEXH@Z 1000ace0 f physics_2009:dgWorldDynamicUpdate.obj
0001:00009da0 ?ReallocJointsMemory@dgWorldDynamicUpdate@@AAEXH@Z 1000ada0 f physics_2009:dgWorldDynamicUpdate.obj
0001:00009ea0 ?ReallocJacobiansMemory@dgWorldDynamicUpdate@@AAEXHH@Z 1000aea0 f physics_2009:dgWorldDynamicUpdate.obj
0001:0000a120 ?ReallocIntenalForcesMemory@dgWorldDynamicUpdate@@AAEXHH@Z 1000b120 f physics_2009:dgWorldDynamicUpdate.obj
0001:0000a230 ?GetJacobialDerivativesParallel@dgWorldDynamicUpdate@@AAEHABVdgIsland@@_NHM@Z 1000b230 f physics_2009:dgWorldDynamicUpdate.obj
0001:0000a330 ?ThreadExecute@dgParallelSolverJointAcceleration@@UAEXXZ 1000b330 f physics_2009:dgWorldDynamicUpdate.obj
0001:0000a4e0 ?ThreadExecute@dgParallelSolverInitFeedbackUpdate@@UAEXXZ 1000b4e0 f physics_2009:dgWorldDynamicUpdate.obj
0001:0000a630 ?SpanningTree@dgWorldDynamicUpdate@@AAEXPAVdgBody@@@Z 1000b630 f physics_2009:dgWorldDynamicUpdate.obj
0001:0000a9f0 ?SortJointsArray@dgJacobianMemory@@QBEXXZ 1000b9f0 f physics_2009:dgWorldDynamicUpdate.obj
0001:0000ad70 ?ApplyExternalForcesAndAccelerationSimD@dgJacobianMemory@@QBEXM@Z 1000bd70 f physics_2009:dgWorldDynamicUpdate.obj
0001:0000b0f0 ?SwapRowsSimd@dgJacobianMemory@@QBEXHH@Z 1000c0f0 f physics_2009:dgWorldDynamicUpdate.obj
0001:0000b2f0 ?SwapRows@dgJacobianMemory@@QBEXHH@Z 1000c2f0 f physics_2009:dgWorldDynamicUpdate.obj
0001:0000b480 ?CalculateJointForcesSimD@dgJacobianMemory@@QBEMHPAMM@Z 1000c480 f physics_2009:dgWorldDynamicUpdate.obj
0001:0000bfc0 ?AddDamingAcceleration@dgBody@@AAEXXZ 1000cfc0 f i physics_2009:dgWorldDynamicUpdate.obj
0001:0000c180 ?IntegrateArray@dgWorldDynamicUpdate@@ABEXPBVdgBodyInfo@@HMMH_N@Z 1000d180 f physics_2009:dgWorldDynamicUpdate.obj
0001:0000c7c0 ?ApplyExternalForcesAndAcceleration@dgJacobianMemory@@QBEXM@Z 1000d7c0 f physics_2009:dgWorldDynamicUpdate.obj
0001:0000cf50 ?CalculateSimpleBodyReactionsForcesSimD@dgJacobianMemory@@QBEXM@Z 1000df50 f physics_2009:dgWorldDynamicUpdate.obj
0001:0000dc00 ?CalculateSimpleBodyReactionsForces@dgJacobianMemory@@QBEXM@Z 1000ec00 f physics_2009:dgWorldDynamicUpdate.obj
0001:0000edc0 ?CalculateForcesSimulationModeSimd@dgJacobianMemory@@QBEXM@Z 1000fdc0 f physics_2009:dgWorldDynamicUpdate.obj
0001:00010240 ?CalculateJointForces@dgJacobianMemory@@QBEMHPAMM@Z 10011240 f physics_2009:dgWorldDynamicUpdate.obj
0001:00011040 ?CalculateForcesGameModeSimD@dgJacobianMemory@@QBEXHM@Z 10012040 f physics_2009:dgWorldDynamicUpdate.obj
0001:00011b40 ?CalculateForcesGameMode@dgJacobianMemory@@QBEXHM@Z 10012b40 f physics_2009:dgWorldDynamicUpdate.obj
0001:00013290 ?ThreadExecute@dgParallelSolverBodyInertia@@UAEXXZ 10014290 f physics_2009:dgWorldDynamicUpdate.obj
0001:00013340 ?ThreadExecute@dgParallelSolverBuildJacobianRows@@UAEXXZ 10014340 f physics_2009:dgWorldDynamicUpdate.obj
0001:00013d60 ?BuildJacobianMatrixParallel@dgWorldDynamicUpdate@@AAEXABVdgIsland@@MH@Z 10014d60 f physics_2009:dgWorldDynamicUpdate.obj
0001:00014090 ?ThreadExecute@dgParallelSolverClear@@UAEXXZ 10015090 f physics_2009:dgWorldDynamicUpdate.obj
0001:00014270 ?ThreadExecute@dgParallelSolverInitInternalForces@@UAEXXZ 10015270 f physics_2009:dgWorldDynamicUpdate.obj
0001:000147b0 ?ThreadExecute@dgParallelSolverUpdateVeloc@@UAEXXZ 100157b0 f physics_2009:dgWorldDynamicUpdate.obj
0001:00014b20 ?ThreadExecute@dgParallelSolverUpdateForce@@UAEXXZ 10015b20 f physics_2009:dgWorldDynamicUpdate.obj
0001:00015260 ?ThreadExecute@dgParallelSolverCalculateForces@@UAEXXZ 10016260 f physics_2009:dgWorldDynamicUpdate.obj
0001:00015c40 ?CalculateForcesGameModeParallel@dgJacobianMemory@@QBEXHMH@Z 10016c40 f physics_2009:dgWorldDynamicUpdate.obj
0001:00016470 ?CalculateForcesSimulationMode@dgJacobianMemory@@QBEXM@Z 10017470 f physics_2009:dgWorldDynamicUpdate.obj
0001:00018ed0 ?UpdateDynamics@dgWorldDynamicUpdate@@AAEXPAVdgWorld@@HM@Z 10019ed0 f physics_2009:dgWorldDynamicUpdate.obj
0001:00019310 ?ThreadExecute@dgParallelSolverBuildJacobianMatrix@@UAEXXZ 1001a310 f physics_2009:dgWorldDynamicUpdate.obj
0001:00019940 ?GetJacobialDerivatives@dgWorldDynamicUpdate@@AAEHABVdgIsland@@H_NHM@Z 1001a940 f physics_2009:dgWorldDynamicUpdate.obj
0001:00019ed0 ?BuildJacobianMatrixSimD@dgWorldDynamicUpdate@@AAEXABVdgIsland@@HM@Z 1001aed0 f physics_2009:dgWorldDynamicUpdate.obj
0001:0001a480 ?BuildJacobianMatrix@dgWorldDynamicUpdate@@AAEXABVdgIsland@@HM@Z 1001b480 f physics_2009:dgWorldDynamicUpdate.obj
0001:0001acf0 ?ThreadExecute@dgSolverWorlkerThreads@@UAEXXZ 1001bcf0 f physics_2009:dgWorldDynamicUpdate.obj
0001:0001b720 ?CreateConvexModifier@dgWorld@@QAEPAVdgCollision@@PAV2@@Z 1001c720 f physics_2009:dgNarrowPhaseCollision.obj
0001:0001b760 ?CreateCompoundCollision@dgWorld@@QAEPAVdgCollision@@HQBQAV2@@Z 1001c760 f physics_2009:dgNarrowPhaseCollision.obj
0001:0001b790 ?CreateBVH@dgWorld@@QAEPAVdgCollision@@XZ 1001c790 f physics_2009:dgNarrowPhaseCollision.obj
0001:0001b7b0 ?CreateStaticUserMesh@dgWorld@@QAEPAVdgCollision@@ABVdgVector@@0ABVdgUserMeshCreation@@@Z 1001c7b0 f physics_2009:dgNarrowPhaseCollision.obj
0001:0001b7d0 ?CreateBVHFieldCollision@dgWorld@@QAEPAVdgCollision@@HHHPAGPADMM@Z 1001c7d0 f physics_2009:dgNarrowPhaseCollision.obj
0001:0001b830 ?CreateScene@dgWorld@@QAEPAVdgCollision@@XZ 1001c830 f physics_2009:dgNarrowPhaseCollision.obj
0001:0001b860 ?Serialize@dgWorld@@QBEXPAVdgCollision@@P6AXPAXPBXI@Z1@Z 1001c860 f physics_2009:dgNarrowPhaseCollision.obj
0001:0001b8c0 ?GetDefualtBodyGroupID@dgWorld@@QBEIXZ 1001c8c0 f physics_2009:dgNarrowPhaseCollision.obj
0001:0001b8d0 ?GetFirstMaterial@dgWorld@@QBEPAVdgContactMaterial@@XZ 1001c8d0 f physics_2009:dgNarrowPhaseCollision.obj
0001:0001b8f0 ?SortContacts@dgWorld@@ABEXQAVdgContactPoint@@H@Z 1001c8f0 f physics_2009:dgNarrowPhaseCollision.obj
0001:0001bae0 ?ReduceContacts@dgWorld@@ABEHHQAVdgContactPoint@@HMH@Z 1001cae0 f physics_2009:dgNarrowPhaseCollision.obj
0001:0001bcb0 ?PruneContacts@dgWorld@@ABEHHQAVdgContactPoint@@H@Z 1001ccb0 f physics_2009:dgNarrowPhaseCollision.obj
0001:0001be60 ?ProcessCachedContacts@dgWorld@@ABEXPAVdgContact@@PBVdgContactMaterial@@MH@Z 1001ce60 f physics_2009:dgNarrowPhaseCollision.obj
0001:0001bf40 ?ProcessTriggers@dgWorld@@AAEXAAUdgPair@dgCollidingPairCollector@@MH@Z 1001cf40 f physics_2009:dgNarrowPhaseCollision.obj
0001:0001c020 ?SceneContactsSimd@dgWorld@@ABEXABUdgProxy@dgCollisionScene@@QAUdgPair@dgCollidingPairCollector@@AAVdgCollisionParamProxi@@@Z 1001d020 f physics_2009:dgNarrowPhaseCollision.obj
0001:0001c0e0 ?SceneContacts@dgWorld@@ABEXABUdgProxy@dgCollisionScene@@QAUdgPair@dgCollidingPairCollector@@AAVdgCollisionParamProxi@@@Z 1001d0e0 f physics_2009:dgNarrowPhaseCollision.obj
0001:0001c1a0 ?Append@?$dgList@VdgContactMaterial@@@@QAEPAVdgListNode@1@XZ 1001d1a0 f i physics_2009:dgNarrowPhaseCollision.obj
0001:0001c250 ?Find@?$dgTree@VdgContactMaterial@@I@@QBEPAVdgTreeNode@1@I@Z 1001d250 f i physics_2009:dgNarrowPhaseCollision.obj
0001:0001c280 ?GetMaterial@dgWorld@@QBEPAVdgContactMaterial@@II@Z 1001d280 f physics_2009:dgNarrowPhaseCollision.obj
0001:0001c2d0 ?GetNextMaterial@dgWorld@@QBEPAVdgContactMaterial@@PAV2@@Z 1001d2d0 f physics_2009:dgNarrowPhaseCollision.obj
0001:0001c300 ?RemoveFromCache@dgWorld@@QAEXPAVdgCollision@@@Z 1001d300 f physics_2009:dgNarrowPhaseCollision.obj
0001:0001c360 ?ReleaseCollision@dgWorld@@QAEXPAVdgCollision@@@Z 1001d360 f physics_2009:dgNarrowPhaseCollision.obj
0001:0001c3d0 ?ClosestCompoundPoint@dgWorld@@ABEHPAVdgBody@@0AAVdgTriplex@@11H@Z 1001d3d0 f physics_2009:dgNarrowPhaseCollision.obj
0001:0001c870 ?ValidateContactCache@dgWorld@@ABEHPAVdgBody@@0PAVdgContact@@@Z 1001d870 f physics_2009:dgNarrowPhaseCollision.obj
0001:0001ced0 ?CompoundContactsSimd@dgWorld@@ABEXQAUdgPair@dgCollidingPairCollector@@AAVdgCollisionParamProxi@@@Z 1001ded0 f physics_2009:dgNarrowPhaseCollision.obj
0001:0001dff0 ?CompoundContacts@dgWorld@@ABEXQAUdgPair@dgCollidingPairCollector@@AAVdgCollisionParamProxi@@@Z 1001eff0 f physics_2009:dgNarrowPhaseCollision.obj
0001:0001f1e0 ?ConvexContactsSimd@dgWorld@@ABEXQAUdgPair@dgCollidingPairCollector@@AAVdgCollisionParamProxi@@@Z 100201e0 f physics_2009:dgNarrowPhaseCollision.obj
0001:0001f2f0 ?ConvexContacts@dgWorld@@ABEXQAUdgPair@dgCollidingPairCollector@@AAVdgCollisionParamProxi@@@Z 100202f0 f physics_2009:dgNarrowPhaseCollision.obj
0001:0001f400 ?SceneContacts@dgWorld@@ABEXQAUdgPair@dgCollidingPairCollector@@AAVdgCollisionParamProxi@@@Z 10020400 f physics_2009:dgNarrowPhaseCollision.obj
0001:0001f4a0 ?SceneContactsSimd@dgWorld@@ABEXQAUdgPair@dgCollidingPairCollector@@AAVdgCollisionParamProxi@@@Z 100204a0 f physics_2009:dgNarrowPhaseCollision.obj
0001:0001f540 ?CalculateContactsSimd@dgWorld@@AAEXQAUdgPair@dgCollidingPairCollector@@MH@Z 10020540 f physics_2009:dgNarrowPhaseCollision.obj
0001:0001f6e0 ?CalculateContacts@dgWorld@@AAEXQAUdgPair@dgCollidingPairCollector@@MH@Z 100206e0 f physics_2009:dgNarrowPhaseCollision.obj
0001:0001f8a0 ?CollideContinueSimd@dgWorld@@QAEHPAVdgCollision@@ABVdgMatrix@@ABVdgVector@@20122AAMPAVdgTriplex@@4PAMHH@Z 100208a0 f physics_2009:dgNarrowPhaseCollision.obj
0001:0001ffc0 ?CollideContinue@dgWorld@@QAEHPAVdgCollision@@ABVdgMatrix@@ABVdgVector@@20122AAMPAVdgTriplex@@4PAMHH@Z 10020fc0 f physics_2009:dgNarrowPhaseCollision.obj
0001:000206e0 ?Collide@dgWorld@@QAEHPAVdgCollision@@ABVdgMatrix@@01PAVdgTriplex@@2PAMHH@Z 100216e0 f physics_2009:dgNarrowPhaseCollision.obj
0001:00020b40 ?ClosestPoint@dgWorld@@QBEHPAVdgCollision@@ABVdgMatrix@@01AAVdgTriplex@@22H@Z 10021b40 f physics_2009:dgNarrowPhaseCollision.obj
0001:00020e10 ?ProcessContacts@dgWorld@@AAEXAAUdgPair@dgCollidingPairCollector@@MH@Z 10021e10 f physics_2009:dgNarrowPhaseCollision.obj
0001:00021fa0 ?ClosestPoint@dgWorld@@QBEHAAVdgTriplex@@PAVdgCollision@@ABVdgMatrix@@00H@Z 10022fa0 f physics_2009:dgNarrowPhaseCollision.obj
0001:00022010 ?Insert@?$dgTree@VdgContactMaterial@@I@@QAEPAVdgTreeNode@1@ABVdgContactMaterial@@IAA_N@Z 10023010 f i physics_2009:dgNarrowPhaseCollision.obj
0001:000220f0 ?Insert@?$dgTree@PAVdgCollision@@I@@QAEPAVdgTreeNode@1@ABQAVdgCollision@@I@Z 100230f0 f i physics_2009:dgNarrowPhaseCollision.obj
0001:00022110 ?CreateNull@dgWorld@@QAEPAVdgCollision@@XZ 10023110 f physics_2009:dgNarrowPhaseCollision.obj
0001:00022190 ?CreateBox@dgWorld@@QAEPAVdgCollision@@MMMABVdgMatrix@@@Z 10023190 f physics_2009:dgNarrowPhaseCollision.obj
0001:00022330 ?CreateSphere@dgWorld@@QAEPAVdgCollision@@MABVdgMatrix@@@Z 10023330 f physics_2009:dgNarrowPhaseCollision.obj
0001:00022440 ?CreateEllipse@dgWorld@@QAEPAVdgCollision@@MMMABVdgMatrix@@@Z 10023440 f physics_2009:dgNarrowPhaseCollision.obj
0001:000225c0 ?CreateCapsule@dgWorld@@QAEPAVdgCollision@@MMABVdgMatrix@@@Z 100235c0 f physics_2009:dgNarrowPhaseCollision.obj
0001:00022710 ?CreateCone@dgWorld@@QAEPAVdgCollision@@MMABVdgMatrix@@@Z 10023710 f physics_2009:dgNarrowPhaseCollision.obj
0001:00022860 ?CreateCylinder@dgWorld@@QAEPAVdgCollision@@MMABVdgMatrix@@@Z 10023860 f physics_2009:dgNarrowPhaseCollision.obj
0001:000229b0 ?CreateChamferCylinder@dgWorld@@QAEPAVdgCollision@@MMABVdgMatrix@@@Z 100239b0 f physics_2009:dgNarrowPhaseCollision.obj
0001:00022b00 ?CreateConvexHull@dgWorld@@QAEPAVdgCollision@@HPBMHMABVdgMatrix@@@Z 10023b00 f physics_2009:dgNarrowPhaseCollision.obj
0001:00022cc0 ?CreateFromSerialization@dgWorld@@QAEPAVdgCollision@@P6AXPAX0I@Z0@Z 10023cc0 f physics_2009:dgNarrowPhaseCollision.obj
0001:00022ff0 ?CreateBodyGroupID@dgWorld@@QAEIXZ 10023ff0 f physics_2009:dgNarrowPhaseCollision.obj
0001:00023070 ?CalculateSignature@dgCollisionConvexPolygon@dgCollisionMesh@@UBEHXZ 10024070 f physics_2009:dgCollisionMesh.obj
0001:00023080 ?RayCastSimd@dgCollision@@UBEMABVdgVector@@0AAVdgContactPoint@@P6AIPBVdgBody@@PBV1@PAX@Z24@Z 10024080 f physics_2009:dgCollision.obj
0001:00023080 ?RayCast@dgCollisionConvexPolygon@dgCollisionMesh@@UBEMABVdgVector@@0AAVdgContactPoint@@P6AIPBVdgBody@@PBVdgCollision@@PAX@Z24@Z 10024080 f physics_2009:dgCollisionMesh.obj
0001:00023090 ?CalculateInertia@dgCollisionMesh@@UBEXAAVdgVector@@0@Z 10024090 f physics_2009:dgCollisionMesh.obj
0001:00023090 ?CalculateInertia@dgCollisionConvexPolygon@dgCollisionMesh@@UBEXAAVdgVector@@0@Z 10024090 f physics_2009:dgCollisionMesh.obj
0001:00023090 ?CalculateInertia@dgCollisionScene@@EBEXAAVdgVector@@0@Z 10024090 f physics_2009:dgCollisionScene.obj
0001:00023090 ?CalculateInertia@dgCollisionNull@@MBEXAAVdgVector@@0@Z 10024090 f physics_2009:dgCollisionNull.obj
0001:00023090 ?CalculateInertia@dgCollisionPoint@@UBEXAAVdgVector@@0@Z 10024090 f physics_2009:dgCollisionSphere.obj
0001:000230b0 ?SupportVertexSimd@dgCollisionConvexPolygon@dgCollisionMesh@@UBE?AVdgVector@@ABV3@@Z 100240b0 f physics_2009:dgCollisionMesh.obj
0001:00023200 ??1dgCollisionMesh@@UAE@XZ 10024200 f physics_2009:dgCollisionMesh.obj
0001:00023240 ?SetCollisionCallback@dgCollisionMesh@@QAEXP6AXPBVdgBody@@0HHPBMH@Z@Z 10024240 f physics_2009:dgCollisionMesh.obj
0001:00023250 ?SetCollisionRayCastCallback@dgCollisionMesh@@QAEXP6AMMPAMHPAX@Z@Z 10024250 f physics_2009:dgCollisionMesh.obj
0001:00023260 ?CalcAABBSimD@dgCollisionNull@@MBEXABVdgMatrix@@AAVdgVector@@1@Z 10024260 f physics_2009:dgCollisionNull.obj
0001:00023260 ?CalcAABBSimD@dgCollisionMesh@@EBEXABVdgMatrix@@AAVdgVector@@1@Z 10024260 f physics_2009:dgCollisionMesh.obj
0001:00023260 ?CalcAABBSimD@dgCollisionScene@@EBEXABVdgMatrix@@AAVdgVector@@1@Z 10024260 f physics_2009:dgCollisionScene.obj
0001:00023270 ?OOBBTest@dgCollisionMesh@@EBE_NABVdgMatrix@@QBVdgConvexCollision@@PAX@Z 10024270 f physics_2009:dgCollisionMesh.obj
0001:00023270 ?OOBBTest@dgCompoundCollision@@MBE_NABVdgMatrix@@QBVdgConvexCollision@@PAX@Z 10024270 f physics_2009:dgCompoundCollision.obj
0001:00023270 ?OOBBTest@dgCollisionScene@@EBE_NABVdgMatrix@@QBVdgConvexCollision@@PAX@Z 10024270 f physics_2009:dgCollisionScene.obj
0001:00023270 ?OOBBTest@dgCollisionConvexModifier@@MBE_NABVdgMatrix@@QBVdgConvexCollision@@PAX@Z 10024270 f physics_2009:dgCollisionConvexModifier.obj
0001:00023270 ?OOBBTest@dgCollisionConvexPolygon@dgCollisionMesh@@UBE_NABVdgMatrix@@QBVdgConvexCollision@@PAX@Z 10024270 f physics_2009:dgCollisionMesh.obj
0001:00023280 ?SupportVertex@dgCollisionConvexPolygon@dgCollisionMesh@@UBE?AVdgVector@@ABV3@@Z 10024280 f physics_2009:dgCollisionMesh.obj
0001:00023430 ??_EdgCollisionMesh@@UAEPAXI@Z 10024430 f i physics_2009:dgCollisionMesh.obj
0001:00023430 ??_GdgCollisionMesh@@UAEPAXI@Z 10024430 f i physics_2009:dgCollisionMesh.obj
0001:00023450 ??0dgCollisionConvexPolygon@dgCollisionMesh@@QAE@XZ 10024450 f physics_2009:dgCollisionMesh.obj
0001:00023500 ??_GdgCollisionConvexPolygon@dgCollisionMesh@@UAEPAXI@Z 10024500 f i physics_2009:dgCollisionMesh.obj
0001:00023500 ??_EdgCollisionConvexPolygon@dgCollisionMesh@@UAEPAXI@Z 10024500 f i physics_2009:dgCollisionMesh.obj
0001:00023520 ?CalculateNormalSimd@dgCollisionConvexPolygon@dgCollisionMesh@@QAEXXZ 10024520 f physics_2009:dgCollisionMesh.obj
0001:00023630 ?CalculateNormal@dgCollisionConvexPolygon@dgCollisionMesh@@QAEXXZ 10024630 f physics_2009:dgCollisionMesh.obj
0001:00023800 ?ClipContacts@dgCollisionConvexPolygon@dgCollisionMesh@@QBEHHQAVdgContactPoint@@ABVdgMatrix@@@Z 10024800 f physics_2009:dgCollisionMesh.obj
0001:00023e10 ?ClosestDistanceToTriangle@dgCollisionConvexPolygon@dgCollisionMesh@@QBE?AVdgVector@@ABV3@000@Z 10024e10 f physics_2009:dgCollisionMesh.obj
0001:00024370 ?PointToPolygonDistance@dgCollisionConvexPolygon@dgCollisionMesh@@QAE_NABVdgVector@@MAAV3@@Z 10025370 f physics_2009:dgCollisionMesh.obj
0001:000245f0 ?MovingPointToPolygonContact@dgCollisionConvexPolygon@dgCollisionMesh@@QAEMABVdgVector@@0MAAVdgContactPoint@@@Z 100255f0 f physics_2009:dgCollisionMesh.obj
0001:00024fa0 ?CalculatePlaneIntersection@dgCollisionConvexPolygon@dgCollisionMesh@@UBEHABVdgVector@@0QAV3@@Z 10025fa0 f physics_2009:dgCollisionMesh.obj
0001:00025be0 ?CalculatePlaneIntersectionSimd@dgCollisionConvexPolygon@dgCollisionMesh@@UBEHABVdgVector@@0QAV3@@Z 10026be0 f physics_2009:dgCollisionMesh.obj
0001:00026300 ?CalcAABB@dgCollisionMesh@@EBEXABVdgMatrix@@AAVdgVector@@1@Z 10027300 f physics_2009:dgCollisionMesh.obj
0001:00026300 ?CalcAABB@dgCollisionScene@@EBEXABVdgMatrix@@AAVdgVector@@1@Z 10027300 f physics_2009:dgCollisionScene.obj
0001:00026510 ?CalculateVolumeIntegral@dgCollisionMesh@@EBE?AVdgVector@@ABVdgMatrix@@P6AIPAX10AAVdgPlane@@@Z1@Z 10027510 f physics_2009:dgCollisionMesh.obj
0001:00026510 ?CalculateVolumeIntegral@dgCollisionScene@@EBE?AVdgVector@@ABVdgMatrix@@P6AIPAX10AAVdgPlane@@@Z1@Z 10027510 f physics_2009:dgCollisionScene.obj
0001:00026510 ?CalculateVolumeIntegral@dgCollisionNull@@MBE?AVdgVector@@ABVdgMatrix@@P6AIPAX10AAVdgPlane@@@Z1@Z 10027510 f physics_2009:dgCollisionNull.obj
0001:00026530 ?QuickTestContinueSimd@dgCollisionConvexPolygon@dgCollisionMesh@@QAEHPBVdgConvexCollision@@ABVdgMatrix@@@Z 10027530 f physics_2009:dgCollisionMesh.obj
0001:00026930 ?QuickTestContinue@dgCollisionConvexPolygon@dgCollisionMesh@@QAEHPBVdgConvexCollision@@ABVdgMatrix@@@Z 10027930 f physics_2009:dgCollisionMesh.obj
0001:00026c30 ?QuickTest@dgCollisionConvexPolygon@dgCollisionMesh@@QAEHPBVdgConvexCollision@@ABVdgMatrix@@@Z 10027c30 f physics_2009:dgCollisionMesh.obj
0001:000270a0 ?QuickTestSimd@dgCollisionConvexPolygon@dgCollisionMesh@@QAEHPBVdgConvexCollision@@ABVdgMatrix@@@Z 100280a0 f physics_2009:dgCollisionMesh.obj
0001:000275c0 ??0dgCollisionMesh@@QAE@W4dgCollisionID@@@Z 100285c0 f physics_2009:dgCollisionMesh.obj
0001:00027680 ??0dgCollisionMesh@@QAE@PAVdgWorld@@P6AXPAX1I@Z1@Z 10028680 f physics_2009:dgCollisionMesh.obj
0001:00027740 ??0dgCollisionBVH@@QAE@XZ 10028740 f physics_2009:dgCollisionBVH.obj
0001:00027780 ?Serialize@dgCollisionBVH@@EBEXP6AXPAXPBXI@Z0@Z 10028780 f physics_2009:dgCollisionBVH.obj
0001:000277b0 ?AddFace@dgCollisionBVH@@QAEXHQBMHH@Z 100287b0 f physics_2009:dgCollisionBVH.obj
0001:00027820 ?GetCollisionInfo@dgCollisionBVH@@EBEXPAVdgCollisionInfo@@@Z 10028820 f physics_2009:dgCollisionBVH.obj
0001:00027820 ?GetCollisionInfo@dgCollisionConvexHull@@EBEXPAVdgCollisionInfo@@@Z 10028820 f physics_2009:dgCollisionConvexHull.obj
0001:00027850 ?CollectVertexListIndexList@dgCollisionBVH@@CA?AW4dgIntersectStatus@@PAXQBMHQBHH@Z 10028850 f physics_2009:dgCollisionBVH.obj
0001:000278f0 ?GetVertexListIndexList@dgCollisionBVH@@QBEXABVdgVector@@0AAVdgGetVertexListIndexList@1@@Z 100288f0 f physics_2009:dgCollisionBVH.obj
0001:00027920 ?SupportVertex@dgCollisionBVH@@EBE?AVdgVector@@ABV2@@Z 10028920 f physics_2009:dgCollisionBVH.obj
0001:00027950 ??_EdgCollisionBVH@@WMA@AEPAXI@Z 10028950 f i physics_2009:dgCollisionBVH.obj
0001:00027960 ?Serialize@dgCollisionBVH@@GMA@BEXP6AXPAXPBXI@Z0@Z 10028960 f i physics_2009:dgCollisionBVH.obj
0001:00027970 ??_EdgCollisionBVH@@UAEPAXI@Z 10028970 f i physics_2009:dgCollisionBVH.obj
0001:00027970 ??_GdgCollisionBVH@@UAEPAXI@Z 10028970 f i physics_2009:dgCollisionBVH.obj
0001:000279b0 ?BeginBuild@dgCollisionBVH@@QAEXXZ 100289b0 f physics_2009:dgCollisionBVH.obj
0001:000279f0 ??0dgCollisionBVH@@QAE@PAVdgWorld@@P6AXPAX1I@Z1@Z 100289f0 f physics_2009:dgCollisionBVH.obj
0001:00027a80 ?EndBuild@dgCollisionBVH@@QAEXH@Z 10028a80 f physics_2009:dgCollisionBVH.obj
0001:00027b10 ?RayHitSimd@dgCollisionBVH@@CAMPAXQBMHQBHH@Z 10028b10 f physics_2009:dgCollisionBVH.obj
0001:00027bd0 ?RayHit@dgCollisionBVH@@CAMPAXQBMHQBHH@Z 10028bd0 f physics_2009:dgCollisionBVH.obj
0001:00027c90 ?RayHitUserSimd@dgCollisionBVH@@CAMPAXQBMHQBHH@Z 10028c90 f physics_2009:dgCollisionBVH.obj
0001:00027dc0 ?RayHitUser@dgCollisionBVH@@CAMPAXQBMHQBHH@Z 10028dc0 f physics_2009:dgCollisionBVH.obj
0001:00027f50 ?RayCastSimd@dgCollisionBVH@@EBEMABVdgVector@@0AAVdgContactPoint@@P6AIPBVdgBody@@PBVdgCollision@@PAX@Z24@Z 10028f50 f physics_2009:dgCollisionBVH.obj
0001:00028160 ?RayCast@dgCollisionBVH@@EBEMABVdgVector@@0AAVdgContactPoint@@P6AIPBVdgBody@@PBVdgCollision@@PAX@Z24@Z 10029160 f physics_2009:dgCollisionBVH.obj
0001:00028370 ?GetPolygon@dgCollisionBVH@@CA?AW4dgIntersectStatus@@PAXQBMHQBHH@Z 10029370 f physics_2009:dgCollisionBVH.obj
0001:000287a0 ?GetCollidingFacesSimd@dgCollisionBVH@@EBEXQAVdgPolygonMeshDesc@@@Z 100297a0 f physics_2009:dgCollisionBVH.obj
0001:00028810 ?GetCollidingFaces@dgCollisionBVH@@EBEXQAVdgPolygonMeshDesc@@@Z 10029810 f physics_2009:dgCollisionBVH.obj
0001:00028880 ?ShowDebugPolygon@dgCollisionBVH@@CA?AW4dgIntersectStatus@@PAXQBMHQBHH@Z 10029880 f physics_2009:dgCollisionBVH.obj
0001:00028c20 ?DebugCollision@dgCollisionBVH@@EBEXABVdgMatrix@@P6AXPAXHPBMH@Z1@Z 10029c20 f physics_2009:dgCollisionBVH.obj
0001:00028ca0 ??_GdgSceneNode@dgCollisionScene@@QAEPAXI@Z 10029ca0 f i physics_2009:dgCollisionScene.obj
0001:00028cf0 ?GetBoxMinRadius@dgCollisionScene@@EBEMXZ 10029cf0 f physics_2009:dgCollisionScene.obj
0001:00028cf0 ?GetBoxMinRadius@dgCollisionMesh@@UBEMXZ 10029cf0 f physics_2009:dgCollisionMesh.obj
0001:00028cf0 ?GetVolume@dgCollisionConvexPolygon@dgCollisionMesh@@UBEMXZ 10029cf0 f physics_2009:dgCollisionMesh.obj
0001:00028cf0 ?GetVolume@dgCollisionScene@@EBEMXZ 10029cf0 f physics_2009:dgCollisionScene.obj
0001:00028cf0 ?GetVolume@dgCollisionNull@@MBEMXZ 10029cf0 f physics_2009:dgCollisionNull.obj
0001:00028cf0 ?GetBoxMaxRadius@dgCollisionConvexPolygon@dgCollisionMesh@@UBEMXZ 10029cf0 f physics_2009:dgCollisionMesh.obj
0001:00028cf0 ?GetBoxMaxRadius@dgCollisionMesh@@UBEMXZ 10029cf0 f physics_2009:dgCollisionMesh.obj
0001:00028cf0 ?GetBoxMinRadius@dgCollisionConvexPolygon@dgCollisionMesh@@UBEMXZ 10029cf0 f physics_2009:dgCollisionMesh.obj
0001:00028cf0 ?GetBoxMaxRadius@dgCollisionScene@@EBEMXZ 10029cf0 f physics_2009:dgCollisionScene.obj
0001:00028cf0 ?GetVolume@dgCollisionMesh@@UBEMXZ 10029cf0 f physics_2009:dgCollisionMesh.obj
0001:00028cf0 ?GetVolume@dgCollisionPoint@@UBEMXZ 10029cf0 f physics_2009:dgCollisionSphere.obj
0001:00028d00 ?UpdateAABB@dgSceneNode@dgCollisionScene@@QAEXABVdgVector@@0@Z 10029d00 f i physics_2009:dgCollisionScene.obj
0001:00028e20 ?Serialize@dgCollisionScene@@EBEXP6AXPAXPBXI@Z0@Z 10029e20 f physics_2009:dgCollisionScene.obj
0001:00028fa0 ?SetProxyMatrix@dgCollisionScene@@QAEXPAXABVdgMatrix@@@Z 10029fa0 f physics_2009:dgCollisionScene.obj
0001:00028ff0 ?SetCollisionCallback@dgCollisionScene@@QAEXP6AXPBVdgBody@@0HHPBMH@Z@Z 10029ff0 f physics_2009:dgCollisionScene.obj
0001:00029020 ?DebugCollision@dgCollisionScene@@EBEXABVdgMatrix@@P6AXPAXHPBMH@Z1@Z 1002a020 f physics_2009:dgCollisionScene.obj
0001:00029090 ?GetCollisionInfo@dgCollisionScene@@EBEXPAVdgCollisionInfo@@@Z 1002a090 f physics_2009:dgCollisionScene.obj
0001:000290c0 ?RemoveAll@?$dgList@UdgProxy@dgCollisionScene@@@@QAEXXZ 1002a0c0 f i physics_2009:dgCollisionScene.obj
0001:00029120 ?Reset@FastRayTest@@QAEXM@Z 1002a120 f i physics_2009:dgCollisionScene.obj
0001:00029180 ?GetProxyMatrix@dgCollisionScene@@QAE?AVdgMatrix@@PAX@Z 1002a180 f physics_2009:dgCollisionScene.obj
0001:00029300 ?SetCollisionBBox@dgCollisionMesh@@MAEXABVdgVector@@0@Z 1002a300 f physics_2009:dgCollisionMesh.obj
0001:00029300 ?SetCollisionBBox@dgCollisionScene@@EAEXABVdgVector@@0@Z 1002a300 f physics_2009:dgCollisionScene.obj
0001:00029400 ?GetAxis@dgCollisionScene@@ABEHQAPAVdgListNode@?$dgList@UdgProxy@dgCollisionScene@@@@H@Z 1002a400 f physics_2009:dgCollisionScene.obj
0001:000295a0 ?RayCast@dgCollisionScene@@EBEMABVdgVector@@0AAVdgContactPoint@@P6AIPBVdgBody@@PBVdgCollision@@PAX@Z24@Z 1002a5a0 f physics_2009:dgCollisionScene.obj
0001:00029ad0 ?CollidePairSimd@dgCollisionScene@@QBEXQAUdgPair@dgCollidingPairCollector@@AAVdgCollisionParamProxi@@@Z 1002aad0 f physics_2009:dgCollisionScene.obj
0001:00029e90 ?CollidePair@dgCollisionScene@@QBEXQAUdgPair@dgCollidingPairCollector@@AAVdgCollisionParamProxi@@@Z 1002ae90 f physics_2009:dgCollisionScene.obj
0001:0002a350 ?SortAABBBoxes@dgCollisionScene@@ABEHQAPAVdgListNode@?$dgList@UdgProxy@dgCollisionScene@@@@H@Z 1002b350 f physics_2009:dgCollisionScene.obj
0001:0002a4c0 ?SortAndSpliteSplite@dgCollisionScene@@ABEHQAPAVdgListNode@?$dgList@UdgProxy@dgCollisionScene@@@@H@Z 1002b4c0 f physics_2009:dgCollisionScene.obj
0001:0002a6f0 ?BuildTree@dgCollisionScene@@AAEPAUdgSceneNode@1@PAU21@QAPAVdgListNode@?$dgList@UdgProxy@dgCollisionScene@@@@HH@Z 1002b6f0 f physics_2009:dgCollisionScene.obj
0001:0002a820 ??0dgCollisionScene@@QAE@PAVdgWorld@@@Z 1002b820 f physics_2009:dgCollisionScene.obj
0001:0002a8b0 ??1dgCollisionScene@@UAE@XZ 1002b8b0 f physics_2009:dgCollisionScene.obj
0001:0002a930 ?RayCastSimd@dgCollisionScene@@EBEMABVdgVector@@0AAVdgContactPoint@@P6AIPBVdgBody@@PBVdgCollision@@PAX@Z24@Z 1002b930 f physics_2009:dgCollisionScene.obj
0001:0002ae60 ??_GdgCollisionScene@@UAEPAXI@Z 1002be60 f i physics_2009:dgCollisionScene.obj
0001:0002ae60 ??_EdgCollisionScene@@UAEPAXI@Z 1002be60 f i physics_2009:dgCollisionScene.obj
0001:0002ae80 ?Append@?$dgList@UdgProxy@dgCollisionScene@@@@QAEPAVdgListNode@1@XZ 1002be80 f i physics_2009:dgCollisionScene.obj
0001:0002af20 ?AddProxy@dgCollisionScene@@QAEPAXPAVdgCollision@@@Z 1002bf20 f physics_2009:dgCollisionScene.obj
0001:0002af70 ?BuildTree@dgCollisionScene@@QAEXXZ 1002bf70 f physics_2009:dgCollisionScene.obj
0001:0002b0c0 ??0dgCollisionScene@@QAE@PAVdgWorld@@P6AXPAX1I@Z1@Z 1002c0c0 f physics_2009:dgCollisionScene.obj
0001:0002b370 ?SetAparentMassMatrix@dgBody@@QAEXABVdgVector@@@Z 1002c370 f physics_2009:dgBody.obj
0001:0002b3f0 ??DdgQuaternion@@QBE?AV0@ABV0@@Z 1002c3f0 f i physics_2009:dgBody.obj
0001:0002b480 ?AddBuoyancyForce@dgBody@@QAEXMMMABVdgVector@@P6AIPAX1ABVdgMatrix@@AAVdgPlane@@@Z1@Z 1002c480 f physics_2009:dgBody.obj
0001:0002b7f0 ?CalcInvInertiaMatrix@dgBody@@QAEXXZ 1002c7f0 f physics_2009:dgBody.obj
0001:0002b8c0 ?CalcInvInertiaMatrixSimD@dgBody@@QAEXXZ 1002c8c0 f physics_2009:dgBody.obj
0001:0002b9b0 ?CalculateInverseDynamicForce@dgBody@@QBE?AVdgVector@@ABV2@M@Z 1002c9b0 f physics_2009:dgBody.obj
0001:0002ba70 ?GetFirstJoint@dgBody@@QBEPAVdgConstraint@@XZ 1002ca70 f physics_2009:dgBody.obj
0001:0002baa0 ?GetNextJoint@dgBody@@QBEPAVdgConstraint@@PAV2@@Z 1002caa0 f physics_2009:dgBody.obj
0001:0002bae0 ?GetFirstContact@dgBody@@QBEPAVdgConstraint@@XZ 1002cae0 f physics_2009:dgBody.obj
0001:0002bb10 ?GetNextContact@dgBody@@QBEPAVdgConstraint@@PAV2@@Z 1002cb10 f physics_2009:dgBody.obj
0001:0002bb50 ?Freeze@dgBody@@QAEXXZ 1002cb50 f physics_2009:dgBody.obj
0001:0002bba0 ?Unfreeze@dgBody@@QAEXXZ 1002cba0 f physics_2009:dgBody.obj
0001:0002bbf0 ?RotateToEnd@?$dgList@VdgBodyMasterListRow@@@@QAEXPAVdgListNode@1@@Z 1002cbf0 f i physics_2009:dgBody.obj
0001:0002bc50 ?InsertAfter@?$dgList@VdgBodyMasterListRow@@@@QAEXPAVdgListNode@1@0@Z 1002cc50 f i physics_2009:dgBody.obj
0001:0002bcc0 ??0dgBody@@QAE@XZ 1002ccc0 f physics_2009:dgBody.obj
0001:0002bce0 ?SetMassMatrix@dgBody@@QAEXMMMM@Z 1002cce0 f physics_2009:dgBody.obj
0001:0002bde0 ?UpdateCollisionMatrixSimD@dgBody@@AAEXMH@Z 1002cde0 f physics_2009:dgBody.obj
0001:0002c560 ?UpdateCollisionMatrix@dgBody@@AAEXMH@Z 1002d560 f physics_2009:dgBody.obj
0001:0002cb40 ?UpdateMatrix@dgBody@@AAEXMH@Z 1002db40 f physics_2009:dgBody.obj
0001:0002cb70 ?IntegrateVelocity@dgBody@@AAEXM@Z 1002db70 f physics_2009:dgBody.obj
0001:0002cf10 ?CalculateContinueVelocity@dgBody@@ABEXMAAVdgVector@@0@Z 1002df10 f physics_2009:dgBody.obj
0001:0002d100 ?CalculateContinueVelocitySimD@dgBody@@ABEXMAAVdgVector@@0@Z 1002e100 f physics_2009:dgBody.obj
0001:0002d2c0 ?SetFreeze@dgBody@@QAEX_N@Z 1002e2c0 f physics_2009:dgBody.obj
0001:0002d2e0 ?AddImpulse@dgBody@@AAEXABVdgVector@@0@Z 1002e2e0 f physics_2009:dgBody.obj
0001:0002d740 ?SetMatrix@dgBody@@QAEXABVdgMatrix@@@Z 1002e740 f physics_2009:dgBody.obj
0001:0002d870 ?SetMatrixIgnoreSleep@dgBody@@QAEXABVdgMatrix@@@Z 1002e870 f physics_2009:dgBody.obj
0001:0002d910 ?RayCast@dgBody@@QBEMABUdgLineBox@@P6AMPBV1@ABVdgVector@@HPAXM@ZP6AI1PBVdgCollision@@3@Z3M@Z 1002e910 f physics_2009:dgBody.obj
0001:0002dd90 ?AttachCollision@dgBody@@QAEXPAVdgCollision@@@Z 1002ed90 f physics_2009:dgBody.obj
0001:0002dea0 ?SetJointParameterCallBack@dgBallConstraint@@QAEXP6AIABV1@M@Z@Z 1002eea0 f physics_2009:dgBallConstraint.obj
0001:0002deb0 ?GetJointAngle@dgBallConstraint@@QBE?AVdgVector@@XZ 1002eeb0 f physics_2009:dgBallConstraint.obj
0001:0002dee0 ?SetTwistLimitState@dgBallConstraint@@QAEX_N@Z 1002eee0 f physics_2009:dgBallConstraint.obj
0001:0002df00 ?SetConeLimitState@dgBallConstraint@@QAEX_N@Z 1002ef00 f physics_2009:dgBallConstraint.obj
0001:0002df20 ?SetLatealLimitState@dgBallConstraint@@QAEX_N@Z 1002ef20 f physics_2009:dgBallConstraint.obj
0001:0002df40 ??_EdgBallConstraint@@EAEPAXI@Z 1002ef40 f i physics_2009:dgBallConstraint.obj
0001:0002df40 ??_GdgBallConstraint@@EAEPAXI@Z 1002ef40 f i physics_2009:dgBallConstraint.obj
0001:0002df70 ??0dgBallConstraint@@AAE@XZ 1002ef70 f physics_2009:dgBallConstraint.obj
0001:0002dff0 ?GetJointOmega@dgBallConstraint@@QBE?AVdgVector@@XZ 1002eff0 f physics_2009:dgBallConstraint.obj
0001:0002e180 ?GetJointForce@dgBallConstraint@@QBE?AVdgVector@@XZ 1002f180 f physics_2009:dgBallConstraint.obj
0001:0002e2b0 ?SetLimits@dgBallConstraint@@QAEXABVdgVector@@MMM0MM@Z 1002f2b0 f physics_2009:dgBallConstraint.obj
0001:0002ec60 ?SetPivotPoint@dgBallConstraint@@AAEXABVdgVector@@@Z 1002fc60 f physics_2009:dgBallConstraint.obj
0001:0002ed70 ?JacobianDerivative@dgBallConstraint@@EAEIAAVdgContraintDescritor@@@Z 1002fd70 f physics_2009:dgBallConstraint.obj
0001:0002f620 ??0dgHingeConstraint@@AAE@XZ 10030620 f physics_2009:dgHingeConstraint.obj
0001:0002f660 ?SetJointParameterCallBack@dgSlidingConstraint@@QAEXP6AIABV1@PAVdgJointCallBackParam@@@Z@Z 10030660 f physics_2009:dgSlidingConstraint.obj
0001:0002f660 ?SetJointParameterCallBack@dgHingeConstraint@@QAEXP6AIABV1@PAVdgJointCallBackParam@@@Z@Z 10030660 f physics_2009:dgHingeConstraint.obj
0001:0002f670 ??_EdgHingeConstraint@@EAEPAXI@Z 10030670 f i physics_2009:dgHingeConstraint.obj
0001:0002f670 ??_GdgHingeConstraint@@EAEPAXI@Z 10030670 f i physics_2009:dgHingeConstraint.obj
0001:0002f6a0 ?CalculateStopAlpha@dgHingeConstraint@@QBEMMPBVdgJointCallBackParam@@@Z 100306a0 f physics_2009:dgHingeConstraint.obj
0001:0002f780 ?GetJointForce@dgHingeConstraint@@QBE?AVdgVector@@XZ 10030780 f physics_2009:dgHingeConstraint.obj
0001:0002f970 ?JacobianDerivative@dgHingeConstraint@@EAEIAAVdgContraintDescritor@@@Z 10030970 f physics_2009:dgHingeConstraint.obj
0001:0002fc70 ??0dgSlidingConstraint@@AAE@XZ 10030c70 f physics_2009:dgSlidingConstraint.obj
0001:0002fcb0 ??_GdgSlidingConstraint@@EAEPAXI@Z 10030cb0 f i physics_2009:dgSlidingConstraint.obj
0001:0002fcb0 ??_EdgSlidingConstraint@@EAEPAXI@Z 10030cb0 f i physics_2009:dgSlidingConstraint.obj
0001:0002fce0 ?CalculateStopAccel@dgSlidingConstraint@@QBEMMPBVdgJointCallBackParam@@@Z 10030ce0 f physics_2009:dgSlidingConstraint.obj
0001:0002fdb0 ?GetJointForce@dgSlidingConstraint@@QBE?AVdgVector@@XZ 10030db0 f physics_2009:dgSlidingConstraint.obj
0001:0002ffa0 ?JacobianDerivative@dgSlidingConstraint@@EAEIAAVdgContraintDescritor@@@Z 10030fa0 f physics_2009:dgSlidingConstraint.obj
0001:00030550 ??0dgCorkscrewConstraint@@AAE@XZ 10031550 f physics_2009:dgCorkscrewConstraint.obj
0001:00030590 ?GetJointAngle0@dgUniversalConstraint@@QBEMXZ 10031590 f physics_2009:dgUniversalConstraint.obj
0001:00030590 ?GetJointAngle@dgHingeConstraint@@QBEMXZ 10031590 f physics_2009:dgHingeConstraint.obj
0001:00030590 ?GetJointPosit@dgSlidingConstraint@@QBEMXZ 10031590 f physics_2009:dgSlidingConstraint.obj
0001:00030590 ?GetJointAngle@dgCorkscrewConstraint@@QBEMXZ 10031590 f physics_2009:dgCorkscrewConstraint.obj
0001:000305a0 ??_GdgCorkscrewConstraint@@EAEPAXI@Z 100315a0 f i physics_2009:dgCorkscrewConstraint.obj
0001:000305a0 ??_EdgCorkscrewConstraint@@EAEPAXI@Z 100315a0 f i physics_2009:dgCorkscrewConstraint.obj
0001:000305d0 ?GetJointVeloc@dgSlidingConstraint@@QBEMXZ 100315d0 f physics_2009:dgSlidingConstraint.obj
0001:000305d0 ?GetJointVeloc@dgCorkscrewConstraint@@QBEMXZ 100315d0 f physics_2009:dgCorkscrewConstraint.obj
0001:00030680 ?CalculateStopAccel@dgCorkscrewConstraint@@QBEMMPBVdgJointCallBackParam@@@Z 10031680 f physics_2009:dgCorkscrewConstraint.obj
0001:00030750 ?JacobianDerivative@dgCorkscrewConstraint@@EAEIAAVdgContraintDescritor@@@Z 10031750 f physics_2009:dgCorkscrewConstraint.obj
0001:00030c90 ??0dgUniversalConstraint@@AAE@XZ 10031c90 f physics_2009:dgUniversalConstraint.obj
0001:00030cd0 ?SetJointParameterCallBack@dgUniversalConstraint@@QAEXP6AIABV1@PAVdgJointCallBackParam@@@Z@Z 10031cd0 f physics_2009:dgUniversalConstraint.obj
0001:00030cd0 ?SetJointParameterCallBack@dgCorkscrewConstraint@@QAEXP6AIABV1@PAVdgJointCallBackParam@@@Z@Z 10031cd0 f physics_2009:dgCorkscrewConstraint.obj
0001:00030ce0 ?GetJointPosit@dgCorkscrewConstraint@@QBEMXZ 10031ce0 f physics_2009:dgCorkscrewConstraint.obj
0001:00030ce0 ?GetJointAngle1@dgUniversalConstraint@@QBEMXZ 10031ce0 f physics_2009:dgUniversalConstraint.obj
0001:00030cf0 ??_GdgUniversalConstraint@@EAEPAXI@Z 10031cf0 f i physics_2009:dgUniversalConstraint.obj
0001:00030cf0 ??_EdgUniversalConstraint@@EAEPAXI@Z 10031cf0 f i physics_2009:dgUniversalConstraint.obj
0001:00030d20 ?GetJointOmega@dgCorkscrewConstraint@@QBEMXZ 10031d20 f physics_2009:dgCorkscrewConstraint.obj
0001:00030d20 ?GetJointOmega@dgHingeConstraint@@QBEMXZ 10031d20 f physics_2009:dgHingeConstraint.obj
0001:00030d20 ?GetJointOmega0@dgUniversalConstraint@@QBEMXZ 10031d20 f physics_2009:dgUniversalConstraint.obj
0001:00030dd0 ?GetJointOmega1@dgUniversalConstraint@@QBEMXZ 10031dd0 f physics_2009:dgUniversalConstraint.obj
0001:00030ea0 ?CalculateStopAlpha0@dgUniversalConstraint@@QBEMMPBVdgJointCallBackParam@@@Z 10031ea0 f physics_2009:dgUniversalConstraint.obj
0001:00030ea0 ?CalculateStopAlpha@dgCorkscrewConstraint@@QBEMMPBVdgJointCallBackParam@@@Z 10031ea0 f physics_2009:dgCorkscrewConstraint.obj
0001:00030f70 ?CalculateStopAlpha1@dgUniversalConstraint@@QBEMMPBVdgJointCallBackParam@@@Z 10031f70 f physics_2009:dgUniversalConstraint.obj
0001:00031040 ?GetJointForce@dgCorkscrewConstraint@@QBE?AVdgVector@@XZ 10032040 f physics_2009:dgCorkscrewConstraint.obj
0001:00031040 ?GetJointForce@dgUniversalConstraint@@QBE?AVdgVector@@XZ 10032040 f physics_2009:dgUniversalConstraint.obj
0001:000311d0 ?JacobianDerivative@dgUniversalConstraint@@EAEIAAVdgContraintDescritor@@@Z 100321d0 f physics_2009:dgUniversalConstraint.obj
0001:000317f0 ??0dgUpVectorConstraint@@AAE@XZ 100327f0 f physics_2009:dgUpVectorConstraint.obj
0001:00031830 ?IsBilateral@dgUpVectorConstraint@@UBE_NXZ 10032830 f physics_2009:dgUpVectorConstraint.obj
0001:00031830 ?IsTriggerVolume@dgCollision@@UBE_NXZ 10032830 f physics_2009:dgCollisionMesh.obj
0001:00031830 ?IsBilateral@dgConstraint@@MBE_NXZ 10032830 f physics_2009:dgConstraint.obj
0001:00031840 ?InitPinDir@dgUpVectorConstraint@@QAEXABVdgVector@@@Z 10032840 f physics_2009:dgUpVectorConstraint.obj
0001:00031880 ?GetPinDir@dgUpVectorConstraint@@QBE?AVdgVector@@XZ 10032880 f physics_2009:dgUpVectorConstraint.obj
0001:000318a0 ??_GdgUpVectorConstraint@@EAEPAXI@Z 100328a0 f i physics_2009:dgUpVectorConstraint.obj
0001:000318a0 ??_EdgUpVectorConstraint@@EAEPAXI@Z 100328a0 f i physics_2009:dgUpVectorConstraint.obj
0001:000318d0 ?SetPinDir@dgUpVectorConstraint@@QAEXABVdgVector@@@Z 100328d0 f physics_2009:dgUpVectorConstraint.obj
0001:00031b50 ?JacobianDerivative@dgUpVectorConstraint@@EAEIAAVdgContraintDescritor@@@Z 10032b50 f physics_2009:dgUpVectorConstraint.obj
0001:00031dd0 ?GetUserData@dgConstraint@@QBEPAXXZ 10032dd0 f physics_2009:dgConstraint.obj
0001:00031de0 ?SetUserData@dgConstraint@@QAEXPAX@Z 10032de0 f physics_2009:dgConstraint.obj
0001:00031df0 ?InitInfo@dgConstraint@@IBEXPAVdgConstraintInfo@@@Z 10032df0 f physics_2009:dgConstraint.obj
0001:00031e80 ?InitPointParam@dgConstraint@@IBEXAAVdgPointParam@1@MABVdgVector@@1@Z 10032e80 f physics_2009:dgConstraint.obj
0001:00032140 ?Realloc@dgBroadPhaseCalculateContactsWorkerThread@@QAEXHHH@Z 10033140 f physics_2009:dgBroadPhaseCollision.obj
0001:00032220 ?ThreadExecute@dgBroadPhaseCalculateContactsWorkerThread@@UAEXXZ 10033220 f physics_2009:dgBroadPhaseCollision.obj
0001:000323c0 ?ThreadExecute@dgBroadPhaseMaterialCallbackWorkerThread@@UAEXXZ 100333c0 f physics_2009:dgBroadPhaseCollision.obj
0001:000324c0 ?RayCast@dgSortArray@@QBEMMABUdgLineBox@@P6AMPBVdgBody@@ABVdgVector@@HPAXM@ZP6AI1PBVdgCollision@@3@Z3@Z 100334c0 f physics_2009:dgBroadPhaseCollision.obj
0001:00032530 ?UpdateAutoPair@dgBroadPhaseCell@@AAEXPAVdgWorld@@H@Z 10033530 f physics_2009:dgBroadPhaseCollision.obj
0001:00032690 ?UpdatePairs@dgBroadPhaseCollision@@ABEXPAVdgBody@@PAVdgListNode@?$dgList@VdgSortArrayEntry@@@@HH@Z 10033690 f physics_2009:dgBroadPhaseCollision.obj
0001:00032780 ?UpdatePairs@dgBroadPhaseCollision@@ABEXAAVdgBroadPhaseCell@@0H@Z 10033780 f physics_2009:dgBroadPhaseCollision.obj
0001:00032800 ?ThreadExecute@dgBroadPhaseCellPairsWorkerThread@@UAEXXZ 10033800 f physics_2009:dgBroadPhaseCollision.obj
0001:000328c0 ?UpdateContactsBroadPhaseEnd@dgBroadPhaseCollision@@AAEXM@Z 100338c0 f physics_2009:dgBroadPhaseCollision.obj
0001:00032960 ?Append@?$dgList@VdgSortArrayEntry@@@@QAEPAVdgListNode@1@XZ 10033960 f i physics_2009:dgBroadPhaseCollision.obj
0001:000329e0 ?InsertAfter@?$dgList@VdgSortArrayEntry@@@@QAEXPAVdgListNode@1@0@Z 100339e0 f i physics_2009:dgBroadPhaseCollision.obj
0001:00032a50 ?InsertBefore@?$dgList@VdgSortArrayEntry@@@@QAEXPAVdgListNode@1@0@Z 10033a50 f i physics_2009:dgBroadPhaseCollision.obj
0001:00032ac0 ?RemoveAll@?$dgList@VdgSortArrayEntry@@@@QAEXXZ 10033ac0 f i physics_2009:dgBroadPhaseCollision.obj
0001:00032ac0 ?RemoveAll@?$dgList@VdgBodyMasterListCell@@@@QAEXXZ 10033ac0 f i physics_2009:dgBodyMasterList.obj
0001:00032b20 ?ApplyExtenalForces@dgBody@@AAEXMH@Z 10033b20 f i physics_2009:dgBroadPhaseCollision.obj
0001:00032bc0 ?IsInEquelibrium@dgBody@@QBE_NXZ 10033bc0 f i physics_2009:dgBroadPhaseCollision.obj
0001:00032da0 ?Add@dgSortArray@@QAEXPAVdgBody@@@Z 10033da0 f physics_2009:dgBroadPhaseCollision.obj
0001:00032e50 ?UpdatePoisition@dgSortArray@@QAEXPAVdgBody@@@Z 10033e50 f physics_2009:dgBroadPhaseCollision.obj
0001:00032fa0 ?Add@dgBroadPhaseCell@@AAEXPAVdgBody@@@Z 10033fa0 f physics_2009:dgBroadPhaseCollision.obj
0001:00032fe0 ?UpdatePoisition@dgBroadPhaseCell@@AAEXPAVdgBody@@@Z 10033fe0 f physics_2009:dgBroadPhaseCollision.obj
0001:00033010 ?ForEachBodyInAABB@dgBroadPhaseCollision@@QBEXABVdgVector@@0P6AXPAVdgBody@@@Z@Z 10034010 f physics_2009:dgBroadPhaseCollision.obj
0001:00033310 ?ConvexCast@dgBroadPhaseCollision@@QBEHPAVdgCollision@@ABVdgMatrix@@ABVdgVector@@AAMP6AIPBVdgBody@@PBV2@PAX@Z6QAVdgConvexCastReturnInfo@@HH@Z 10034310 f physics_2009:dgBroadPhaseCollision.obj
0001:00033a30 ?ThreadExecute@dgBroadPhaseApplyExternalForce@@UAEXXZ 10034a30 f physics_2009:dgBroadPhaseCollision.obj
0001:00033c90 ?Remove@?$dgList@VdgSortArrayEntry@@@@QAEXPAVdgListNode@1@@Z 10034c90 f i physics_2009:dgBroadPhaseCollision.obj
0001:00033c90 ?Remove@?$dgList@VdgBodyMasterListCell@@@@QAEXPAVdgListNode@1@@Z 10034c90 f i physics_2009:dgBodyMasterList.obj
0001:00033ce0 ?Remove@dgBroadPhaseCell@@AAEXPAVdgBody@@@Z 10034ce0 f physics_2009:dgBroadPhaseCollision.obj
0001:00033d60 ??0dgBroadPhaseCollision@@AAE@XZ 10034d60 f physics_2009:dgBroadPhaseCollision.obj
0001:00034070 ??1dgBroadPhaseCollision@@AAE@XZ 10035070 f physics_2009:dgBroadPhaseCollision.obj
0001:00034140 ?Remove@dgBroadPhaseCollision@@AAEXPAVdgBody@@@Z 10035140 f physics_2009:dgBroadPhaseCollision.obj
0001:000341a0 ?UpdateContactsBroadPhaseBegin@dgBroadPhaseCollision@@AAEXM_N@Z 100351a0 f physics_2009:dgBroadPhaseCollision.obj
0001:000348e0 ?UpdateContactsSimd@dgBroadPhaseCollision@@AAEXM_N@Z 100358e0 f physics_2009:dgBroadPhaseCollision.obj
0001:00034b20 ?UpdateContacts@dgBroadPhaseCollision@@AAEXM_N@Z 10035b20 f physics_2009:dgBroadPhaseCollision.obj
0001:00034d50 ?RayCast@dgBroadPhaseCollision@@QBEXABVdgVector@@0P6AMPBVdgBody@@0HPAXM@ZP6AI1PBVdgCollision@@2@Z2@Z 10035d50 f physics_2009:dgBroadPhaseCollision.obj
0001:00035540 ?Insert@?$dgTree@VdgBroadPhaseCell@@I@@QAEPAVdgTreeNode@1@ABVdgBroadPhaseCell@@IAA_N@Z 10036540 f i physics_2009:dgBroadPhaseCollision.obj
0001:00035610 ?FindCreate@dgBroadPhaseLayer@@AAEPAVdgBroadPhaseCell@@HH@Z 10036610 f physics_2009:dgBroadPhaseCollision.obj
0001:00035710 ?Add@dgBroadPhaseCollision@@AAEXPAVdgBody@@@Z 10036710 f physics_2009:dgBroadPhaseCollision.obj
0001:00035760 ?UpdateBodyBroadphase@dgBroadPhaseCollision@@AAEXPAVdgBody@@H@Z 10036760 f physics_2009:dgBroadPhaseCollision.obj
0001:00035c10 ?SetWorldSize@dgBroadPhaseCollision@@QAEXABVdgVector@@0@Z 10036c10 f physics_2009:dgBroadPhaseCollision.obj
0001:00035ff0 ?Init@dgBroadPhaseCollision@@AAEXPAVdgWorld@@@Z 10036ff0 f physics_2009:dgBroadPhaseCollision.obj
0001:00036060 ??0dgCollisionConvexHull@@QAE@PAVdgWorld@@P6AXPAX1I@Z1@Z 10037060 f physics_2009:dgCollisionConvexHull.obj
0001:000361e0 ?Serialize@dgCollisionConvexHull@@EBEXP6AXPAXPBXI@Z0@Z 100371e0 f physics_2009:dgCollisionConvexHull.obj
0001:00036310 ?PlaneSplite@dgCollisionConvexHull@@EBEXABVdgPlane@@PAPAV1@1@Z 10037310 f physics_2009:dgCollisionConvexHull.obj
0001:00036310 ?PlaneSplite@dgCollisionBox@@MBEXABVdgPlane@@PAPAVdgCollisionConvexHull@@1@Z 10037310 f physics_2009:dgCollisionBox.obj
0001:00036320 ??_EdgCollisionConvexHull@@UAEPAXI@Z 10037320 f i physics_2009:dgCollisionConvexHull.obj
0001:00036320 ??_GdgCollisionConvexHull@@UAEPAXI@Z 10037320 f i physics_2009:dgCollisionConvexHull.obj
0001:00036360 ?BruteForceSupportVertex@dgCollisionConvexHull@@ABEHHPAVdgVector@@ABV2@@Z 10037360 f physics_2009:dgCollisionConvexHull.obj
0001:000364b0 ?DebugCollision@dgCollisionConvexHull@@EBEXABVdgMatrix@@P6AXPAXHPBMH@Z1@Z 100374b0 f physics_2009:dgCollisionConvexHull.obj
0001:000365a0 ?FaceNormal@dgCollisionConvexHull@@ABE?AVdgVector@@PBVdgEdge@@PBV2@@Z 100375a0 f physics_2009:dgCollisionConvexHull.obj
0001:000367e0 ?RemoveCoplanarEdge@dgCollisionConvexHull@@ABE_NAAVdgPolyhedra@@QAVdgVector@@@Z 100377e0 f physics_2009:dgCollisionConvexHull.obj
0001:00036d80 ?OOBBTest@dgCollisionConvexHull@@EBE_NABVdgMatrix@@QBVdgConvexCollision@@PAX@Z 10037d80 f physics_2009:dgCollisionConvexHull.obj
0001:00037270 ?Insert@?$dgTree@PAVdgConstraint@@PAV1@@@QAEPAVdgTreeNode@1@ABQAVdgConstraint@@PAV3@AA_N@Z 10038270 f i Newton.obj
0001:00037270 ?Insert@?$dgTree@PAVdgEdge@@PAX@@QAEPAVdgTreeNode@1@ABQAVdgEdge@@PAXAA_N@Z 10038270 f i physics_2009:dgCollisionConvexHull.obj
0001:00037270 ?Insert@?$dgTree@PAVdgConstraint@@PAX@@QAEPAVdgTreeNode@1@ABQAVdgConstraint@@PAXAA_N@Z 10038270 f i NewtonClass.obj
0001:00037270 ?Insert@?$dgTree@PAVdgCollision@@I@@QAEPAVdgTreeNode@1@ABQAVdgCollision@@IAA_N@Z 10038270 f i physics_2009:dgNarrowPhaseCollision.obj
0001:00037270 ?Insert@?$dgTree@PAVdgBody@@PAX@@QAEPAVdgTreeNode@1@ABQAVdgBody@@PAXAA_N@Z 10038270 f i NewtonClass.obj
0001:00037340 ?Create@dgCollisionConvexHull@@AAE_NHHPBMM@Z 10038340 f physics_2009:dgCollisionConvexHull.obj
0001:00038d50 ??0dgCollisionConvexHull@@QAE@IHHMPBMABVdgMatrix@@@Z 10039d50 f physics_2009:dgCollisionConvexHull.obj
0001:00039130 ??0dgUserConstraint@@IAE@PAVdgWorld@@PAVdgBody@@1H@Z 1003a130 f physics_2009:dgUserConstraint.obj
0001:00039190 ??1dgUserConstraint@@MAE@XZ 1003a190 f physics_2009:dgUserConstraint.obj
0001:000391a0 ?GetInfo@dgUserConstraint@@MBEXPAVdgConstraintInfo@@@Z 1003a1a0 f physics_2009:dgUserConstraint.obj
0001:000391b0 ??_EdgUserConstraint@@MAEPAXI@Z 1003a1b0 f i physics_2009:dgUserConstraint.obj
0001:000391b0 ??_GdgUserConstraint@@MAEPAXI@Z 1003a1b0 f i physics_2009:dgUserConstraint.obj
0001:000391e0 ?GetStiffness@dgConstraint@@UBEMXZ 1003a1e0 f i physics_2009:dgBilateralConstraint.obj
0001:000391f0 ?SetUserData@dgCollision@@UAEXPAX@Z 1003a1f0 f i physics_2009:dgCollision.obj
0001:000391f0 ?JointVelocityCorrection@dgContact@@EAEXABVdgJointAccelerationDecriptor@@@Z 1003a1f0 f i physics_2009:dgContact.obj
0001:000391f0 ?Remove@dgBilateralConstraint@@MAEXPAVdgWorld@@@Z 1003a1f0 f i NewtonClass.obj
0001:000391f0 ?GetCollisionInfo@dgCollisionMesh@@EBEXPAVdgCollisionInfo@@@Z 1003a1f0 f i physics_2009:dgCollisionMesh.obj
0001:000391f0 ?SetDestructorCallback@dgContact@@EAEXP6AXAAVdgConstraint@@@Z@Z 1003a1f0 f i physics_2009:dgContact.obj
0001:000391f0 ?JointVelocityCorrection@dgBilateralConstraint@@MAEXABVdgJointAccelerationDecriptor@@@Z 1003a1f0 f i physics_2009:dgBilateralConstraint.obj
0001:000391f0 ?GetInfo@dgConstraint@@UBEXPAVdgConstraintInfo@@@Z 1003a1f0 f i physics_2009:dgConstraint.obj
0001:000391f0 ?SetStiffness@dgConstraint@@UAEXM@Z 1003a1f0 f i physics_2009:dgBilateralConstraint.obj
0001:000391f0 ?SetAsTriggerVolume@dgCollision@@UAEX_N@Z 1003a1f0 f i physics_2009:dgCollisionMesh.obj
0001:000391f0 ?ModifierSetMatrix@dgCollision@@UAEXABVdgMatrix@@@Z 1003a1f0 f i physics_2009:dgWorld.obj
0001:00039200 ??1dgBilateralConstraint@@MAE@XZ 1003a200 f physics_2009:dgBilateralConstraint.obj
0001:00039230 ?IsBilateral@dgBilateralConstraint@@MBE_NXZ 1003a230 f physics_2009:dgBilateralConstraint.obj
0001:00039240 ?GetStiffness@dgBilateralConstraint@@MBEMXZ 1003a240 f physics_2009:dgBilateralConstraint.obj
0001:00039260 ?SetDestructorCallback@dgBilateralConstraint@@UAEXP6AXAAVdgConstraint@@@Z@Z 1003a260 f physics_2009:dgBilateralConstraint.obj
0001:00039270 ?SetMotorAcceleration@dgBilateralConstraint@@IAEXHMAAVdgContraintDescritor@@@Z 1003a270 f physics_2009:dgBilateralConstraint.obj
0001:000392b0 ??_EdgConstraint@@MAEPAXI@Z 1003a2b0 f i physics_2009:dgBilateralConstraint.obj
0001:000392b0 ??_GdgConstraint@@MAEPAXI@Z 1003a2b0 f i physics_2009:dgBilateralConstraint.obj
0001:000392d0 ??_EdgBilateralConstraint@@MAEPAXI@Z 1003a2d0 f i physics_2009:dgBilateralConstraint.obj
0001:000392d0 ??_GdgBilateralConstraint@@MAEPAXI@Z 1003a2d0 f i physics_2009:dgBilateralConstraint.obj
0001:00039310 ?SetStiffness@dgBilateralConstraint@@MAEXM@Z 1003a310 f physics_2009:dgBilateralConstraint.obj
0001:00039360 ?SetJacobianDerivative@dgBilateralConstraint@@IAEXHAAVdgContraintDescritor@@PBM1PAM@Z 1003a360 f physics_2009:dgBilateralConstraint.obj
0001:00039420 ?CalculatePointDerivative@dgBilateralConstraint@@IAEXHAAVdgContraintDescritor@@ABVdgVector@@ABVdgPointParam@dgConstraint@@PAM@Z 1003a420 f physics_2009:dgBilateralConstraint.obj
0001:000396d0 ??0dgBilateralConstraint@@IAE@XZ 1003a6d0 f physics_2009:dgBilateralConstraint.obj
0001:00039780 ?CalculateMatrixOffset@dgBilateralConstraint@@IAEXABVdgVector@@0AAVdgMatrix@@1@Z 1003a780 f physics_2009:dgBilateralConstraint.obj
0001:00039d00 ?SetPivotAndPinDir@dgBilateralConstraint@@IAEXABVdgVector@@0@Z 1003ad00 f physics_2009:dgBilateralConstraint.obj
0001:00039d20 ?SetPivotAndPinDir@dgBilateralConstraint@@IAEXABVdgVector@@00@Z 1003ad20 f physics_2009:dgBilateralConstraint.obj
0001:0003a1e0 ?CalculateGlobalMatrixAndAngle@dgBilateralConstraint@@IBE?AVdgVector@@AAVdgMatrix@@0@Z 1003b1e0 f physics_2009:dgBilateralConstraint.obj
0001:0003a3d0 ?CalculateSpringDamperAcceleration@dgBilateralConstraint@@IAEMHABVdgContraintDescritor@@MABVdgVector@@1MM@Z 1003b3d0 f physics_2009:dgBilateralConstraint.obj
0001:0003a5f0 ?CalculateAngularDerivative@dgBilateralConstraint@@IAEXHAAVdgContraintDescritor@@ABVdgVector@@MMPAM@Z 1003b5f0 f physics_2009:dgBilateralConstraint.obj
0001:0003a7a0 ?JointAccelerationsSimd@dgBilateralConstraint@@MAEXABVdgJointAccelerationDecriptor@@@Z 1003b7a0 f physics_2009:dgBilateralConstraint.obj
0001:0003a7a0 ?JointAccelerations@dgBilateralConstraint@@MAEXABVdgJointAccelerationDecriptor@@@Z 1003b7a0 f physics_2009:dgBilateralConstraint.obj
0001:0003aa00 ??1dgCollisionSphere@@UAE@XZ 1003ba00 f physics_2009:dgCollisionSphere.obj
0001:0003aa20 ?CalculateSignature@dgCollisionSphere@@MBEHXZ 1003ba20 f physics_2009:dgCollisionSphere.obj
0001:0003aa90 ?GetCollisionInfo@dgCollisionSphere@@MBEXPAVdgCollisionInfo@@@Z 1003ba90 f physics_2009:dgCollisionSphere.obj
0001:0003aae0 ??_GdgCollisionSphere@@UAEPAXI@Z 1003bae0 f i physics_2009:dgCollisionSphere.obj
0001:0003aae0 ??_EdgCollisionSphere@@UAEPAXI@Z 1003bae0 f i physics_2009:dgCollisionSphere.obj
0001:0003ab20 ?SupportVertex@dgCollisionSphere@@MBE?AVdgVector@@ABV2@@Z 1003bb20 f physics_2009:dgCollisionSphere.obj
0001:0003ab20 ?SupportVertexSimd@dgCollisionSphere@@MBE?AVdgVector@@ABV2@@Z 1003bb20 f physics_2009:dgCollisionSphere.obj
0001:0003ab80 ?CalcAABB@dgCollisionSphere@@MBEXABVdgMatrix@@AAVdgVector@@1@Z 1003bb80 f physics_2009:dgCollisionSphere.obj
0001:0003abe0 ?CalculatePlaneIntersection@dgCollisionSphere@@MBEHABVdgVector@@0QAV2@@Z 1003bbe0 f physics_2009:dgCollisionSphere.obj
0001:0003abe0 ?CalculatePlaneIntersectionSimd@dgCollisionSphere@@MBEHABVdgVector@@0QAV2@@Z 1003bbe0 f physics_2009:dgCollisionSphere.obj
0001:0003ac60 ?TesselateTriangle@dgCollisionSphere@@IBEXHABVdgVector@@00AAHPAV2@@Z 1003bc60 f physics_2009:dgCollisionSphere.obj
0001:0003afd0 ?DebugCollision@dgCollisionSphere@@MBEXABVdgMatrix@@P6AXPAXHPBMH@Z1@Z 1003bfd0 f physics_2009:dgCollisionSphere.obj
0001:0003b280 ?RayCast@dgCollisionSphere@@MBEMABVdgVector@@0AAVdgContactPoint@@P6AIPBVdgBody@@PBVdgCollision@@PAX@Z24@Z 1003c280 f physics_2009:dgCollisionSphere.obj
0001:0003b500 ?CalculateMassProperties@dgCollisionSphere@@MBEMAAVdgVector@@00@Z 1003c500 f physics_2009:dgCollisionSphere.obj
0001:0003b630 ?Serialize@dgCollisionSphere@@MBEXP6AXPAXPBXI@Z0@Z 1003c630 f physics_2009:dgCollisionSphere.obj
0001:0003b690 ?Init@dgCollisionSphere@@IAEXM@Z 1003c690 f physics_2009:dgCollisionSphere.obj
0001:0003ba80 ??0dgCollisionSphere@@QAE@IMABVdgMatrix@@@Z 1003ca80 f physics_2009:dgCollisionSphere.obj
0001:0003bac0 ??0dgCollisionSphere@@QAE@PAVdgWorld@@P6AXPAX1I@Z1@Z 1003cac0 f physics_2009:dgCollisionSphere.obj
0001:0003bb10 ?MassProperties@dgConvexMassData@@QAEMAAVdgVector@@00@Z 1003cb10 f i physics_2009:dgConvexCollision.obj
0001:0003bbf0 ??1dgConvexCollision@@MAE@XZ 1003cbf0 f physics_2009:dgConvexCollision.obj
0001:0003bc30 ?SerializeLow@dgConvexCollision@@MBEXP6AXPAXPBXI@Z0@Z 1003cc30 f physics_2009:dgConvexCollision.obj
0001:0003bc70 ?GetUserData@dgConvexCollision@@MBEPAXXZ 1003cc70 f physics_2009:dgConvexCollision.obj
0001:0003bc80 ?SetUserData@dgConvexCollision@@MAEXPAX@Z 1003cc80 f physics_2009:dgConvexCollision.obj
0001:0003bc90 ?GetVolume@dgConvexCollision@@EBEMXZ 1003cc90 f physics_2009:dgConvexCollision.obj
0001:0003bca0 ?GetBoxMinRadius@dgConvexCollision@@EBEMXZ 1003cca0 f physics_2009:dgConvexCollision.obj
0001:0003bcb0 ?GetBoxMaxRadius@dgConvexCollision@@EBEMXZ 1003ccb0 f physics_2009:dgConvexCollision.obj
0001:0003bcc0 ?IsTriggerVolume@dgConvexCollision@@UBE_NXZ 1003ccc0 f physics_2009:dgConvexCollision.obj
0001:0003bcd0 ?SetAsTriggerVolume@dgConvexCollision@@MAEX_N@Z 1003ccd0 f physics_2009:dgConvexCollision.obj
0001:0003bcf0 ?Push@?$dgUpHeap@HM@@QAEXAAHM@Z 1003ccf0 f i physics_2009:dgConvexCollision.obj
0001:0003bcf0 ?Push@?$dgUpHeap@PAUdgPerimenterEdge@dgContactSolver@@M@@QAEXAAPAUdgPerimenterEdge@dgContactSolver@@M@Z 1003ccf0 f i physics_2009:dgMinkowskiConv.obj
0001:0003bd40 ??_EdgConvexCollision@@MAEPAXI@Z 1003cd40 f i physics_2009:dgConvexCollision.obj
0001:0003bd40 ??_GdgConvexCollision@@MAEPAXI@Z 1003cd40 f i physics_2009:dgConvexCollision.obj
0001:0003bd90 ?GetDiscretedAngleStep@dgConvexCollision@@IBEMM@Z 1003cd90 f physics_2009:dgConvexCollision.obj
0001:0003be00 ?GetSupportEdge@dgConvexCollision@@IBEPAVdgConvexSimplexEdge@@ABVdgVector@@@Z 1003ce00 f physics_2009:dgConvexCollision.obj
0001:0003be90 ?RayHitBox@dgConvexCollision@@ABE_NABVdgVector@@0@Z 1003ce90 f physics_2009:dgConvexCollision.obj
0001:0003c060 ?AddCg@dgConvexMassData@@QAEXHPBVdgVector@@@Z 1003d060 f i physics_2009:dgConvexCollision.obj
0001:0003c230 ?AddInertia@dgConvexMassData@@QAEXHPBM@Z 1003d230 f i physics_2009:dgConvexCollision.obj
0001:0003c520 ??0dgConvexCollision@@IAE@IABVdgMatrix@@W4dgCollisionID@@@Z 1003d520 f physics_2009:dgConvexCollision.obj
0001:0003c620 ??0dgConvexCollision@@IAE@PAVdgWorld@@P6AXPAX1I@Z1@Z 1003d620 f physics_2009:dgConvexCollision.obj
0001:0003c700 ?SetVolumeAndCG@dgConvexCollision@@IAEXXZ 1003d700 f physics_2009:dgConvexCollision.obj
0001:0003cba0 ?DebugCollision@dgConvexCollision@@MBEXABVdgMatrix@@P6AXPAXHPBMH@Z1@Z 1003dba0 f physics_2009:dgConvexCollision.obj
0001:0003ccc0 ?CalcAABB@dgConvexCollision@@UBEXABVdgMatrix@@AAVdgVector@@1@Z 1003dcc0 f physics_2009:dgConvexCollision.obj
0001:0003cee0 ?CalcAABBSimD@dgConvexCollision@@UBEXABVdgMatrix@@AAVdgVector@@1@Z 1003dee0 f physics_2009:dgConvexCollision.obj
0001:0003cf80 ?CalculateInertia@dgConvexCollision@@CAXPAXHPBMH@Z 1003df80 f physics_2009:dgConvexCollision.obj
0001:0003cfa0 ?CalculateMassProperties@dgConvexCollision@@MBEMAAVdgVector@@00@Z 1003dfa0 f physics_2009:dgConvexCollision.obj
0001:0003d010 ?CalculateInertia@dgConvexCollision@@EBEXAAVdgVector@@0@Z 1003e010 f physics_2009:dgConvexCollision.obj
0001:0003d160 ?RayCastClosestFace@dgConvexCollision@@ABEHPAVdgVector@@ABV2@AAM@Z 1003e160 f physics_2009:dgConvexCollision.obj
0001:0003d890 ?CalculateVolumeIntegral@dgConvexCollision@@IBE?AVdgVector@@ABVdgPlane@@@Z 1003e890 f physics_2009:dgConvexCollision.obj
0001:0003dfc0 ?SupportVertex@dgConvexCollision@@UBE?AVdgVector@@ABV2@@Z 1003efc0 f physics_2009:dgConvexCollision.obj
0001:0003e230 ?SupportVertexSimd@dgConvexCollision@@UBE?AVdgVector@@ABV2@@Z 1003f230 f physics_2009:dgConvexCollision.obj
0001:0003e3f0 ?SimplifyClipPolygon@dgConvexCollision@@ABEHHABVdgVector@@PAV2@@Z 1003f3f0 f physics_2009:dgConvexCollision.obj
0001:0003e620 ?RectifyConvexSlice@dgConvexCollision@@IBEHHABVdgVector@@QAV2@@Z 1003f620 f physics_2009:dgConvexCollision.obj
0001:0003ea20 ?CalculatePlaneIntersectionSimd@dgConvexCollision@@UBEHABVdgVector@@0QAV2@@Z 1003fa20 f physics_2009:dgConvexCollision.obj
0001:0003ef10 ?CalculatePlaneIntersection@dgConvexCollision@@UBEHABVdgVector@@0QAV2@@Z 1003ff10 f physics_2009:dgConvexCollision.obj
0001:0003f420 ?RayCast@dgConvexCollision@@UBEMABVdgVector@@0AAVdgContactPoint@@P6AIPBVdgBody@@PBVdgCollision@@PAX@Z24@Z 10040420 f physics_2009:dgConvexCollision.obj
0001:000404c0 ?OOBBTest@dgConvexCollision@@UBE_NABVdgMatrix@@QBV1@PAX@Z 100414c0 f physics_2009:dgConvexCollision.obj
0001:000406a0 ?CalculateVolumeIntegral@dgConvexCollision@@EBE?AVdgVector@@ABVdgMatrix@@P6AIPAX10AAVdgPlane@@@Z1@Z 100416a0 f physics_2009:dgConvexCollision.obj
0001:00040840 ?FindConstraintLink@dgBodyMasterList@@QBEPAVdgListNode@?$dgList@VdgBodyMasterListCell@@@@PBVdgBody@@0@Z 10041840 f physics_2009:dgBodyMasterList.obj
0001:00040870 ?FindConstraintLinkNext@dgBodyMasterList@@QBEPAVdgListNode@?$dgList@VdgBodyMasterListCell@@@@PBV23@PBVdgBody@@@Z 10041870 f physics_2009:dgBodyMasterList.obj
0001:000408a0 ?Addtop@?$dgList@VdgBodyMasterListCell@@@@QAEPAVdgListNode@1@XZ 100418a0 f i physics_2009:dgBodyMasterList.obj
0001:00040910 ?SortList@dgBodyMasterListRow@@QAEXXZ 10041910 f physics_2009:dgBodyMasterList.obj
0001:00040a00 ?AttachConstraint@dgBodyMasterList@@QAEXPAVdgConstraint@@PAVdgBody@@1@Z 10041a00 f physics_2009:dgBodyMasterList.obj
0001:00040ac0 ?SortMasterList@dgBodyMasterList@@QAEXXZ 10041ac0 f physics_2009:dgBodyMasterList.obj
0001:00040c80 ?RemoveConstraint@dgBodyMasterList@@QAEXPAVdgConstraint@@@Z 10041c80 f physics_2009:dgBodyMasterList.obj
0001:00040d20 ?Append@?$dgList@VdgBodyMasterListRow@@@@QAEPAVdgListNode@1@XZ 10041d20 f i physics_2009:dgBodyMasterList.obj
0001:00040da0 ?RemoveAll@?$dgList@VdgBodyMasterListRow@@@@QAEXXZ 10041da0 f i physics_2009:dgBodyMasterList.obj
0001:00040e00 ?AddBody@dgBodyMasterList@@QAEXPAVdgBody@@@Z 10041e00 f physics_2009:dgBodyMasterList.obj
0001:00040e30 ?Remove@?$dgList@VdgBodyMasterListRow@@@@QAEXPAVdgListNode@1@@Z 10041e30 f i physics_2009:dgBodyMasterList.obj
0001:00040e90 ??0dgBodyMasterList@@QAE@XZ 10041e90 f physics_2009:dgBodyMasterList.obj
0001:00040ea0 ??1dgBodyMasterList@@QAE@XZ 10041ea0 f physics_2009:dgBodyMasterList.obj
0001:00040eb0 ?RemoveBody@dgBodyMasterList@@QAEXPAVdgBody@@@Z 10041eb0 f physics_2009:dgBodyMasterList.obj
0001:00040f00 ??0dgCollisionNull@@QAE@I@Z 10041f00 f physics_2009:dgCollisionNull.obj
0001:00040f30 ??0dgCollisionNull@@QAE@PAVdgWorld@@P6AXPAX1I@Z1@Z 10041f30 f physics_2009:dgCollisionNull.obj
0001:00040f60 ?Serialize@dgCollisionNull@@EBEXP6AXPAXPBXI@Z0@Z 10041f60 f physics_2009:dgCollisionNull.obj
0001:00040f70 ?SetCollisionBBox@dgCompoundCollision@@EAEXABVdgVector@@0@Z 10041f70 f physics_2009:dgCompoundCollision.obj
0001:00040f70 ?SetCollisionBBox@dgCollisionSphere@@MAEXABVdgVector@@0@Z 10041f70 f physics_2009:dgCollisionSphere.obj
0001:00040f70 ?SetCollisionBBox@dgCollisionEllipse@@EAEXABVdgVector@@0@Z 10041f70 f physics_2009:dgCollisionEllipse.obj
0001:00040f70 ?SetCollisionBBox@dgCollisionConvexModifier@@EAEXABVdgVector@@0@Z 10041f70 f physics_2009:dgCollisionConvexModifier.obj
0001:00040f70 ?SetCollisionBBox@dgCollisionChamferCylinder@@MAEXABVdgVector@@0@Z 10041f70 f physics_2009:dgCollisionChamferCylinder.obj
0001:00040f70 ?SetCollisionBBox@dgCollisionBox@@MAEXABVdgVector@@0@Z 10041f70 f physics_2009:dgCollisionBox.obj
0001:00040f70 ?Serialize@dgCollisionMesh@@EBEXP6AXPAXPBXI@Z0@Z 10041f70 f physics_2009:dgCollisionMesh.obj
0001:00040f70 ?SetCollisionBBox@dgCollisionConvexHull@@EAEXABVdgVector@@0@Z 10041f70 f physics_2009:dgCollisionConvexHull.obj
0001:00040f70 ?SetCollisionBBox@dgCollisionNull@@EAEXABVdgVector@@0@Z 10041f70 f physics_2009:dgCollisionNull.obj
0001:00040f70 ?SetCollisionBBox@dgCollisionCapsule@@EAEXABVdgVector@@0@Z 10041f70 f physics_2009:dgCollisionCapsule.obj
0001:00040f70 ?GetAABB@dgPolygonSoupDatabase@@UBEXAAVdgVector@@0@Z 10041f70 f corelib_2009:dgAABBPolygonSoup.obj
0001:00040f70 ?Serialize@dgCollisionConvexPolygon@dgCollisionMesh@@UBEXP6AXPAXPBXI@Z0@Z 10041f70 f physics_2009:dgCollisionMesh.obj
0001:00040f70 ?SetCollisionBBox@dgCollisionConvexPolygon@dgCollisionMesh@@UAEXABVdgVector@@0@Z 10041f70 f physics_2009:dgCollisionMesh.obj
0001:00040f70 ?SetCollisionBBox@dgCollisionCylinder@@EAEXABVdgVector@@0@Z 10041f70 f physics_2009:dgCollisionCylinder.obj
0001:00040f70 ?Serialize@dgCollisionUserMesh@@EBEXP6AXPAXPBXI@Z0@Z 10041f70 f physics_2009:dgCollisionUserMesh.obj
0001:00040f70 ?SetCollisionBBox@dgCollisionCone@@EAEXABVdgVector@@0@Z 10041f70 f physics_2009:dgCollisionCone.obj
0001:00040f80 ?ForAllSectorsRayHit@dgPolygonSoupDatabase@@MBEXABVFastRayTest@@P6AMPAXQBMHQBHH@ZQAX@Z 10041f80 f corelib_2009:dgAABBPolygonSoup.obj
0001:00040f80 ?DebugCollision@dgCollisionUserMesh@@EBEXABVdgMatrix@@P6AXPAXHPBMH@Z1@Z 10041f80 f physics_2009:dgCollisionUserMesh.obj
0001:00040f80 ?DebugCollision@dgCollisionNull@@MBEXABVdgMatrix@@P6AXPAXHPBMH@Z1@Z 10041f80 f physics_2009:dgCollisionNull.obj
0001:00040f80 ?DebugCollision@dgCollisionMesh@@EBEXABVdgMatrix@@P6AXPAXHPBMH@Z1@Z 10041f80 f physics_2009:dgCollisionMesh.obj
0001:00040f80 ?SpliteAcrossPlane@dgConvexCollision@@IBEXABVdgPlane@@PAPAVdgCollisionConvexHull@@1@Z 10041f80 f physics_2009:dgConvexCollision.obj
0001:00040f80 ?ForAllSectorsRayHitSimd@dgPolygonSoupDatabase@@MBEXABVFastRayTest@@P6AMPAXQBMHQBHH@ZQAX@Z 10041f80 f corelib_2009:dgAABBPolygonSoup.obj
0001:00040f90 ?CalculateSignature@dgCollisionConvexHull@@EBEHXZ 10041f90 f physics_2009:dgCollisionConvexHull.obj
0001:00040f90 ?CalculateSignature@dgCollisionNull@@EBEHXZ 10041f90 f physics_2009:dgCollisionNull.obj
0001:00040fa0 ?RayCastSimd@dgCollisionNull@@MBEMABVdgVector@@0AAVdgContactPoint@@P6AIPBVdgBody@@PBVdgCollision@@PAX@Z24@Z 10041fa0 f physics_2009:dgCollisionNull.obj
0001:00040fa0 ?RayCast@dgCollisionNull@@MBEMABVdgVector@@0AAVdgContactPoint@@P6AIPBVdgBody@@PBVdgCollision@@PAX@Z24@Z 10041fa0 f physics_2009:dgCollisionNull.obj
0001:00040fb0 ??_GdgCollisionNull@@UAEPAXI@Z 10041fb0 f i physics_2009:dgCollisionNull.obj
0001:00040fb0 ??_EdgCollisionNull@@UAEPAXI@Z 10041fb0 f i physics_2009:dgCollisionNull.obj
0001:00040fe0 ?CalcAABB@dgCollisionNull@@MBEXABVdgMatrix@@AAVdgVector@@1@Z 10041fe0 f physics_2009:dgCollisionNull.obj
0001:00041020 ?SupportVertex@dgCollisionScene@@EBE?AVdgVector@@ABV2@@Z 10042020 f physics_2009:dgCollisionScene.obj
0001:00041020 ?SupportVertex@dgCollisionNull@@MBE?AVdgVector@@ABV2@@Z 10042020 f physics_2009:dgCollisionNull.obj
0001:00041020 ?SupportVertex@dgCollisionPoint@@UBE?AVdgVector@@ABV2@@Z 10042020 f physics_2009:dgCollisionSphere.obj
0001:00041020 ?SupportVertex@dgCollisionMesh@@EBE?AVdgVector@@ABV2@@Z 10042020 f physics_2009:dgCollisionMesh.obj
0001:00041020 ?SupportVertexSimd@dgCollisionPoint@@UBE?AVdgVector@@ABV2@@Z 10042020 f physics_2009:dgCollisionSphere.obj
0001:00041020 ?SupportVertexSimd@dgCollisionNull@@MBE?AVdgVector@@ABV2@@Z 10042020 f physics_2009:dgCollisionNull.obj
0001:00041040 ?JointAccelerationsSimd@dgContact@@EAEXABVdgJointAccelerationDecriptor@@@Z 10042040 f physics_2009:dgContact.obj
0001:00041240 ??0dgCollidingPairCollector@@QAE@XZ 10042240 f physics_2009:dgContact.obj
0001:00041260 ?Init@dgCollidingPairCollector@@QAEXPAVdgWorld@@@Z 10042260 f physics_2009:dgContact.obj
0001:00041290 ?SetCaches@dgCollidingPairCollector@@QAEXQAUdgThreadPairCache@1@@Z 10042290 f physics_2009:dgContact.obj
0001:00041310 ?FlushChache@dgCollidingPairCollector@@QAEXQAUdgThreadPairCache@1@@Z 10042310 f physics_2009:dgContact.obj
0001:000413f0 ?GetInfo@dgContact@@EBEXPAVdgConstraintInfo@@@Z 100423f0 f physics_2009:dgContact.obj
0001:00041440 ?CalculatePointDerivative@dgContact@@ABEXHAAVdgContraintDescritor@@ABVdgVector@@ABVdgPointParam@dgConstraint@@@Z 10042440 f physics_2009:dgContact.obj
0001:00041530 ?JointAccelerations@dgContact@@EAEXABVdgJointAccelerationDecriptor@@@Z 10042530 f physics_2009:dgContact.obj
0001:000417e0 ?AddPair@dgCollidingPairCollector@@QAEXPAVdgBody@@0H@Z 100427e0 f physics_2009:dgContact.obj
0001:00041a90 ?RemoveAll@?$dgList@VdgContactMaterial@@@@QAEXXZ 10042a90 f i physics_2009:dgContact.obj
0001:00041b00 ??0dgContactMaterial@@QAE@XZ 10042b00 f physics_2009:dgContact.obj
0001:00041b50 ?JacobianContactDerivative@dgContact@@AAEXAAVdgContraintDescritor@@ABVdgContactMaterial@@HAAH@Z 10042b50 f physics_2009:dgContact.obj
0001:00041f40 ??0dgContact@@AAE@PAVdgWorld@@@Z 10042f40 f physics_2009:dgContact.obj
0001:00041fe0 ?Remove@?$dgList@PAVdgContact@@@@QAEXPAVdgListNode@1@@Z 10042fe0 f i physics_2009:dgContact.obj
0001:00042030 ?JacobianDerivative@dgContact@@EAEIAAVdgContraintDescritor@@@Z 10043030 f physics_2009:dgContact.obj
0001:00042080 ??_EdgContact@@EAEPAXI@Z 10043080 f i physics_2009:dgContact.obj
0001:00042080 ??_GdgContact@@EAEPAXI@Z 10043080 f i physics_2009:dgContact.obj
0001:000420e0 ??0dgCollisionConvexModifier@@QAE@PAVdgConvexCollision@@PAVdgWorld@@@Z 100430e0 f physics_2009:dgCollisionConvexModifier.obj
0001:00042170 ?ModifierGetMatrix@dgCollisionConvexModifier@@UBE?AVdgMatrix@@XZ 10043170 f physics_2009:dgCollisionConvexModifier.obj
0001:00042190 ?GetBoxMinRadius@dgCollisionConvexModifier@@EBEMXZ 10043190 f physics_2009:dgCollisionConvexModifier.obj
0001:000421a0 ?GetBoxMaxRadius@dgCollisionConvexModifier@@EBEMXZ 100431a0 f physics_2009:dgCollisionConvexModifier.obj
0001:000421b0 ?CalculatePlaneIntersectionSimd@dgCollisionConvexModifier@@EBEHABVdgVector@@0QAV2@@Z 100431b0 f physics_2009:dgCollisionConvexModifier.obj
0001:000421c0 ?DebugCollision@dgCollisionConvexModifier@@MBEXABVdgMatrix@@P6AXPAXHPBMH@Z1@Z 100431c0 f physics_2009:dgCollisionConvexModifier.obj
0001:00042230 ?GetVolume@dgCollisionConvexModifier@@MBEMXZ 10043230 f physics_2009:dgCollisionConvexModifier.obj
0001:00042250 ?GetCollisionInfo@dgCollisionConvexModifier@@EBEXPAVdgCollisionInfo@@@Z 10043250 f physics_2009:dgCollisionConvexModifier.obj
0001:00042290 ?Serialize@dgCollisionConvexModifier@@EBEXP6AXPAXPBXI@Z0@Z 10043290 f physics_2009:dgCollisionConvexModifier.obj
0001:000422d0 ??_GdgCollisionConvexModifier@@UAEPAXI@Z 100432d0 f i physics_2009:dgCollisionConvexModifier.obj
0001:000422d0 ??_EdgCollisionConvexModifier@@UAEPAXI@Z 100432d0 f i physics_2009:dgCollisionConvexModifier.obj
0001:00042320 ?ModifierSetMatrix@dgCollisionConvexModifier@@UAEXABVdgMatrix@@@Z 10043320 f physics_2009:dgCollisionConvexModifier.obj
0001:000425b0 ??0dgCollisionConvexModifier@@QAE@PAVdgWorld@@P6AXPAX1I@Z1@Z 100435b0 f physics_2009:dgCollisionConvexModifier.obj
0001:00042640 ?CalcAABB@dgCollisionConvexModifier@@MBEXABVdgMatrix@@AAVdgVector@@1@Z 10043640 f physics_2009:dgCollisionConvexModifier.obj
0001:00042910 ?CalcAABBSimD@dgCollisionConvexModifier@@MBEXABVdgMatrix@@AAVdgVector@@1@Z 10043910 f physics_2009:dgCollisionConvexModifier.obj
0001:00042bb0 ?SupportVertex@dgCollisionConvexModifier@@MBE?AVdgVector@@ABV2@@Z 10043bb0 f physics_2009:dgCollisionConvexModifier.obj
0001:00042d50 ?SupportVertexSimd@dgCollisionConvexModifier@@MBE?AVdgVector@@ABV2@@Z 10043d50 f physics_2009:dgCollisionConvexModifier.obj
0001:00042e90 ?CalculatePlaneIntersection@dgCollisionConvexModifier@@EBEHABVdgVector@@0QAV2@@Z 10043e90 f physics_2009:dgCollisionConvexModifier.obj
0001:000433b0 ?RayCast@dgCollisionConvexModifier@@MBEMABVdgVector@@0AAVdgContactPoint@@P6AIPBVdgBody@@PBVdgCollision@@PAX@Z24@Z 100443b0 f physics_2009:dgCollisionConvexModifier.obj
0001:00043630 ?RayCastSimd@dgCollisionConvexModifier@@MBEMABVdgVector@@0AAVdgContactPoint@@P6AIPBVdgBody@@PBVdgCollision@@PAX@Z24@Z 10044630 f physics_2009:dgCollisionConvexModifier.obj
0001:00043820 ?CalculateVolumeIntegral@dgCollisionConvexModifier@@MBE?AVdgVector@@ABVdgMatrix@@P6AIPAX10AAVdgPlane@@@Z1@Z 10044820 f physics_2009:dgCollisionConvexModifier.obj
0001:00043ca0 ??1dgCompoundCollision@@UAE@XZ 10044ca0 f physics_2009:dgCompoundCollision.obj
0001:00043cf0 ?GetUserData@dgCollisionMesh@@UBEPAXXZ 10044cf0 f physics_2009:dgCollisionMesh.obj
0001:00043cf0 ?CalculateSignature@dgCompoundCollision@@EBEHXZ 10044cf0 f physics_2009:dgCompoundCollision.obj
0001:00043cf0 ?CalculateSignature@dgCollisionConvexModifier@@EBEHXZ 10044cf0 f physics_2009:dgCollisionConvexModifier.obj
0001:00043cf0 ?CalculateSignature@dgCollisionMesh@@EBEHXZ 10044cf0 f physics_2009:dgCollisionMesh.obj
0001:00043cf0 ?CalculateSignature@dgCollisionScene@@EBEHXZ 10044cf0 f physics_2009:dgCollisionScene.obj
0001:00043cf0 ?GetPerformanceCount@dgWorld@@CAIXZ 10044cf0 f physics_2009:dgWorld.obj
0001:00043cf0 ?GetUserData@dgCollision@@UBEPAXXZ 10044cf0 f physics_2009:dgCollision.obj
0001:00043d00 ?DebugCollision@dgCompoundCollision@@MBEXABVdgMatrix@@P6AXPAXHPBMH@Z1@Z 10044d00 f physics_2009:dgCompoundCollision.obj
0001:00043d40 ?GetVolume@dgCompoundCollision@@MBEMXZ 10044d40 f physics_2009:dgCompoundCollision.obj
0001:00043d80 ?GetBoxMinRadius@dgCompoundCollision@@MBEMXZ 10044d80 f physics_2009:dgCompoundCollision.obj
0001:00043d90 ?GetBoxMaxRadius@dgCompoundCollision@@MBEMXZ 10044d90 f physics_2009:dgCompoundCollision.obj
0001:00043da0 ?GetCollisionInfo@dgCompoundCollision@@EBEXPAVdgCollisionInfo@@@Z 10044da0 f physics_2009:dgCompoundCollision.obj
0001:00043de0 ?Serialize@dgCompoundCollision@@EBEXP6AXPAXPBXI@Z0@Z 10044de0 f physics_2009:dgCompoundCollision.obj
0001:00043e50 ??_GdgCompoundCollision@@UAEPAXI@Z 10044e50 f i physics_2009:dgCompoundCollision.obj
0001:00043e50 ??_EdgCompoundCollision@@UAEPAXI@Z 10044e50 f i physics_2009:dgCompoundCollision.obj
0001:00043e70 ?CalcAABB@dgCompoundCollision@@MBEXABVdgMatrix@@AAVdgVector@@1@Z 10044e70 f physics_2009:dgCompoundCollision.obj
0001:000440b0 ?Init@dgCompoundCollision@@IAEXHQBQAVdgConvexCollision@@PAVdgWorld@@@Z 100450b0 f physics_2009:dgCompoundCollision.obj
0001:00044210 ?CalcAABBSimD@dgCompoundCollision@@MBEXABVdgMatrix@@AAVdgVector@@1@Z 10045210 f physics_2009:dgCompoundCollision.obj
0001:00044510 ?RayCastSimd@dgCompoundCollision@@MBEMABVdgVector@@0AAVdgContactPoint@@P6AIPBVdgBody@@PBVdgCollision@@PAX@Z24@Z 10045510 f physics_2009:dgCompoundCollision.obj
0001:00044790 ?CalculateVolumeIntegral@dgCompoundCollision@@MBE?AVdgVector@@ABVdgMatrix@@P6AIPAX10AAVdgPlane@@@Z1@Z 10045790 f physics_2009:dgCompoundCollision.obj
0001:00044860 ?CalculateInertia@dgCompoundCollision@@MBEXAAVdgVector@@0@Z 10045860 f physics_2009:dgCompoundCollision.obj
0001:00044a00 ?SupportVertex@dgCompoundCollision@@MBE?AVdgVector@@ABV2@@Z 10045a00 f physics_2009:dgCompoundCollision.obj
0001:00044b90 ??0dgCompoundCollision@@QAE@HQBQAVdgConvexCollision@@PAVdgWorld@@@Z 10045b90 f physics_2009:dgCompoundCollision.obj
0001:00044bd0 ??0dgCompoundCollision@@QAE@PAVdgWorld@@P6AXPAX1I@Z1@Z 10045bd0 f physics_2009:dgCompoundCollision.obj
0001:00044c80 ?RayCast@dgCompoundCollision@@MBEMABVdgVector@@0AAVdgContactPoint@@P6AIPBVdgBody@@PBVdgCollision@@PAX@Z24@Z 10045c80 f physics_2009:dgCompoundCollision.obj
0001:00044f30 ??0dgCollisionUserMesh@@QAE@ABVdgVector@@0ABVdgUserMeshCreation@@@Z 10045f30 f physics_2009:dgCollisionUserMesh.obj
0001:00044fa0 ?GetCollisionInfo@dgCollisionUserMesh@@EBEXPAVdgCollisionInfo@@@Z 10045fa0 f physics_2009:dgCollisionUserMesh.obj
0001:00044fe0 ?GetCollidingFaces@dgCollisionUserMesh@@EBEXQAVdgPolygonMeshDesc@@@Z 10045fe0 f physics_2009:dgCollisionUserMesh.obj
0001:00045010 ??_EdgCollisionUserMesh@@UAEPAXI@Z 10046010 f i physics_2009:dgCollisionUserMesh.obj
0001:00045010 ??_GdgCollisionUserMesh@@UAEPAXI@Z 10046010 f i physics_2009:dgCollisionUserMesh.obj
0001:00045050 ?RayCast@dgCollisionUserMesh@@EBEMABVdgVector@@0AAVdgContactPoint@@P6AIPBVdgBody@@PBVdgCollision@@PAX@Z24@Z 10046050 f physics_2009:dgCollisionUserMesh.obj
0001:000451a0 ??1dgCollisionHeightField@@UAE@XZ 100461a0 f physics_2009:dgCollisionHeightField.obj
0001:00045200 ?Serialize@dgCollisionHeightField@@EBEXP6AXPAXPBXI@Z0@Z 10046200 f physics_2009:dgCollisionHeightField.obj
0001:000452b0 ?GetCollisionInfo@dgCollisionHeightField@@EBEXPAVdgCollisionInfo@@@Z 100462b0 f physics_2009:dgCollisionHeightField.obj
0001:00045320 ?GetCollidingFacesSimd@dgCollisionUserMesh@@EBEXQAVdgPolygonMeshDesc@@@Z 10046320 f physics_2009:dgCollisionUserMesh.obj
0001:00045320 ?GetCollidingFacesSimd@dgCollisionHeightField@@EBEXQAVdgPolygonMeshDesc@@@Z 10046320 f physics_2009:dgCollisionHeightField.obj
0001:00045330 ??_GdgCollisionHeightField@@UAEPAXI@Z 10046330 f i physics_2009:dgCollisionHeightField.obj
0001:00045330 ??_EdgCollisionHeightField@@UAEPAXI@Z 10046330 f i physics_2009:dgCollisionHeightField.obj
0001:00045350 ?CalculateMinExtend2d@dgCollisionHeightField@@ABEXABVdgVector@@0AAV2@1@Z 10046350 f physics_2009:dgCollisionHeightField.obj
0001:000455b0 ?CalculateMinExtend3d@dgCollisionHeightField@@ABEXABVdgVector@@0AAV2@1@Z 100465b0 f physics_2009:dgCollisionHeightField.obj
0001:00045760 ??0dgCollisionHeightField@@QAE@PAVdgWorld@@HHHPAGPADMM@Z 10046760 f physics_2009:dgCollisionHeightField.obj
0001:000459e0 ??0dgCollisionHeightField@@QAE@PAVdgWorld@@P6AXPAX1I@Z1@Z 100469e0 f physics_2009:dgCollisionHeightField.obj
0001:00045b80 ?RayCastCellSimd@dgCollisionHeightField@@ABEMABVFastRayTest@@HHAAVdgVector@@@Z 10046b80 f physics_2009:dgCollisionHeightField.obj
0001:00046170 ?RayCastCell@dgCollisionHeightField@@ABEMABVFastRayTest@@HHAAVdgVector@@@Z 10047170 f physics_2009:dgCollisionHeightField.obj
0001:00046760 ?RayCastSimd@dgCollisionHeightField@@EBEMABVdgVector@@0AAVdgContactPoint@@P6AIPBVdgBody@@PBVdgCollision@@PAX@Z24@Z 10047760 f physics_2009:dgCollisionHeightField.obj
0001:00046c20 ?RayCast@dgCollisionHeightField@@EBEMABVdgVector@@0AAVdgContactPoint@@P6AIPBVdgBody@@PBVdgCollision@@PAX@Z24@Z 10047c20 f physics_2009:dgCollisionHeightField.obj
0001:00046fd0 ?GetCollidingFaces@dgCollisionHeightField@@EBEXQAVdgPolygonMeshDesc@@@Z 10047fd0 f physics_2009:dgCollisionHeightField.obj
0001:000489b0 ?DebugCollision@dgCollisionHeightField@@EBEXABVdgMatrix@@P6AXPAXHPBMH@Z1@Z 100499b0 f physics_2009:dgCollisionHeightField.obj
0001:00048f90 ?CalcFacePlaneSimd@dgContactSolver@@AAE_NPAVdgMinkFace@1@@Z 10049f90 f i physics_2009:dgMinkowskiConv.obj
0001:000490a0 ?Push@?$dgDownHeap@PAVdgMinkFace@dgContactSolver@@M@@QAEXAAPAVdgMinkFace@dgContactSolver@@M@Z 1004a0a0 f i physics_2009:dgMinkowskiConv.obj
0001:000490a0 ?Push@?$dgDownHeap@PAVdgEdge@@M@@QAEXAAPAVdgEdge@@M@Z 1004a0a0 f i corelib_2009:dgPolyhedra.obj
0001:000490f0 ?Pop@?$dgUpHeap@HM@@QAEXXZ 1004a0f0 f i physics_2009:dgConvexCollision.obj
0001:000490f0 ?Pop@?$dgUpHeap@PAUdgPerimenterEdge@dgContactSolver@@M@@QAEXXZ 1004a0f0 f i physics_2009:dgMinkowskiConv.obj
0001:00049170 ?Remove@?$dgUpHeap@PAUdgPerimenterEdge@dgContactSolver@@M@@QAEXH@Z 1004a170 f i physics_2009:dgMinkowskiConv.obj
0001:00049200 ??G?$dgTemplateVector@N@@QBE?AV0@ABV0@@Z 1004a200 f i physics_2009:dgMinkowskiConv.obj
0001:00049230 ??D?$dgTemplateVector@N@@QBE?AV0@ABV0@@Z 1004a230 f i physics_2009:dgMinkowskiConv.obj
0001:00049270 ?CheckTetraHedronVolume@dgContactSolver@@ABE_NXZ 1004a270 f i physics_2009:dgMinkowskiConv.obj
0001:00049380 ?CheckTetraHedronVolumeLarge@dgContactSolver@@ABE_NXZ 1004a380 f i physics_2009:dgMinkowskiConv.obj
0001:00049420 ?FilterPolygonEdgeContacts@dgWorld@@ABEHHQAVdgContactPoint@@@Z 1004a420 f physics_2009:dgMinkowskiConv.obj
0001:00049560 ?Scale@?$dgTemplateVector@N@@QBE?AV1@N@Z 1004a560 f i physics_2009:dgMinkowskiConv.obj
0001:00049590 ??H?$dgTemplateVector@N@@QBE?AV0@ABV0@@Z 1004a590 f i physics_2009:dgMinkowskiConv.obj
0001:000495c0 ?CalcSupportVertexSimd@dgContactSolver@@AAEXABVdgVector@@H@Z 1004a5c0 f i physics_2009:dgMinkowskiConv.obj
0001:000496d0 ?CalcSupportVertex@dgContactSolver@@AAEXABVdgVector@@H@Z 1004a6d0 f i physics_2009:dgMinkowskiConv.obj
0001:000498a0 ?CalcSupportVertexLarge@dgContactSolver@@AAEXABVdgVector@@H@Z 1004a8a0 f i physics_2009:dgMinkowskiConv.obj
0001:00049a50 ?CalculateConvexShapeIntersectionLine@dgContactSolver@@ABEHABVdgMatrix@@ABVdgVector@@IMHQAV3@H2QAVdgContactPoint@@@Z 1004aa50 f i physics_2009:dgMinkowskiConv.obj
0001:00049fd0 ?ReduceContacts@dgContactSolver@@ABEPAUdgPerimenterEdge@1@PAU21@H@Z 1004afd0 f i physics_2009:dgMinkowskiConv.obj
0001:0004a1a0 ?CalculateConvexShapeIntersectionSimd@dgContactSolver@@ABEHABVdgMatrix@@ABVdgVector@@IMHQAV3@H2QAVdgContactPoint@@H@Z 1004b1a0 f i physics_2009:dgMinkowskiConv.obj
0001:0004a6d0 ?CalculateConvexShapeIntersection@dgContactSolver@@ABEHABVdgMatrix@@ABVdgVector@@IMHQAV3@H2QAVdgContactPoint@@H@Z 1004b6d0 f i physics_2009:dgMinkowskiConv.obj
0001:0004aee0 ?ReduceLine@dgContactSolver@@AAE?AVdgVector@@ABV2@@Z 1004bee0 f i physics_2009:dgMinkowskiConv.obj
0001:0004b0d0 ?ReduceLineLarge@dgContactSolver@@AAE?AVdgBigVector@@ABV2@@Z 1004c0d0 f i physics_2009:dgMinkowskiConv.obj
0001:0004b240 ?ReduceTriangle@dgContactSolver@@AAE?AVdgVector@@ABV2@@Z 1004c240 f i physics_2009:dgMinkowskiConv.obj
0001:0004b910 ?ReduceTriangleLarge@dgContactSolver@@AAE?AVdgBigVector@@ABV2@@Z 1004c910 f i physics_2009:dgMinkowskiConv.obj
0001:0004be30 ?ReduceTetrahedrum@dgContactSolver@@AAE?AVdgVector@@ABV2@@Z 1004ce30 f i physics_2009:dgMinkowskiConv.obj
0001:0004c270 ?ReduceTetrahedrumLarge@dgContactSolver@@AAE?AVdgBigVector@@ABV2@@Z 1004d270 f i physics_2009:dgMinkowskiConv.obj
0001:0004c530 ?UpdateSeparatingPlaneFallbackSolution@dgContactSolver@@AAE?AW4dgMinkReturnCode@1@AAPAVdgMinkFace@1@ABVdgVector@@@Z 1004d530 f i physics_2009:dgMinkowskiConv.obj
0001:0004e0f0 ?UpdateSeparatingPlaneFallbackSolutionLarge@dgContactSolver@@AAE?AW4dgMinkReturnCode@1@AAPAVdgMinkFace@1@ABVdgBigVector@@@Z 1004f0f0 f i physics_2009:dgMinkowskiConv.obj
0001:0004f5d0 ?UpdateSeparatingPlaneSimd@dgContactSolver@@AAE?AW4dgMinkReturnCode@1@AAPAVdgMinkFace@1@ABVdgVector@@@Z 100505d0 f i physics_2009:dgMinkowskiConv.obj
0001:0004ffd0 ?UpdateSeparatingPlane@dgContactSolver@@AAE?AW4dgMinkReturnCode@1@AAPAVdgMinkFace@1@ABVdgVector@@@Z 10050fd0 f i physics_2009:dgMinkowskiConv.obj
0001:00050960 ?UpdateSeparatingPlaneLarge@dgContactSolver@@AAE?AW4dgMinkReturnCode@1@AAPAVdgMinkFace@1@ABVdgBigVector@@@Z 10051960 f i physics_2009:dgMinkowskiConv.obj
0001:00050f60 ?CalcSeparatingPlaneSimd@dgContactSolver@@AAE?AW4dgMinkReturnCode@1@AAPAVdgMinkFace@1@ABVdgVector@@@Z 10051f60 f i physics_2009:dgMinkowskiConv.obj
0001:00051690 ?CalcSeparatingPlane@dgContactSolver@@AAE?AW4dgMinkReturnCode@1@AAPAVdgMinkFace@1@ABVdgVector@@@Z 10052690 f i physics_2009:dgMinkowskiConv.obj
0001:00051dc0 ?CalcSeparatingPlaneLarge@dgContactSolver@@AAE?AW4dgMinkReturnCode@1@AAPAVdgMinkFace@1@ABVdgBigVector@@@Z 10052dc0 f i physics_2009:dgMinkowskiConv.obj
0001:00052340 ?CalcFacePlane@dgContactSolver@@AAE_NQAVdgMinkFace@1@@Z 10053340 f i physics_2009:dgMinkowskiConv.obj
0001:00052500 ?CalcFacePlaneLarge@dgContactSolver@@AAE_NQAVdgMinkFace@1@@Z 10053500 f i physics_2009:dgMinkowskiConv.obj
0001:00052630 ?CalculateVelocities@dgContactSolver@@QAEXM@Z 10053630 f i physics_2009:dgMinkowskiConv.obj
0001:00052730 ?CalculateVelocitiesSimD@dgContactSolver@@QAEXM@Z 10053730 f i physics_2009:dgMinkowskiConv.obj
0001:00052830 ?InitConvexCollision@dgWorld@@CAXXZ 10053830 f physics_2009:dgMinkowskiConv.obj
0001:00053190 ?SphereSphereCollision@dgWorld@@ABEHABVdgVector@@M0MAAVdgCollisionParamProxi@@@Z 10054190 f physics_2009:dgMinkowskiConv.obj
0001:00053440 ?CalculateSphereToSphereContacts@dgWorld@@ABEHAAVdgCollisionParamProxi@@@Z 10054440 f physics_2009:dgMinkowskiConv.obj
0001:00053480 ?CalculateCapsuleToSphereContacts@dgWorld@@ABEHAAVdgCollisionParamProxi@@@Z 10054480 f physics_2009:dgMinkowskiConv.obj
0001:000535d0 ?CalculateCapsuleToCapsuleContacts@dgWorld@@ABEHAAVdgCollisionParamProxi@@@Z 100545d0 f physics_2009:dgMinkowskiConv.obj
0001:000543b0 ?CalculatePolySoupToSphereContactsDescrete@dgWorld@@ABEHAAVdgCollisionParamProxi@@@Z 100553b0 f physics_2009:dgMinkowskiConv.obj
0001:00054a50 ?CalculateClosestPoints@dgContactSolver@@AAEHXZ 10055a50 f i physics_2009:dgMinkowskiConv.obj
0001:00055a10 ?CalculateContactAlternateMethod@dgContactSolver@@AAEHQAVdgMinkFace@1@HQAVdgContactPoint@@H@Z 10056a10 f i physics_2009:dgMinkowskiConv.obj
0001:00056e50 ?CalculateContactsSimd@dgContactSolver@@AAEHQAVdgMinkFace@1@HQAVdgContactPoint@@H@Z 10057e50 f i physics_2009:dgMinkowskiConv.obj
0001:00058020 ?CalculateContacts@dgContactSolver@@AAEHQAVdgMinkFace@1@HQAVdgContactPoint@@H@Z 10059020 f i physics_2009:dgMinkowskiConv.obj
0001:00059600 ?CalculateContactsContinuesSimd@dgContactSolver@@AAEHHQAVdgContactPoint@@HPBVdgVector@@1M@Z 1005a600 f i physics_2009:dgMinkowskiConv.obj
0001:000597d0 ?CalculateContactsContinues@dgContactSolver@@AAEHHQAVdgContactPoint@@HPBVdgVector@@1M@Z 1005a7d0 f i physics_2009:dgMinkowskiConv.obj
0001:00059af0 ?CalculateClipPlaneSimd@dgContactSolver@@AAEPAVdgMinkFace@1@XZ 1005aaf0 f i physics_2009:dgMinkowskiConv.obj
0001:0005a760 ?CalculateClipPlane@dgContactSolver@@AAEPAVdgMinkFace@1@XZ 1005b760 f i physics_2009:dgMinkowskiConv.obj
0001:0005b3d0 ?CalculateClipPlaneLarge@dgContactSolver@@AAEPAVdgMinkFace@1@XZ 1005c3d0 f i physics_2009:dgMinkowskiConv.obj
0001:0005bec0 ??0dgContactSolver@@QAE@AAVdgCollisionParamProxi@@PAVdgCollision@@@Z 1005cec0 f i physics_2009:dgMinkowskiConv.obj
0001:0005bf40 ??0dgContactSolver@@QAE@AAVdgCollisionParamProxi@@@Z 1005cf40 f i physics_2009:dgMinkowskiConv.obj
0001:0005bfb0 ?HullHullContactsSimd@dgContactSolver@@QAEHH@Z 1005cfb0 f i physics_2009:dgMinkowskiConv.obj
0001:0005c240 ?HullHullContacts@dgContactSolver@@QAEHH@Z 1005d240 f i physics_2009:dgMinkowskiConv.obj
0001:0005c5b0 ?HullHullContactsLarge@dgContactSolver@@QAEHH@Z 1005d5b0 f i physics_2009:dgMinkowskiConv.obj
0001:0005c9a0 ?HullHullContinueContactsSimd@dgContactSolver@@QAEHAAMQAVdgContactPoint@@HHH@Z 1005d9a0 f i physics_2009:dgMinkowskiConv.obj
0001:0005d340 ?HullHullContinueContacts@dgContactSolver@@QAEHAAMQAVdgContactPoint@@HHH@Z 1005e340 f i physics_2009:dgMinkowskiConv.obj
0001:0005dd90 ?ClosestPoint@dgWorld@@ABEHAAVdgCollisionParamProxi@@@Z 1005ed90 f physics_2009:dgMinkowskiConv.obj
0001:0005df50 ?CalculateHullToHullContactsSimd@dgWorld@@ABEHAAVdgCollisionParamProxi@@@Z 1005ef50 f physics_2009:dgMinkowskiConv.obj
0001:0005e1f0 ?CalculateHullToHullContacts@dgWorld@@ABEHAAVdgCollisionParamProxi@@@Z 1005f1f0 f physics_2009:dgMinkowskiConv.obj
0001:0005e420 ?CalculatePolySoupToSphereContactsContinue@dgWorld@@ABEHAAVdgCollisionParamProxi@@@Z 1005f420 f physics_2009:dgMinkowskiConv.obj
0001:0005e9b0 ?CalculatePolySoupToHullContactsDescreteSimd@dgWorld@@ABEHAAVdgCollisionParamProxi@@@Z 1005f9b0 f physics_2009:dgMinkowskiConv.obj
0001:0005ec00 ?CalculatePolySoupToHullContactsDescrete@dgWorld@@ABEHAAVdgCollisionParamProxi@@@Z 1005fc00 f physics_2009:dgMinkowskiConv.obj
0001:0005ee50 ?CalculateConvexToNonConvexContactsContinueSimd@dgWorld@@ABEHAAVdgCollisionParamProxi@@@Z 1005fe50 f physics_2009:dgMinkowskiConv.obj
0001:0005f1e0 ?CalculateConvexToNonConvexContactsContinue@dgWorld@@ABEHAAVdgCollisionParamProxi@@@Z 100601e0 f physics_2009:dgMinkowskiConv.obj
0001:0005f570 ?CalculateConvexToNonConvexContactsSimd@dgWorld@@ABEHAAVdgCollisionParamProxi@@@Z 10060570 f physics_2009:dgMinkowskiConv.obj
0001:0005fef0 ?CalculateConvexToNonConvexContacts@dgWorld@@ABEHAAVdgCollisionParamProxi@@@Z 10060ef0 f physics_2009:dgMinkowskiConv.obj
0001:000608c0 ?CalculateBoxToSphereContacts@dgWorld@@ABEHAAVdgCollisionParamProxi@@@Z 100618c0 f physics_2009:dgMinkowskiConv.obj
0001:00062020 ?CalculateConvexToConvexContactsSimd@dgWorld@@ABEHAAVdgCollisionParamProxi@@@Z 10063020 f physics_2009:dgMinkowskiConv.obj
0001:00062730 ?CalculateConvexToConvexContacts@dgWorld@@ABEHAAVdgCollisionParamProxi@@@Z 10063730 f physics_2009:dgMinkowskiConv.obj
0001:00062dd0 ?CalculateSignature@dgCollisionBox@@MBEHXZ 10063dd0 f physics_2009:dgCollisionBox.obj
0001:00062e60 ?GetCollisionInfo@dgCollisionBox@@MBEXPAVdgCollisionInfo@@@Z 10063e60 f physics_2009:dgCollisionBox.obj
0001:00062eb0 ??_GdgCollisionBox@@UAEPAXI@Z 10063eb0 f i physics_2009:dgCollisionBox.obj
0001:00062eb0 ??_EdgCollisionBox@@UAEPAXI@Z 10063eb0 f i physics_2009:dgCollisionBox.obj
0001:00062ef0 ?CalcAABB@dgCollisionBox@@MBEXABVdgMatrix@@AAVdgVector@@1@Z 10063ef0 f physics_2009:dgCollisionBox.obj
0001:00063040 ?CalcAABBSimD@dgCollisionBox@@MBEXABVdgMatrix@@AAVdgVector@@1@Z 10064040 f physics_2009:dgCollisionBox.obj
0001:000630c0 ?CalculatePlaneIntersection@dgCollisionBox@@MBEHABVdgVector@@0QAV2@@Z 100640c0 f physics_2009:dgCollisionBox.obj
0001:00063450 ?CalculatePlaneIntersectionSimd@dgCollisionBox@@MBEHABVdgVector@@0QAV2@@Z 10064450 f physics_2009:dgCollisionBox.obj
0001:000637b0 ?Serialize@dgCollisionBox@@MBEXP6AXPAXPBXI@Z0@Z 100647b0 f physics_2009:dgCollisionBox.obj
0001:00063840 ?Init@dgCollisionBox@@IAEXMMM@Z 10064840 f physics_2009:dgCollisionBox.obj
0001:00063d20 ?SupportVertexSimd@dgCollisionBox@@MBE?AVdgVector@@ABV2@@Z 10064d20 f physics_2009:dgCollisionBox.obj
0001:00063d20 ?SupportVertex@dgCollisionBox@@MBE?AVdgVector@@ABV2@@Z 10064d20 f physics_2009:dgCollisionBox.obj
0001:00063d80 ?RayCast@dgCollisionBox@@MBEMABVdgVector@@0AAVdgContactPoint@@P6AIPBVdgBody@@PBVdgCollision@@PAX@Z24@Z 10064d80 f physics_2009:dgCollisionBox.obj
0001:00063f60 ?CalculateMassProperties@dgCollisionBox@@MBEMAAVdgVector@@00@Z 10064f60 f physics_2009:dgCollisionBox.obj
0001:000642b0 ??0dgCollisionBox@@QAE@IMMMABVdgMatrix@@@Z 100652b0 f physics_2009:dgCollisionBox.obj
0001:00064300 ??0dgCollisionBox@@QAE@PAVdgWorld@@P6AXPAX1I@Z1@Z 10065300 f physics_2009:dgCollisionBox.obj
0001:00064360 ??1dgCollision@@MAE@XZ 10065360 f physics_2009:dgCollision.obj
0001:00064370 ?Quantize@dgCollision@@SAIM@Z 10065370 f physics_2009:dgCollision.obj
0001:000643a0 ?MakeCRC@dgCollision@@SAIPAXH@Z 100653a0 f physics_2009:dgCollision.obj
0001:000643c0 ?GetCollisionInfo@dgCollision@@UBEXPAVdgCollisionInfo@@@Z 100653c0 f physics_2009:dgCollision.obj
0001:00064400 ?SerializeLow@dgCollision@@UBEXP6AXPAXPBXI@Z0@Z 10065400 f physics_2009:dgCollision.obj
0001:00064450 ??_EdgCollision@@MAEPAXI@Z 10065450 f i physics_2009:dgCollision.obj
0001:00064450 ??_GdgCollision@@MAEPAXI@Z 10065450 f i physics_2009:dgCollision.obj
0001:00064470 ??0dgCollision@@IAE@IABVdgMatrix@@W4dgCollisionID@@@Z 10065470 f physics_2009:dgCollision.obj
0001:000644c0 ??0dgCollision@@IAE@PAVdgWorld@@P6AXPAX1I@Z1@Z 100654c0 f physics_2009:dgCollision.obj
0001:00064520 ?CalculateSignature@dgCollisionEllipse@@EBEHXZ 10065520 f physics_2009:dgCollisionEllipse.obj
0001:000645b0 ?CalculateMassProperties@dgCollisionEllipse@@EBEMAAVdgVector@@00@Z 100655b0 f physics_2009:dgCollisionEllipse.obj
0001:000645c0 ?GetCollisionInfo@dgCollisionEllipse@@EBEXPAVdgCollisionInfo@@@Z 100655c0 f physics_2009:dgCollisionEllipse.obj
0001:00064610 ?Serialize@dgCollisionEllipse@@EBEXP6AXPAXPBXI@Z0@Z 10065610 f physics_2009:dgCollisionEllipse.obj
0001:00064640 ??_EdgCollisionEllipse@@UAEPAXI@Z 10065640 f i physics_2009:dgCollisionEllipse.obj
0001:00064640 ??_GdgCollisionEllipse@@UAEPAXI@Z 10065640 f i physics_2009:dgCollisionEllipse.obj
0001:00064670 ?CalcAABB@dgCollisionEllipse@@MBEXABVdgMatrix@@AAVdgVector@@1@Z 10065670 f physics_2009:dgCollisionEllipse.obj
0001:000647b0 ??0dgCollisionEllipse@@QAE@IMMMABVdgMatrix@@@Z 100657b0 f physics_2009:dgCollisionEllipse.obj
0001:00064840 ??0dgCollisionEllipse@@QAE@PAVdgWorld@@P6AXPAX1I@Z1@Z 10065840 f physics_2009:dgCollisionEllipse.obj
0001:000648c0 ?SupportVertex@dgCollisionEllipse@@MBE?AVdgVector@@ABV2@@Z 100658c0 f physics_2009:dgCollisionEllipse.obj
0001:000649d0 ?SupportVertexSimd@dgCollisionEllipse@@MBE?AVdgVector@@ABV2@@Z 100659d0 f physics_2009:dgCollisionEllipse.obj
0001:00064a90 ?CalculatePlaneIntersection@dgCollisionEllipse@@EBEHABVdgVector@@0QAV2@@Z 10065a90 f physics_2009:dgCollisionEllipse.obj
0001:00064a90 ?CalculatePlaneIntersectionSimd@dgCollisionEllipse@@EBEHABVdgVector@@0QAV2@@Z 10065a90 f physics_2009:dgCollisionEllipse.obj
0001:00064b90 ?DebugCollision@dgCollisionEllipse@@MBEXABVdgMatrix@@P6AXPAXHPBMH@Z1@Z 10065b90 f physics_2009:dgCollisionEllipse.obj
0001:00064e70 ?RayCast@dgCollisionEllipse@@MBEMABVdgVector@@0AAVdgContactPoint@@P6AIPBVdgBody@@PBVdgCollision@@PAX@Z24@Z 10065e70 f physics_2009:dgCollisionEllipse.obj
0001:00064f20 ?RayCastSimd@dgCollisionEllipse@@MBEMABVdgVector@@0AAVdgContactPoint@@P6AIPBVdgBody@@PBVdgCollision@@PAX@Z24@Z 10065f20 f physics_2009:dgCollisionEllipse.obj
0001:00064fd0 ?CalculateSignature@dgCollisionCapsule@@EBEHXZ 10065fd0 f physics_2009:dgCollisionCapsule.obj
0001:00065050 ?GetCollisionInfo@dgCollisionCapsule@@EBEXPAVdgCollisionInfo@@@Z 10066050 f physics_2009:dgCollisionCapsule.obj
0001:000650a0 ??_GdgCollisionCapsule@@UAEPAXI@Z 100660a0 f i physics_2009:dgCollisionCapsule.obj
0001:000650a0 ??_EdgCollisionCapsule@@UAEPAXI@Z 100660a0 f i physics_2009:dgCollisionCapsule.obj
0001:000650e0 ?SupportVertexSimd@dgCollisionCapsule@@EBE?AVdgVector@@ABV2@@Z 100660e0 f physics_2009:dgCollisionCapsule.obj
0001:000650e0 ?SupportVertex@dgCollisionCapsule@@EBE?AVdgVector@@ABV2@@Z 100660e0 f physics_2009:dgCollisionCapsule.obj
0001:00065160 ?Init@dgCollisionCapsule@@AAEXMM@Z 10066160 f physics_2009:dgCollisionCapsule.obj
0001:000656a0 ?TesselateTriangle@dgCollisionCapsule@@ABEXHMABVdgVector@@00AAHPAV2@@Z 100666a0 f physics_2009:dgCollisionCapsule.obj
0001:00065af0 ?DebugCollision@dgCollisionCapsule@@EBEXABVdgMatrix@@P6AXPAXHPBMH@Z1@Z 10066af0 f physics_2009:dgCollisionCapsule.obj
0001:00065f20 ?RayCast@dgCollisionCapsule@@EBEMABVdgVector@@0AAVdgContactPoint@@P6AIPBVdgBody@@PBVdgCollision@@PAX@Z24@Z 10066f20 f physics_2009:dgCollisionCapsule.obj
0001:00066b10 ?CalculateMassProperties@dgCollisionCapsule@@EBEMAAVdgVector@@00@Z 10067b10 f physics_2009:dgCollisionCapsule.obj
0001:00066ee0 ?CalculatePlaneIntersection@dgCollisionCapsule@@EBEHABVdgVector@@0QAV2@@Z 10067ee0 f physics_2009:dgCollisionCapsule.obj
0001:00067930 ?Serialize@dgCollisionCapsule@@EBEXP6AXPAXPBXI@Z0@Z 10068930 f physics_2009:dgCollisionCapsule.obj
0001:00067990 ??0dgCollisionCapsule@@QAE@IMMABVdgMatrix@@@Z 10068990 f physics_2009:dgCollisionCapsule.obj
0001:000679d0 ??0dgCollisionCapsule@@QAE@PAVdgWorld@@P6AXPAX1I@Z1@Z 100689d0 f physics_2009:dgCollisionCapsule.obj
0001:00067a30 ?CalculatePlaneIntersectionSimd@dgCollisionCapsule@@EBEHABVdgVector@@0QAV2@@Z 10068a30 f physics_2009:dgCollisionCapsule.obj
0001:00067a40 ?CalculateSignature@dgCollisionCone@@EBEHXZ 10068a40 f physics_2009:dgCollisionCone.obj
0001:00067ac0 ?DebugCollision@dgCollisionCone@@EBEXABVdgMatrix@@P6AXPAXHPBMH@Z1@Z 10068ac0 f physics_2009:dgCollisionCone.obj
0001:00067c80 ?SupportVertexSimd@dgCollisionCone@@EBE?AVdgVector@@ABV2@@Z 10068c80 f physics_2009:dgCollisionCone.obj
0001:00067c80 ?SupportVertexSimd@dgCollisionChamferCylinder@@MBE?AVdgVector@@ABV2@@Z 10068c80 f physics_2009:dgCollisionChamferCylinder.obj
0001:00067c80 ?SupportVertexSimd@dgCollisionCylinder@@EBE?AVdgVector@@ABV2@@Z 10068c80 f physics_2009:dgCollisionCylinder.obj
0001:00067ca0 ?GetCollisionInfo@dgCollisionCone@@EBEXPAVdgCollisionInfo@@@Z 10068ca0 f physics_2009:dgCollisionCone.obj
0001:00067ce0 ??_GdgCollisionCone@@UAEPAXI@Z 10068ce0 f i physics_2009:dgCollisionCone.obj
0001:00067ce0 ??_EdgCollisionCone@@UAEPAXI@Z 10068ce0 f i physics_2009:dgCollisionCone.obj
0001:00067d20 ?Init@dgCollisionCone@@AAEXMM@Z 10068d20 f physics_2009:dgCollisionCone.obj
0001:00067ff0 ?SupportVertex@dgCollisionCone@@EBE?AVdgVector@@ABV2@@Z 10068ff0 f physics_2009:dgCollisionCone.obj
0001:000680d0 ?CalculateMassProperties@dgCollisionCone@@EBEMAAVdgVector@@00@Z 100690d0 f physics_2009:dgCollisionCone.obj
0001:00068470 ?CalculatePlaneIntersectionSimd@dgCollisionCone@@EBEHABVdgVector@@0QAV2@@Z 10069470 f physics_2009:dgCollisionCone.obj
0001:00068470 ?CalculatePlaneIntersectionSimd@dgCollisionCylinder@@EBEHABVdgVector@@0QAV2@@Z 10069470 f physics_2009:dgCollisionCylinder.obj
0001:000686e0 ?Serialize@dgCollisionCone@@EBEXP6AXPAXPBXI@Z0@Z 100696e0 f physics_2009:dgCollisionCone.obj
0001:00068730 ??0dgCollisionCone@@QAE@IMMABVdgMatrix@@@Z 10069730 f physics_2009:dgCollisionCone.obj
0001:00068770 ??0dgCollisionCone@@QAE@PAVdgWorld@@P6AXPAX1I@Z1@Z 10069770 f physics_2009:dgCollisionCone.obj
0001:000687d0 ?CalculateSignature@dgCollisionCylinder@@EBEHXZ 100697d0 f physics_2009:dgCollisionCylinder.obj
0001:00068850 ?DebugCollision@dgCollisionCylinder@@EBEXABVdgMatrix@@P6AXPAXHPBMH@Z1@Z 10069850 f physics_2009:dgCollisionCylinder.obj
0001:00068a40 ?RayCastSimd@dgCollisionCapsule@@EBEMABVdgVector@@0AAVdgContactPoint@@P6AIPBVdgBody@@PBVdgCollision@@PAX@Z24@Z 10069a40 f physics_2009:dgCollisionCapsule.obj
0001:00068a40 ?RayCastSimd@dgCollisionBox@@MBEMABVdgVector@@0AAVdgContactPoint@@P6AIPBVdgBody@@PBVdgCollision@@PAX@Z24@Z 10069a40 f physics_2009:dgCollisionBox.obj
0001:00068a40 ?RayCastSimd@dgCollisionCylinder@@EBEMABVdgVector@@0AAVdgContactPoint@@P6AIPBVdgBody@@PBVdgCollision@@PAX@Z24@Z 10069a40 f physics_2009:dgCollisionCylinder.obj
0001:00068a40 ?RayCastSimd@dgCollisionSphere@@MBEMABVdgVector@@0AAVdgContactPoint@@P6AIPBVdgBody@@PBVdgCollision@@PAX@Z24@Z 10069a40 f physics_2009:dgCollisionSphere.obj
0001:00068a40 ?RayCastSimd@dgCollisionUserMesh@@EBEMABVdgVector@@0AAVdgContactPoint@@P6AIPBVdgBody@@PBVdgCollision@@PAX@Z24@Z 10069a40 f physics_2009:dgCollisionUserMesh.obj
0001:00068a40 ?RayCastSimd@dgConvexCollision@@UBEMABVdgVector@@0AAVdgContactPoint@@P6AIPBVdgBody@@PBVdgCollision@@PAX@Z24@Z 10069a40 f physics_2009:dgConvexCollision.obj
0001:00068a50 ?GetCollisionInfo@dgCollisionCylinder@@EBEXPAVdgCollisionInfo@@@Z 10069a50 f physics_2009:dgCollisionCylinder.obj
0001:00068aa0 ??_GdgCollisionCylinder@@UAEPAXI@Z 10069aa0 f i physics_2009:dgCollisionCylinder.obj
0001:00068aa0 ??_EdgCollisionCylinder@@UAEPAXI@Z 10069aa0 f i physics_2009:dgCollisionCylinder.obj
0001:00068ae0 ?Init@dgCollisionCylinder@@AAEXMM@Z 10069ae0 f physics_2009:dgCollisionCylinder.obj
0001:00068da0 ?SupportVertex@dgCollisionCylinder@@EBE?AVdgVector@@ABV2@@Z 10069da0 f physics_2009:dgCollisionCylinder.obj
0001:00068e50 ?CalculateMassProperties@dgCollisionCylinder@@EBEMAAVdgVector@@00@Z 10069e50 f physics_2009:dgCollisionCylinder.obj
0001:000691c0 ?CalculatePlaneIntersection@dgCollisionCylinder@@EBEHABVdgVector@@0QAV2@@Z 1006a1c0 f physics_2009:dgCollisionCylinder.obj
0001:000691c0 ?CalculatePlaneIntersection@dgCollisionCone@@EBEHABVdgVector@@0QAV2@@Z 1006a1c0 f physics_2009:dgCollisionCone.obj
0001:00069410 ?RayCast@dgCollisionCylinder@@EBEMABVdgVector@@0AAVdgContactPoint@@P6AIPBVdgBody@@PBVdgCollision@@PAX@Z24@Z 1006a410 f physics_2009:dgCollisionCylinder.obj
0001:00069a20 ?Serialize@dgCollisionCylinder@@EBEXP6AXPAXPBXI@Z0@Z 1006aa20 f physics_2009:dgCollisionCylinder.obj
0001:00069a90 ??0dgCollisionCylinder@@QAE@IMMABVdgMatrix@@@Z 1006aa90 f physics_2009:dgCollisionCylinder.obj
0001:00069ad0 ??0dgCollisionCylinder@@QAE@PAVdgWorld@@P6AXPAX1I@Z1@Z 1006aad0 f physics_2009:dgCollisionCylinder.obj
0001:00069b30 ?CalculateSignature@dgCollisionChamferCylinder@@MBEHXZ 1006ab30 f physics_2009:dgCollisionChamferCylinder.obj
0001:00069bb0 ?GetCollisionInfo@dgCollisionChamferCylinder@@MBEXPAVdgCollisionInfo@@@Z 1006abb0 f physics_2009:dgCollisionChamferCylinder.obj
0001:00069c00 ??_EdgCollisionChamferCylinder@@UAEPAXI@Z 1006ac00 f i physics_2009:dgCollisionChamferCylinder.obj
0001:00069c00 ??_GdgCollisionChamferCylinder@@UAEPAXI@Z 1006ac00 f i physics_2009:dgCollisionChamferCylinder.obj
0001:00069c40 ?Init@dgCollisionChamferCylinder@@IAEXMM@Z 1006ac40 f physics_2009:dgCollisionChamferCylinder.obj
0001:0006a1b0 ?DebugCollision@dgCollisionChamferCylinder@@MBEXABVdgMatrix@@P6AXPAXHPBMH@Z1@Z 1006b1b0 f physics_2009:dgCollisionChamferCylinder.obj
0001:0006a7f0 ?SupportVertex@dgCollisionChamferCylinder@@MBE?AVdgVector@@ABV2@@Z 1006b7f0 f physics_2009:dgCollisionChamferCylinder.obj
0001:0006a950 ?RayCast@dgCollisionChamferCylinder@@MBEMABVdgVector@@0AAVdgContactPoint@@P6AIPBVdgBody@@PBVdgCollision@@PAX@Z24@Z 1006b950 f physics_2009:dgCollisionChamferCylinder.obj
0001:0006ab60 ?RayCastSimd@dgCollisionChamferCylinder@@MBEMABVdgVector@@0AAVdgContactPoint@@P6AIPBVdgBody@@PBVdgCollision@@PAX@Z24@Z 1006bb60 f physics_2009:dgCollisionChamferCylinder.obj
0001:0006ad70 ?CalculatePlaneIntersection@dgCollisionChamferCylinder@@MBEHABVdgVector@@0QAV2@@Z 1006bd70 f physics_2009:dgCollisionChamferCylinder.obj
0001:0006b760 ?Serialize@dgCollisionChamferCylinder@@MBEXP6AXPAXPBXI@Z0@Z 1006c760 f physics_2009:dgCollisionChamferCylinder.obj
0001:0006b7c0 ??0dgCollisionChamferCylinder@@QAE@IMMABVdgMatrix@@@Z 1006c7c0 f physics_2009:dgCollisionChamferCylinder.obj
0001:0006b800 ??0dgCollisionChamferCylinder@@QAE@PAVdgWorld@@P6AXPAX1I@Z1@Z 1006c800 f physics_2009:dgCollisionChamferCylinder.obj
0001:0006b860 ?CalculatePlaneIntersectionSimd@dgCollisionChamferCylinder@@MBEHABVdgVector@@0QAV2@@Z 1006c860 f physics_2009:dgCollisionChamferCylinder.obj
0001:0006b870 ?Malloc@dgMemoryAllocator@@QAEPAXH@Z 1006c870 f i corelib_2009:dgMemory.obj
0001:0006b9b0 ?Free@dgMemoryAllocator@@QAEXPAX@Z 1006c9b0 f i corelib_2009:dgMemory.obj
0001:0006bab0 ?__malloc__@dgMemoryAllocator@@CAPAXI@Z 1006cab0 f i corelib_2009:dgMemory.obj
0001:0006bab0 ?DefaultAllocMemory@Newton@@SAPAXH@Z 1006cab0 f i NewtonClass.obj
0001:0006bac0 ?DefaultFreeMemory@Newton@@SAXPAXH@Z 1006cac0 f i NewtonClass.obj
0001:0006bac0 ?__free__@dgMemoryAllocator@@CAXPAXI@Z 1006cac0 f i corelib_2009:dgMemory.obj
0001:0006bad0 ?dgSetMemoryDrivers@@YAXP6APAXI@ZP6AXPAXI@Z@Z 1006cad0 f corelib_2009:dgMemory.obj
0001:0006baf0 ?dgGetMemoryUsed@@YAHXZ 1006caf0 f corelib_2009:dgMemory.obj
0001:0006bb00 ?dgMallocStack@@YAPAXI@Z 1006cb00 f corelib_2009:dgMemory.obj
0001:0006bb30 ?dgFreeStack@@YAXPAX@Z 1006cb30 f corelib_2009:dgMemory.obj
0001:0006bb50 ?dgMalloc@@YAPAXI@Z 1006cb50 f corelib_2009:dgMemory.obj
0001:0006bb70 ?dgFree@@YAXPAX@Z 1006cb70 f corelib_2009:dgMemory.obj
0001:0006bb90 ?dgCRC@@YAIPBXHI@Z 1006cb90 f corelib_2009:dgCRC.obj
0001:0006bbd0 ?TransformTriplex@dgMatrix@@QBEXQAXHQBXHH@Z 1006cbd0 f corelib_2009:dgMatrix.obj
0001:0006bec0 ?dgGetIdentityMatrix@@YAABVdgMatrix@@XZ 1006cec0 f corelib_2009:dgMatrix.obj
0001:0006bfd0 ??0dgMatrix@@QAE@ABVdgQuaternion@@ABVdgVector@@@Z 1006cfd0 f corelib_2009:dgMatrix.obj
0001:0006c150 ??DdgMatrix@@QBE?AV0@ABV0@@Z 1006d150 f corelib_2009:dgMatrix.obj
0001:0006c3f0 ?Symetric3by3Inverse@dgMatrix@@QBE?AV1@XZ 1006d3f0 f corelib_2009:dgMatrix.obj
0001:0006c570 ?CalcPitchYawRoll@dgMatrix@@QBE?AVdgVector@@XZ 1006d570 f corelib_2009:dgMatrix.obj
0001:0006c670 ?dgAbsf@@YAMM@Z 1006d670 f corelib_2009:dgTypes.obj
0001:0006c680 ?dgSqrt@@YAMM@Z 1006d680 f corelib_2009:dgTypes.obj
0001:0006c690 ?dgSin@@YAMM@Z 1006d690 f corelib_2009:dgTypes.obj
0001:0006c6a0 ?dgCos@@YAMM@Z 1006d6a0 f corelib_2009:dgTypes.obj
0001:0006c6b0 ?dgAsin@@YAMM@Z 1006d6b0 f corelib_2009:dgTypes.obj
0001:0006c6d0 ?dgAcos@@YAMM@Z 1006d6d0 f corelib_2009:dgTypes.obj
0001:0006c6f0 ?dgAtan2@@YAMMM@Z 1006d6f0 f corelib_2009:dgTypes.obj
0001:0006c710 ?dgFloor@@YAMM@Z 1006d710 f corelib_2009:dgTypes.obj
0001:0006c750 ?dgFastInt@@YAHM@Z 1006d750 f corelib_2009:dgTypes.obj
0001:0006c810 ?dgGetCpuType@@YA?AW4dgCpuClass@@XZ 1006d810 f corelib_2009:dgTypes.obj
0001:0006c830 ?GetMinMax@@YAXAAVdgVector@@0QBMHH@Z 1006d830 f corelib_2009:dgTypes.obj
0001:0006de60 ?dgVertexListToIndexList@@YAHQAMHHHHQAHM@Z 1006ee60 f corelib_2009:dgTypes.obj
0001:0006dfe0 ?Minimum@dgRedBackNode@@QBEPAV1@XZ 1006efe0 f corelib_2009:dgTree.obj
0001:0006e000 ?Next@dgRedBackNode@@QBEPAV1@XZ 1006f000 f corelib_2009:dgTree.obj
0001:0006e030 ?InsertFixup@dgRedBackNode@@QAEXPAPAV1@@Z 1006f030 f corelib_2009:dgTree.obj
0001:0006e200 ?RemoveFixup@dgRedBackNode@@QAEXPAV1@PAPAV1@@Z 1006f200 f corelib_2009:dgTree.obj
0001:0006e4b0 ?Unlink@dgRedBackNode@@QAEXPAPAV1@@Z 1006f4b0 f corelib_2009:dgTree.obj
0001:0006e5b0 ?RemoveAllLow@dgRedBackNode@@QAEXXZ 1006f5b0 f corelib_2009:dgTree.obj
0001:0006e5e0 ?RemoveAll@dgRedBackNode@@QAEXXZ 1006f5e0 f corelib_2009:dgTree.obj
0001:0006e620 ?Remove@dgRedBackNode@@QAEXPAPAV1@@Z 1006f620 f corelib_2009:dgTree.obj
0001:0006e640 ??0dgThreads@@QAE@XZ 1006f640 f corelib_2009:dgThreads.obj
0001:0006e710 ?DestroydgThreads@dgThreads@@QAEXXZ 1006f710 f corelib_2009:dgThreads.obj
0001:0006e7d0 ?SubmitJob@dgThreads@@QAEHPAVdgWorkerThread@@@Z 1006f7d0 f corelib_2009:dgThreads.obj
0001:0006e860 ?GetWork@dgThreads@@AAEHPAPAVdgWorkerThread@@@Z 1006f860 f corelib_2009:dgThreads.obj
0001:0006e8f0 ?DoWork@dgThreads@@AAEXH@Z 1006f8f0 f corelib_2009:dgThreads.obj
0001:0006e940 ?CalculateChunkSizes@dgThreads@@QBEXHQAH@Z 1006f940 f corelib_2009:dgThreads.obj
0001:0006e990 ?GetThreadCount@dgThreads@@QBEHXZ 1006f990 f corelib_2009:dgThreads.obj
0001:0006e9a0 ?SynchronizationBarrier@dgThreads@@QAEXXZ 1006f9a0 f corelib_2009:dgThreads.obj
0001:0006e9c0 ?dgGetLock@dgThreads@@QAEXXZ 1006f9c0 f corelib_2009:dgThreads.obj
0001:0006ea00 ?dgReleaseLock@dgThreads@@QAEXXZ 1006fa00 f corelib_2009:dgThreads.obj
0001:0006ea10 ?dgGetIndirectLock@dgThreads@@QAEXPAH@Z 1006fa10 f corelib_2009:dgThreads.obj
0001:0006ea50 ?dgReleaseIndirectLock@dgThreads@@QAEXPAH@Z 1006fa50 f corelib_2009:dgThreads.obj
0001:0006ea60 ??1dgThreads@@QAE@XZ 1006fa60 f corelib_2009:dgThreads.obj
0001:0006ea70 ?ThreadExecute@dgThreads@@CGIPAX@Z 1006fa70 f corelib_2009:dgThreads.obj
0001:0006ea90 ?CreateThreaded@dgThreads@@QAEXH@Z 1006fa90 f corelib_2009:dgThreads.obj
0001:0006eb40 ??0VERTEX_METRIC_STRUCT@InternalPolyhedra@@QAE@ABVdgBigPlane@@@Z 1006fb40 f i corelib_2009:dgPolyhedra.obj
0001:0006ebb0 ?Accumulate@VERTEX_METRIC_STRUCT@InternalPolyhedra@@QAEXAAVdgBigPlane@@@Z 1006fbb0 f i corelib_2009:dgPolyhedra.obj
0001:0006ec40 ?Pop@?$dgDownHeap@PAVdgEdge@@M@@QAEXXZ 1006fc40 f i corelib_2009:dgPolyhedra.obj
0001:0006ec40 ?Pop@?$dgDownHeap@PAVdgMinkFace@dgContactSolver@@M@@QAEXXZ 1006fc40 f i physics_2009:dgMinkowskiConv.obj
0001:0006ecc0 ?Pop@?$dgDownHeap@PAVdgListNode@?$dgList@UEDGE_HANDLE@InternalPolyhedra@@@@N@@QAEXXZ 1006fcc0 f i corelib_2009:dgPolyhedra.obj
0001:0006ed60 ?Push@?$dgDownHeap@PAVdgListNode@?$dgList@UEDGE_HANDLE@InternalPolyhedra@@@@N@@QAEXAAPAVdgListNode@?$dgList@UEDGE_HANDLE@InternalPolyhedra@@@@N@Z 1006fd60 f i corelib_2009:dgPolyhedra.obj
0001:0006f500 ?DeleteEdge@dgPolyhedra@@QAEXPAVdgEdge@@@Z 10070500 f corelib_2009:dgPolyhedra.obj
0001:0006f580 ?FaceNormal@dgPolyhedra@@QBE?AVdgVector@@PAVdgEdge@@QBMH@Z 10070580 f corelib_2009:dgPolyhedra.obj
0001:0006f5d0 ?Append@?$dgList@PAVdgContact@@@@QAEPAVdgListNode@1@ABQAVdgContact@@@Z 100705d0 f i physics_2009:dgContact.obj
0001:0006f5d0 ?Append@?$dgList@PAVdgEdge@@@@QAEPAVdgListNode@1@ABQAVdgEdge@@@Z 100705d0 f i corelib_2009:dgPolyhedra.obj
0001:0006f660 ?Find@?$dgTree@VdgEdge@@_J@@QBEPAVdgTreeNode@1@_J@Z 10070660 f i corelib_2009:dgPolyhedra.obj
0001:0006f6a0 ?Addtop@?$dgList@UEDGE_HANDLE@InternalPolyhedra@@@@QAEPAVdgListNode@1@ABUEDGE_HANDLE@InternalPolyhedra@@@Z 100706a0 f i corelib_2009:dgPolyhedra.obj
0001:0006f750 ?Insert@?$dgTree@VdgEdge@@_J@@QAEPAVdgTreeNode@1@PAV21@_J@Z 10070750 f i corelib_2009:dgPolyhedra.obj
0001:0006f810 ?RemoveAll@?$dgList@UEDGE_HANDLE@InternalPolyhedra@@@@QAEXXZ 10070810 f i corelib_2009:dgPolyhedra.obj
0001:00070260 ??0dgPolyhedra@@QAE@XZ 10071260 f corelib_2009:dgPolyhedra.obj
0001:00070280 ??1dgPolyhedra@@UAE@XZ 10071280 f corelib_2009:dgPolyhedra.obj
0001:000702b0 ?DeleteFace@dgPolyhedra@@QAEXPAVdgEdge@@@Z 100712b0 f corelib_2009:dgPolyhedra.obj
0001:00070320 ?DeleteDegenerateFaces@dgPolyhedra@@QAEXQBMHM@Z 10071320 f corelib_2009:dgPolyhedra.obj
0001:00070450 ?SwapInfo@dgPolyhedra@@QAEXAAV1@@Z 10071450 f corelib_2009:dgPolyhedra.obj
0001:00070c90 ?Update@dgPolyhedraDescriptor@@QAEXABVdgPolyhedra@@@Z 10071c90 f corelib_2009:dgPolyhedra.obj
0001:00070dd0 ??_EdgPolyhedra@@UAEPAXI@Z 10071dd0 f i corelib_2009:dgPolyhedra.obj
0001:00070dd0 ??_GdgPolyhedra@@UAEPAXI@Z 10071dd0 f i corelib_2009:dgPolyhedra.obj
0001:00070e10 ?CollapseEdge@dgPolyhedra@@AAEPAVdgEdge@@PAV2@@Z 10071e10 f corelib_2009:dgPolyhedra.obj
0001:00071210 ?ChangeEdgeIncidentVertex@dgPolyhedra@@QAEXPAVdgEdge@@H@Z 10072210 f corelib_2009:dgPolyhedra.obj
0001:000712e0 ?Insert@?$dgTree@VdgEdge@@_J@@QAEPAVdgTreeNode@1@ABVdgEdge@@_JAA_N@Z 100722e0 f i corelib_2009:dgPolyhedra.obj
0001:00071520 ?EndFace@dgPolyhedra@@QAEXXZ 10072520 f corelib_2009:dgPolyhedra.obj
0001:00071540 ?AddFace@dgPolyhedra@@QAEPAVdgEdge@@HQBHQB_J@Z 10072540 f corelib_2009:dgPolyhedra.obj
0001:000717e0 ?Optimize@dgPolyhedra@@QAEXQBMHM@Z 100727e0 f corelib_2009:dgPolyhedra.obj
0001:00071fd0 ??0dgPolyhedra@@QAE@ABV0@@Z 10072fd0 f corelib_2009:dgPolyhedra.obj
0001:00072110 ?AddFace@dgPolyhedra@@QAEPAVdgEdge@@HQBH@Z 10073110 f corelib_2009:dgPolyhedra.obj
0001:00072160 ?AddFace@dgPolyhedra@@QAEPAVdgEdge@@HHH@Z 10073160 f corelib_2009:dgPolyhedra.obj
0001:000721b0 ?AddHalfEdge@dgPolyhedra@@QAEPAVdgEdge@@HH@Z 100731b0 f corelib_2009:dgPolyhedra.obj
0001:00072240 ?SpliteEdge@dgPolyhedra@@QAEXHPAVdgEdge@@@Z 10073240 f corelib_2009:dgPolyhedra.obj
0001:00072330 ?SpliteEdgeAndTriangulate@dgPolyhedra@@QAEXHPAVdgEdge@@@Z 10073330 f corelib_2009:dgPolyhedra.obj
0001:00072410 ?GetConectedSurface@dgPolyhedra@@QBE_NAAV1@@Z 10073410 f corelib_2009:dgPolyhedra.obj
0001:00073520 ?TriangulateFace@dgPolyhedra@@QAE_NPAVdgEdge@@QBMHAAVdgVector@@@Z 10074520 f corelib_2009:dgPolyhedra.obj
0001:000735a0 ?Triangulate@dgPolyhedra@@QAEXQBMHPAV1@@Z 100745a0 f corelib_2009:dgPolyhedra.obj
0001:00073760 ?ConvexPartition@dgPolyhedra@@QAEXQBMHPAV1@@Z 10074760 f corelib_2009:dgPolyhedra.obj
0001:000737d0 ??0dgStackBase@@IAE@H@Z 100747d0 f corelib_2009:dgStack.obj
0001:000737f0 ??1dgStackBase@@IAE@XZ 100747f0 f corelib_2009:dgStack.obj
0001:00073800 ?ForAllSectorsSimd@dgPolygonSoupDatabase@@MBEXABVdgVector@@0P6A?AW4dgIntersectStatus@@PAXQBMHQBHH@ZQAX@Z 10074800 f i corelib_2009:dgAABBPolygonSoup.obj
0001:00073800 ?ForAllSectors@dgPolygonSoupDatabase@@MBEXABVdgVector@@0P6A?AW4dgIntersectStatus@@PAXQBMHQBHH@ZQAX@Z 10074800 f i corelib_2009:dgAABBPolygonSoup.obj
0001:00073810 ?ForAllSectorsSimd@dgAABBTree@@QBEXQBHQBMABVdgVector@@2P6A?AW4dgIntersectStatus@@PAX1H0H@Z3@Z 10074810 f i corelib_2009:dgAABBPolygonSoup.obj
0001:00073a50 ?ForAllSectors@dgAABBTree@@QBEXQBHQBMABVdgVector@@2P6A?AW4dgIntersectStatus@@PAX1H0H@Z3@Z 10074a50 f i corelib_2009:dgAABBPolygonSoup.obj
0001:00073d30 ?SortBoxes@dgAABBTree@@ABEXQAV1@HHQBVdgTriplex@@@Z 10074d30 f i corelib_2009:dgAABBPolygonSoup.obj
0001:00073fc0 ??0dgAABBPolygonSoup@@IAE@XZ 10074fc0 f corelib_2009:dgAABBPolygonSoup.obj
0001:00073fe0 ??1dgAABBPolygonSoup@@MAE@XZ 10074fe0 f corelib_2009:dgAABBPolygonSoup.obj
0001:00074020 ?ForAllSectorsSimd@dgAABBPolygonSoup@@MBEXABVdgVector@@0P6A?AW4dgIntersectStatus@@PAXQBMHQBHH@ZQAX@Z 10075020 f corelib_2009:dgAABBPolygonSoup.obj
0001:00074050 ?ForAllSectors@dgAABBPolygonSoup@@MBEXABVdgVector@@0P6A?AW4dgIntersectStatus@@PAXQBMHQBHH@ZQAX@Z 10075050 f corelib_2009:dgAABBPolygonSoup.obj
0001:00074080 ?Serialize@dgAABBPolygonSoup@@UBEXP6AXPAXPBXI@Z0@Z 10075080 f corelib_2009:dgAABBPolygonSoup.obj
0001:00074100 ?Deserialize@dgAABBPolygonSoup@@UAEXP6AXPAX0I@Z0@Z 10075100 f corelib_2009:dgAABBPolygonSoup.obj
0001:000741d0 ?Resize@?$dgArray@VdgTriplex@@@@QBEXH@Z 100751d0 f i corelib_2009:dgAABBPolygonSoup.obj
0001:000742c0 ?Resize@?$dgArray@H@@QBEXH@Z 100752c0 f i corelib_2009:dgAABBPolygonSoup.obj
0001:00074370 ??_EdgPolygonSoupDatabase@@MAEPAXI@Z 10075370 f i corelib_2009:dgAABBPolygonSoup.obj
0001:00074370 ??_GdgPolygonSoupDatabase@@MAEPAXI@Z 10075370 f i corelib_2009:dgAABBPolygonSoup.obj
0001:000743a0 ?CalcExtends@dgAABBTree@@QAEXQAVdgTriplex@@HQBH@Z 100753a0 f i corelib_2009:dgAABBPolygonSoup.obj
0001:00074960 ?ForAllSectorsRayHitSimd@dgAABBTree@@QBEXABVFastRayTest@@PBHPBMP6AMPAXQBMHQBHH@ZQAX@Z 10075960 f i corelib_2009:dgAABBPolygonSoup.obj
0001:00074ca0 ?ForAllSectorsRayHit@dgAABBTree@@QBEXABVFastRayTest@@PBHPBMP6AMPAXQBMHQBHH@ZQAX@Z 10075ca0 f i corelib_2009:dgAABBPolygonSoup.obj
0001:00075030 ?ForAllSectorsSupportVertex@dgAABBTree@@QBE?AVdgVector@@ABV2@QBHQBM@Z 10076030 f i corelib_2009:dgAABBPolygonSoup.obj
0001:00075860 ?CalcBoxFromBoxArray@dgAABBTree@@AAEXQBV1@HPAVdgTriplex@@AAH@Z 10076860 f i corelib_2009:dgAABBPolygonSoup.obj
0001:00075f20 ?GetAxis@dgAABBTree@@ABEHQBV1@HQBVdgTriplex@@@Z 10076f20 f i corelib_2009:dgAABBPolygonSoup.obj
0001:00076560 ?SpliteBoxArray@dgAABBTree@@ABEHQAV1@HQBVdgTriplex@@@Z 10077560 f i corelib_2009:dgAABBPolygonSoup.obj
0001:00076890 ??_GdgAABBPolygonSoup@@MAEPAXI@Z 10077890 f i corelib_2009:dgAABBPolygonSoup.obj
0001:00076890 ??_EdgAABBPolygonSoup@@MAEPAXI@Z 10077890 f i corelib_2009:dgAABBPolygonSoup.obj
0001:000768e0 ?ForAllSectorsSupportVectex@dgAABBPolygonSoup@@MBE?AVdgVector@@ABV2@@Z 100778e0 f corelib_2009:dgAABBPolygonSoup.obj
0001:00076920 ?GetAABB@dgAABBPolygonSoup@@UBEXAAVdgVector@@0@Z 10077920 f corelib_2009:dgAABBPolygonSoup.obj
0001:00076a10 ?ForAllSectorsRayHit@dgAABBPolygonSoup@@MBEXABVFastRayTest@@P6AMPAXQBMHQBHH@ZQAX@Z 10077a10 f corelib_2009:dgAABBPolygonSoup.obj
0001:00076a40 ?ForAllSectorsRayHitSimd@dgAABBPolygonSoup@@MBEXABVFastRayTest@@P6AMPAXQBMHQBHH@ZQAX@Z 10077a40 f corelib_2009:dgAABBPolygonSoup.obj
0001:00076a70 ?CollectMyFaces@dgAABBPolygonSoup@@CA?AW4dgIntersectStatus@@PAXQBMHQBHH@Z 10077a70 f corelib_2009:dgAABBPolygonSoup.obj
0001:00076c10 ?Build@dgAABBTree@@QAEXPAV1@QAV1@QBV1@HPBV1@AAHQAVdgTriplex@@4@Z 10077c10 f i corelib_2009:dgAABBPolygonSoup.obj
0001:00076d30 ?CollectAllFaces@dgAABBPolygonSoup@@CA?AW4dgIntersectStatus@@PAXQBMHQBHH@Z 10077d30 f corelib_2009:dgAABBPolygonSoup.obj
0001:000773c0 ?Create@dgAABBPolygonSoup@@IAEXABVdgPolygonSoupDatabaseBuilder@@@Z 100783c0 f corelib_2009:dgAABBPolygonSoup.obj
0001:000778e0 ?AddFilterFace@dgPolySoupFilterAllocator@@QAEHIQAH@Z 100788e0 f i corelib_2009:dgPolygonSoupBuilder.obj
0001:00077990 ?Begin@dgPolygonSoupDatabaseBuilder@@QAEXXZ 10078990 f corelib_2009:dgPolygonSoupBuilder.obj
0001:000779a0 ??_GdgPolySoupFilterAllocator@@UAEPAXI@Z 100789a0 f i corelib_2009:dgPolygonSoupBuilder.obj
0001:000779a0 ??_EdgPolySoupFilterAllocator@@UAEPAXI@Z 100789a0 f i corelib_2009:dgPolygonSoupBuilder.obj
0001:000779d0 ??1dgPolygonSoupDatabaseBuilder@@QAE@XZ 100789d0 f corelib_2009:dgPolygonSoupBuilder.obj
0001:00077a30 ??A?$dgArray@VdgTriplex@@@@QAEAAVdgTriplex@@H@Z 10078a30 f i corelib_2009:dgPolygonSoupBuilder.obj
0001:00077a60 ??0dgPolygonSoupDatabaseBuilder@@QAE@XZ 10078a60 f corelib_2009:dgPolygonSoupBuilder.obj
0001:00077ab0 ?FilterFace@dgPolygonSoupDatabaseBuilder@@AAEHHQAH@Z 10078ab0 f corelib_2009:dgPolygonSoupBuilder.obj
0001:00078450 ?AddConvexFace@dgPolygonSoupDatabaseBuilder@@AAEHHQAH0@Z 10079450 f corelib_2009:dgPolygonSoupBuilder.obj
0001:00078ee0 ?AddMesh@dgPolygonSoupDatabaseBuilder@@QAEXQBMHHHQBH11ABVdgMatrix@@@Z 10079ee0 f corelib_2009:dgPolygonSoupBuilder.obj
0001:000791b0 ?OptimizeByGroupID@dgPolygonSoupDatabaseBuilder@@AAEXAAV1@HH0@Z 1007a1b0 f corelib_2009:dgPolygonSoupBuilder.obj
0001:00079670 ?OptimizeByIndividualFaces@dgPolygonSoupDatabaseBuilder@@AAEXXZ 1007a670 f corelib_2009:dgPolygonSoupBuilder.obj
0001:000797b0 ?Insert@?$dgTree@HH@@QAEPAVdgTreeNode@1@ABHHAA_N@Z 1007a7b0 f i corelib_2009:dgPolygonSoupBuilder.obj
0001:00079880 ?OptimizeByGroupID@dgPolygonSoupDatabaseBuilder@@AAEXXZ 1007a880 f corelib_2009:dgPolygonSoupBuilder.obj
0001:00079fe0 ?EndAndOptimize@dgPolygonSoupDatabaseBuilder@@AAEX_N@Z 1007afe0 f corelib_2009:dgPolygonSoupBuilder.obj
0001:0007a110 ?End@dgPolygonSoupDatabaseBuilder@@QAEX_N@Z 1007b110 f corelib_2009:dgPolygonSoupBuilder.obj
0001:0007b290 ?BoxTestSimd@FastRayTest@@QBEHABVdgVector@@0@Z 1007c290 f corelib_2009:dgIntersections.obj
0001:0007b360 ?PolygonIntersectSimd@FastRayTest@@QBEMABVdgVector@@QBMHQBHH@Z 1007c360 f corelib_2009:dgIntersections.obj
0001:0007b590 ??0FastRayTest@@QAE@ABVdgVector@@0@Z 1007c590 f corelib_2009:dgIntersections.obj
0001:0007b810 ?BoxTest@FastRayTest@@QBEHABVdgVector@@0@Z 1007c810 f corelib_2009:dgIntersections.obj
0001:0007b920 ?PolygonIntersect@FastRayTest@@QBEMABVdgVector@@QBMHQBHH@Z 1007c920 f corelib_2009:dgIntersections.obj
0001:0007bb40 ?dgRayBoxClip@@YA_NAAVdgVector@@0ABV1@1@Z 1007cb40 f corelib_2009:dgIntersections.obj
0001:0007bea0 ?dgPointToRayDistance@@YA?AVdgVector@@ABV1@00@Z 1007cea0 f corelib_2009:dgIntersections.obj
0001:0007bfd0 ?dgRayToRayDistance@@YAXABVdgVector@@000AAV1@1@Z 1007cfd0 f corelib_2009:dgIntersections.obj
0001:0007c390 ?dgPointToTriangleDistance@@YA?AVdgVector@@ABV1@000@Z 1007d390 f corelib_2009:dgIntersections.obj
0001:0007c8f0 ?dgPointToTriangleDistance@@YA?AVdgBigVector@@ABV1@000@Z 1007d8f0 f corelib_2009:dgIntersections.obj
0001:0007cc80 ??0dgQuaternion@@QAE@ABVdgVector@@M@Z 1007dc80 f corelib_2009:dgQuaternion.obj
0001:0007cce0 ??0dgQuaternion@@QAE@ABVdgMatrix@@@Z 1007dce0 f corelib_2009:dgQuaternion.obj
0001:0007ce70 _ceil 1007de70 f LIBCMT:_ceil_pentium4_.obj
0001:0007ceb0 __ceil_pentium4 1007deb0 f LIBCMT:_ceil_pentium4_.obj
0001:0007cf8d __cfltcvt_init 1007df8d f LIBCMT:_fpinit_.obj
0001:0007cfed __fpmath 1007dfed f LIBCMT:_fpinit_.obj
0001:0007d010 __ftol2_sse 1007e010 f LIBCMT:ftol2.obj
0001:0007d019 __ftol2_pentium4 1007e019 f LIBCMT:ftol2.obj
0001:0007d02c __ftol2_sse_excpt 1007e02c f LIBCMT:ftol2.obj
0001:0007d046 __ftol2 1007e046 f LIBCMT:ftol2.obj
0001:0007d0bb _V6_HeapAlloc 1007e0bb f LIBCMT:malloc.obj
0001:0007d10a _malloc 1007e10a f LIBCMT:malloc.obj
0001:0007d1d4 _free 1007e1d4 f LIBCMT:free.obj
0001:0007d270 _memset 1007e270 f LIBCMT:memset.obj
0001:0007d2f0 _memcpy 1007e2f0 f LIBCMT:memcpy.obj
0001:0007d660 __alloca_probe 1007e660 LIBCMT:chkstk.obj
0001:0007d660 __chkstk 1007e660 f LIBCMT:chkstk.obj
0001:0007d68b __CRT_INIT@12 1007e68b f LIBCMT:dllcrt0.obj
0001:0007d8b6 __DllMainCRTStartup@12 1007e8b6 f LIBCMT:dllcrt0.obj
0001:0007d8d9 _sprintf 1007e8d9 f LIBCMT:sprintf.obj
0001:0007da84 __control87 1007ea84 f i LIBCMT:_ieee87_.obj
0001:0007dd93 __controlfp 1007ed93 f LIBCMT:_ieee87_.obj
0001:0007e0a5 __purecall 1007f0a5 f LIBCMT:purevirt.obj
0001:0007e0d0 _log 1007f0d0 f LIBCMT:_log_.obj
0001:0007e110 __CIlog 1007f110 f LIBCMT:_log_.obj
0001:0007e14b __CIlog_default 1007f14b f LIBCMT:_log_.obj
0001:0007e15f __log_default 1007f15f LIBCMT:_log_.obj
0001:0007e220 _pow 1007f220 f LIBCMT:_pow_.obj
0001:0007e260 __CIpow 1007f260 f LIBCMT:_pow_.obj
0001:0007e29b __CIpow_default 1007f29b f LIBCMT:_pow_.obj
0001:0007e2b4 __pow_default 1007f2b4 LIBCMT:_pow_.obj
0001:0007e4b0 __CIsqrt 1007f4b0 f LIBCMT:_sqrt_.obj
0001:0007e4c4 _sqrt 1007f4c4 LIBCMT:_sqrt_.obj
0001:0007e624 ___onexitinit 1007f624 f LIBCMT:onexit.obj
0001:0007e655 __onexit 1007f655 f LIBCMT:onexit.obj
0001:0007e691 _atexit 1007f691 f LIBCMT:onexit.obj
0001:0007e6b0 __except_handler3 1007f6b0 f LIBCMT:exsup3.obj
0001:0007e7ae __seh_longjmp_unwind@4 1007f7ae f LIBCMT:exsup3.obj
0001:0007e7c9 __endthreadex 1007f7c9 f LIBCMT:threadex.obj
0001:0007e8ca __beginthreadex 1007f8ca f LIBCMT:threadex.obj
0001:0007e980 __allmul 1007f980 f LIBCMT:llmul.obj
0001:0007e9b4 ___libm_error_support 1007f9b4 f LIBCMT:_libm_error_.obj
0001:0007ec64 __sse2_mathfcns_init 1007fc64 f LIBCMT:_mathfcns_.obj
0001:0007ec78 __ceil_default 1007fc78 f LIBCMT:_ceil_.obj
0001:0007ed4d ??0_LocaleUpdate@@QAE@PAUlocaleinfo_struct@@@Z 1007fd4d f i LIBCMT:cvt.obj
0001:0007edd4 __forcdecpt_l 1007fdd4 f LIBCMT:cvt.obj
0001:0007ee47 __cropzeros_l 1007fe47 f LIBCMT:cvt.obj
0001:0007eec9 __positive 1007fec9 f LIBCMT:cvt.obj
0001:0007eee5 __fassign_l 1007fee5 f LIBCMT:cvt.obj
0001:0007ef27 __fassign 1007ff27 f LIBCMT:cvt.obj
0001:0007ef60 __forcdecpt 1007ff60 f LIBCMT:cvt.obj
0001:0007ef73 __cropzeros 1007ff73 f LIBCMT:cvt.obj
0001:0007f0f5 __cftoe_l 100800f5 f LIBCMT:cvt.obj
0001:0007f1c5 __cftoe 100801c5 f LIBCMT:cvt.obj
0001:0007f1e5 __cftoa_l 100801e5 f LIBCMT:cvt.obj
0001:0007f64f __cftof_l 1008064f f LIBCMT:cvt.obj
0001:0007f70a __cftog_l 1008070a f LIBCMT:cvt.obj
0001:0007f804 __cfltcvt_l 10080804 f LIBCMT:cvt.obj
0001:0007f88c __cfltcvt 1008088c f LIBCMT:cvt.obj
0001:0007f8af __initp_misc_cfltcvt_tab 100808af f LIBCMT:cmiscdat.obj
0001:0007f8d0 __setdefaultprecision 100808d0 f LIBCMT:fp8.obj
0001:0007f8fb __ms_p5_test_fdiv 100808fb f LIBCMT:_testfdiv_.obj
0001:0007f939 __ms_p5_mp_test_fdiv 10080939 f LIBCMT:_testfdiv_.obj
0001:0007f962 __mtinitlocks 10080962 f LIBCMT:mlock.obj
0001:0007f9ad __mtdeletelocks 100809ad f LIBCMT:mlock.obj
0001:0007fa04 __unlock 10080a04 f LIBCMT:mlock.obj
0001:0007fa1b __mtinitlocknum 10080a1b f LIBCMT:mlock.obj
0001:0007fade __lock 10080ade f LIBCMT:mlock.obj
0001:0007fb11 ___sbh_find_block 10080b11 f LIBCMT:sbheap.obj
0001:0007fb41 ___sbh_free_block 10080b41 f LIBCMT:sbheap.obj
0001:0007fe57 ___sbh_alloc_new_region 10080e57 f LIBCMT:sbheap.obj
0001:0007ff07 ___sbh_alloc_new_group 10080f07 f LIBCMT:sbheap.obj
0001:0008000f ___sbh_resize_block 1008100f f LIBCMT:sbheap.obj
0001:000802f0 ___sbh_alloc_block 100812f0 f LIBCMT:sbheap.obj
0001:000805d8 __SEH_prolog4 100815d8 f LIBCMT:sehprolg4.obj
0001:0008061d __SEH_epilog4 1008161d f LIBCMT:sehprolg4.obj
0001:00080640 __except_handler4 10081640 f LIBCMT:chandler4.obj
0001:000807cc __heap_init 100817cc f LIBCMT:heapinit.obj
0001:000807fc __heap_term 100817fc f LIBCMT:heapinit.obj
0001:00080870 __crt_waiting_on_module_handle 10081870 f LIBCMT:crt0dat.obj
0001:000808a0 __amsg_exit 100818a0 f LIBCMT:crt0dat.obj
0001:000808c9 ___crtCorExitProcess 100818c9 f LIBCMT:crt0dat.obj
0001:000808f4 ___crtExitProcess 100818f4 f LIBCMT:crt0dat.obj
0001:0008090c __lockexit 1008190c f LIBCMT:crt0dat.obj
0001:00080915 __unlockexit 10081915 f LIBCMT:crt0dat.obj
0001:0008093b __initterm_e 1008193b f LIBCMT:crt0dat.obj
0001:0008095f __cinit 1008195f f LIBCMT:crt0dat.obj
0001:00080b10 __exit 10081b10 f LIBCMT:crt0dat.obj
0001:00080b26 __cexit 10081b26 f LIBCMT:crt0dat.obj
0001:00080b35 __init_pointers 10081b35 f LIBCMT:crt0dat.obj
0001:00080b83 __NMSG_WRITE 10081b83 f LIBCMT:crt0msg.obj
0001:00080d2e __FF_MSGBANNER 10081d2e f LIBCMT:crt0msg.obj
0001:00080d67 __get_errno_from_oserr 10081d67 f LIBCMT:dosmap.obj
0001:00080da9 __errno 10081da9 f LIBCMT:dosmap.obj
0001:00080dbc ___doserrno 10081dbc f LIBCMT:dosmap.obj
0001:00080dcf __dosmaperr 10081dcf f LIBCMT:dosmap.obj
0001:00080df2 __initp_heap_handler 10081df2 f LIBCMT:handler.obj
0001:00080e01 __callnewh 10081e01 f LIBCMT:handler.obj
0001:00080e80 __VEC_memzero 10081e80 f LIBCMT:p4_memset.obj
0001:00080f96 __VEC_memcpy 10081f96 f LIBCMT:p4_memcpy.obj
0001:00081079 __encode_pointer 10082079 f LIBCMT:tidtable.obj
0001:000810eb __encoded_null 100820eb f LIBCMT:tidtable.obj
0001:000810f4 __decode_pointer 100820f4 f LIBCMT:tidtable.obj
0001:00081166 ___crtTlsAlloc@4 10082166 f LIBCMT:tidtable.obj
0001:0008116f ___fls_getvalue@4 1008216f f LIBCMT:tidtable.obj
0001:00081189 ___get_flsindex 10082189 f LIBCMT:tidtable.obj
0001:0008118f ___set_flsgetvalue 1008218f f LIBCMT:tidtable.obj
0001:000811c3 ___fls_setvalue@8 100821c3 f LIBCMT:tidtable.obj
0001:000811e0 __mtterm 100821e0 f LIBCMT:tidtable.obj
0001:0008121d __initptd 1008221d f LIBCMT:tidtable.obj
0001:00081304 __getptd_noexit 10082304 f LIBCMT:tidtable.obj
0001:0008137d __getptd 1008237d f LIBCMT:tidtable.obj
0001:00081397 __freefls@4 10082397 f LIBCMT:tidtable.obj
0001:000814c6 __freeptd 100824c6 f LIBCMT:tidtable.obj
0001:00081534 __mtinit 10082534 f LIBCMT:tidtable.obj
0001:000816c1 __malloc_crt 100826c1 f LIBCMT:crtheap.obj
0001:00081706 __calloc_crt 10082706 f LIBCMT:crtheap.obj
0001:00081752 __realloc_crt 10082752 f LIBCMT:crtheap.obj
0001:000817a0 __ioinit 100827a0 f LIBCMT:ioinit.obj
0001:000819f4 __ioterm 100829f4 f LIBCMT:ioinit.obj
0001:00081a42 __setenvp 10082a42 f LIBCMT:stdenvp.obj
0001:00081cba __setargv 10082cba f LIBCMT:stdargv.obj
0001:00081d75 ___crtGetEnvironmentStringsA 10082d75 f LIBCMT:a_env.obj
0001:00081eac __RTC_Initialize 10082eac f LIBCMT:_initsect_.obj
0001:00081ed2 __RTC_Terminate 10082ed2 f LIBCMT:_initsect_.obj
0001:00081ef8 __fpclear 10082ef8 f LIBCMT:_fpinit_.obj
0001:00081ef8 __initp_misc_winxfltr 10082ef8 f LIBCMT:winxfltr.obj
0001:00081ef9 __XcptFilter 10082ef9 f LIBCMT:winxfltr.obj
0001:00082059 ___CppXcptFilter 10083059 f LIBCMT:winxfltr.obj
0001:00082079 ___security_init_cookie 10083079 f LIBCMT:gs_support.obj
0001:0008210f __flsbuf 1008310f f LIBCMT:_flsbuf.obj
0001:00082319 __output_l 10083319 f LIBCMT:output.obj
0001:00082eb1 __initp_misc_invarg 10083eb1 f LIBCMT:invarg.obj
0001:00082ec0 __invoke_watson 10083ec0 f LIBCMT:invarg.obj
0001:00082fe8 __invalid_parameter 10083fe8 f LIBCMT:invarg.obj
0001:0008300e __controlfp_s 1008400e f LIBCMT:_contrlfp_.obj
0001:0008307a __statfp 1008407a f LIBCMT:_fpctrl_.obj
0001:0008308a __clrfp 1008408a f LIBCMT:_fpctrl_.obj
0001:0008309b __ctrlfp 1008409b f LIBCMT:_fpctrl_.obj
0001:000830c4 __set_statfp 100840c4 f LIBCMT:_fpctrl_.obj
0001:0008311c ___set_fpsr_sse2 1008411c f LIBCMT:_fpctrl_.obj
0001:0008318e __initp_misc_winsig 1008418e f LIBCMT:winsig.obj
0001:000831e3 ___get_sigabrt 100841e3 f LIBCMT:winsig.obj
0001:000831f0 _raise 100841f0 f LIBCMT:winsig.obj
0001:000833a0 _abort 100843a0 f LIBCMT:abort.obj
0001:000834b7 __set_abort_behavior 100844b7 f LIBCMT:abort.obj
0001:000834d8 __initp_misc_purevirt 100844d8 f LIBCMT:inithelp.obj
0001:000834f0 __CIlog_pentium4 100844f0 f LIBCMT:_log_pentium4_.obj
0001:00083508 __log_pentium4 10084508 LIBCMT:_log_pentium4_.obj
0001:00083771 __fFEXP 10084771 LIBCMT:_87tran_.obj
0001:000837d8 __rtinfpopse 100847d8 LIBCMT:_87tran_.obj
0001:000837da __rtinfnpopse 100847da LIBCMT:_87tran_.obj
0001:000837ea __fFLN 100847ea LIBCMT:_87tran_.obj
0001:0008389f __rtinfpop 1008489f LIBCMT:_87tran_.obj
0001:000838a1 __rtinfnpop 100848a1 LIBCMT:_87tran_.obj
0001:000838be __ffexpm1 100848be LIBCMT:_87tran_.obj
0001:00083970 __trandisp1 10084970 f LIBCMT:_87disp_.obj
0001:000839d7 __trandisp2 100849d7 f LIBCMT:_87disp_.obj
0001:00083a63 __rttospopde 10084a63 LIBCMT:_87disp_.obj
0001:00083a68 __rttospop 10084a68 LIBCMT:_87disp_.obj
0001:00083a6a __rtnospop 10084a6a LIBCMT:_87disp_.obj
0001:00083a6c __rttosnpop 10084a6c LIBCMT:_87disp_.obj
0001:00083a6d __rtnospopde 10084a6d LIBCMT:_87disp_.obj
0001:00083a74 __rtzeropop 10084a74 LIBCMT:_87disp_.obj
0001:00083a76 __rtzeronpop 10084a76 LIBCMT:_87disp_.obj
0001:00083a7b __rtonepop 10084a7b LIBCMT:_87disp_.obj
0001:00083a7d __rtonenpop 10084a7d LIBCMT:_87disp_.obj
0001:00083a82 __tosnan1 10084a82 LIBCMT:_87disp_.obj
0001:00083aad __nosnan2 10084aad LIBCMT:_87disp_.obj
0001:00083aaf __tosnan2 10084aaf LIBCMT:_87disp_.obj
0001:00083ad7 __nan2 10084ad7 LIBCMT:_87disp_.obj
0001:00083b16 __rtindfpop 10084b16 LIBCMT:_87disp_.obj
0001:00083b18 __rtindfnpop 10084b18 LIBCMT:_87disp_.obj
0001:00083b29 __rttosnpopde 10084b29 LIBCMT:_87disp_.obj
0001:00083b33 __rtchsifneg 10084b33 LIBCMT:_87disp_.obj
0001:00083b40 __twoToTOS 10084b40 f LIBCMT:_common_.obj
0001:00083b55 __load_CW 10084b55 f LIBCMT:_common_.obj
0001:00083b6c __convertTOStoQNaN 10084b6c f LIBCMT:_common_.obj
0001:00083b85 __fload_withFB 10084b85 f LIBCMT:_common_.obj
0001:00083bc8 __checkTOS_withFB 10084bc8 f LIBCMT:_common_.obj
0001:00083bde __fast_exit 10084bde f LIBCMT:_common_.obj
0001:00083beb __math_exit 10084beb f LIBCMT:_common_.obj
0001:00083c15 __check_overflow_exit 10084c15 f LIBCMT:_common_.obj
0001:00083c29 __check_range_exit 10084c29 f LIBCMT:_common_.obj
0001:00083cd0 __startTwoArgErrorHandling 10084cd0 f LIBCMT:_genexcep_.obj
0001:00083ce7 __startOneArgErrorHandling 10084ce7 f LIBCMT:_genexcep_.obj
0001:00083d30 __CIpow_pentium4 10084d30 f LIBCMT:_pow_pentium4_.obj
0001:00083d49 __pow_pentium4 10084d49 LIBCMT:_pow_pentium4_.obj
0001:00084890 __d_inttype 10085890 f LIBCMT:_powhlp_.obj
0001:000848f6 __powhlp 100858f6 f LIBCMT:_powhlp_.obj
0001:00084a36 __msize 10085a36 f LIBCMT:msize.obj
0001:00084ad9 _CallDestructExceptionObject 10085ad9 f LIBCMT:calldtor.obj
0001:00084b14 __global_unwind2 10085b14 f LIBCMT:exsup.obj
0001:00084b79 __local_unwind2 10085b79 f LIBCMT:exsup.obj
0001:00084bfd __abnormal_termination 10085bfd f LIBCMT:exsup.obj
0001:00084c20 __NLG_Notify1 10085c20 f LIBCMT:exsup.obj
0001:00084c29 __NLG_Notify 10085c29 f LIBCMT:exsup.obj
0001:00084c40 __NLG_Dispatch 10085c40 LIBCMT:exsup.obj
0001:00084c40 __NLG_Dispatch2 10085c40 LIBCMT:exsup.obj
0001:00084c48 __NLG_Call 10085c48 f LIBCMT:exsup.obj
0001:00084c4a __NLG_Return2 10085c4a LIBCMT:exsup.obj
0001:00084d10 __ValidateEH3RN 10085d10 f LIBCMT:eh3valid.obj
0001:00085060 __ValidateImageBase 10086060 f LIBCMT:pesect.obj
0001:000850a0 __FindPESection 100860a0 f LIBCMT:pesect.obj
0001:000850f0 __IsNonwritableInCurrentImage 100860f0 f LIBCMT:pesect.obj
0001:000851ad __matherr 100861ad f LIBCMT:_matherr_.obj
0001:00085200 __get_sse2_info 10086200 f LIBCMT:cpu_disp.obj
0001:00085262 ___sse2_available_init 10086262 f LIBCMT:cpu_disp.obj
0001:0008526f __raise_exc_ex 1008626f f LIBCMT:_fpexcept_.obj
0001:0008554b __raise_exc 1008654b f LIBCMT:_fpexcept_.obj
0001:0008556e __handle_exc 1008656e f LIBCMT:_fpexcept_.obj
0001:00085750 __set_errno_from_matherr 10086750 f LIBCMT:_fpexcept_.obj
0001:0008577d __errcode 1008677d f LIBCMT:_fpexcept_.obj
0001:000857b1 __umatherr 100867b1 f LIBCMT:_fpexcept_.obj
0001:00085851 __handle_qnan1 10086851 f LIBCMT:_fpexcept_.obj
0001:000858a6 __except1 100868a6 f LIBCMT:_fpexcept_.obj
0001:0008596f __frnd 1008696f f LIBCMT:_frnd_.obj
0001:00085983 __set_exp 10086983 f LIBCMT:_util_.obj
0001:000859af __sptype 100869af f LIBCMT:_util_.obj
0001:00085a0f __decomp 10086a0f f LIBCMT:_util_.obj
0001:00085ad0 _strrchr 10086ad0 f LIBCMT:strrchr.obj
0001:00085d23 ___updatetmbcinfo 10086d23 f LIBCMT:mbctype.obj
0001:00085e43 __setmbcp_nolock 10086e43 f LIBCMT:mbctype.obj
0001:00086028 __setmbcp 10087028 f LIBCMT:mbctype.obj
0001:000861c2 ___initmbctable 100871c2 f LIBCMT:mbctype.obj
0001:000861e0 ___freetlocinfo 100871e0 f LIBCMT:setlocal.obj
0001:00086329 ___addlocaleref 10087329 f LIBCMT:setlocal.obj
0001:000863b8 ___removelocaleref 100873b8 f LIBCMT:setlocal.obj
0001:0008648f ___updatetlocinfo 1008748f f LIBCMT:setlocal.obj
0001:00086505 __isdigit_l 10087505 f i LIBCMT:_ctype.obj
0001:00086556 _isdigit 10087556 f i LIBCMT:_ctype.obj
0001:00086584 __tolower_l 10087584 f LIBCMT:tolower.obj
0001:00086699 _tolower 10087699 f LIBCMT:tolower.obj
0001:000866c5 __atodbl_l 100876c5 f LIBCMT:atodbl.obj
0001:0008676d __atoflt_l 1008776d f LIBCMT:atodbl.obj
0001:00086820 _memmove 10087820 f LIBCMT:memmove.obj
0001:00086b90 _strlen 10087b90 f LIBCMT:strlen.obj
0001:00086c1b _strcpy_s 10087c1b f LIBCMT:strcpy_s.obj
0001:00086c83 __fptostr 10087c83 f LIBCMT:_fptostr.obj
0001:00086d42 ___dtold 10087d42 f LIBCMT:_cfout_.obj
0001:00086dff __fltout2 10087dff f LIBCMT:_cfout_.obj
0001:00086e8f @__security_check_cookie@4 10087e8f f LIBCMT:secchk.obj
0001:00086ea0 __alldvrm 10087ea0 f LIBCMT:lldvrm.obj
0001:00086f80 __aullshr 10087f80 f LIBCMT:ullshr.obj
0001:00086f9f __fptrap 10087f9f f LIBCMT:crt0fp.obj
0001:00086fa8 __initp_misc_initcrit 10087fa8 f LIBCMT:initcrit.obj
0001:00086fb7 ___crtInitCritSecAndSpinCount 10087fb7 f LIBCMT:initcrit.obj
0001:00087018 __local_unwind4 10088018 f LIBCMT:exsup4.obj
0001:000870ee __seh_longjmp_unwind4@4 100880ee f LIBCMT:exsup4.obj
0001:0008710a @_EH4_CallFilterFunc@8 1008810a f LIBCMT:exsup4.obj
0001:00087121 @_EH4_TransferToHandler@8 10088121 f LIBCMT:exsup4.obj
0001:0008713a @_EH4_GlobalUnwind@4 1008813a f LIBCMT:exsup4.obj
0001:00087154 @_EH4_LocalUnwind@16 10088154 f LIBCMT:exsup4.obj
0001:0008716b ?terminate@@YAXXZ 1008816b f LIBCMT:hooks.obj
0001:000871a4 __initp_eh_hooks 100881a4 f LIBCMT:hooks.obj
0001:000871b5 __initp_misc_rand_s 100881b5 f LIBCMT:rand_s.obj
0001:000871c4 ___crtMessageBoxA 100881c4 f LIBCMT:crtmbox.obj
0001:0008732d _strcat_s 1008832d f LIBCMT:strcat_s.obj
0001:000873a1 _strncpy_s 100883a1 f LIBCMT:strncpy_s.obj
0001:00087456 __set_error_mode 10088456 f LIBCMT:errmode.obj
0001:000874a1 __calloc_impl 100884a1 f LIBCMT:calloc_impl.obj
0001:000875bf _realloc 100885bf f LIBCMT:realloc.obj
0001:0008782d __ismbblead 1008882d f LIBCMT:ismbbyte.obj
0001:00087845 __lseeki64_nolock 10088845 f LIBCMT:lseeki64.obj
0001:000878ca __lseeki64 100888ca f LIBCMT:lseeki64.obj
0001:000879e3 __write_nolock 100889e3 f LIBCMT:write.obj
0001:00088116 __write 10089116 f LIBCMT:write.obj
0001:000881f2 __getbuf 100891f2 f LIBCMT:_getbuf.obj
0001:0008823b __isatty 1008923b f LIBCMT:isatty.obj
0001:0008829f ___iob_func 1008929f f LIBCMT:_file.obj
0001:000882a5 ___initstdio 100892a5 f LIBCMT:_file.obj
0001:00088356 ___endstdio 10089356 f LIBCMT:_file.obj
0001:00088376 __lock_file 10089376 f LIBCMT:_file.obj
0001:000883b7 __lock_file2 100893b7 f LIBCMT:_file.obj
0001:000883e9 __unlock_file 100893e9 f LIBCMT:_file.obj
0001:00088425 __unlock_file2 10089425 f LIBCMT:_file.obj
0001:00088454 __fileno 10089454 f LIBCMT:fileno.obj
0001:00088486 __get_printf_count_output 10089486 f LIBCMT:printf.obj
0001:0008849c __wctomb_s_l 1008949c f LIBCMT:wctomb.obj
0001:00088608 _wctomb_s 10089608 f LIBCMT:wctomb.obj
0001:00088625 __isleadbyte_l 10089625 f i LIBCMT:_wctype.obj
0001:0008865d _isleadbyte 1008965d f i LIBCMT:_wctype.obj
0001:00088670 __aulldvrm 10089670 f LIBCMT:ulldvrm.obj
0001:00088705 __crt_debugger_hook 10089705 f LIBCMT:dbghook.obj
0001:0008870d __freea 1008970d f i LIBCMT:a_loc.obj
0001:00088730 _fdiv_main_routine 10089730 f LIBCMT:_adj_fdiv_.obj
0001:00088847 __adj_fdiv_r 10089847 f LIBCMT:_adj_fdiv_.obj
0001:00088ce6 __fdivp_sti_st 10089ce6 f LIBCMT:_adj_fdiv_.obj
0001:00088cf9 __fdivrp_sti_st 10089cf9 f LIBCMT:_adj_fdiv_.obj
0001:00088d0c __adj_fdiv_m32 10089d0c f LIBCMT:_adj_fdiv_.obj
0001:00088d58 __adj_fdiv_m64 10089d58 f LIBCMT:_adj_fdiv_.obj
0001:00088da4 __adj_fdiv_m16i 10089da4 f LIBCMT:_adj_fdiv_.obj
0001:00088dd8 __adj_fdiv_m32i 10089dd8 f LIBCMT:_adj_fdiv_.obj
0001:00088e0c __adj_fdivr_m32 10089e0c f LIBCMT:_adj_fdiv_.obj
0001:00088e58 __adj_fdivr_m64 10089e58 f LIBCMT:_adj_fdiv_.obj
0001:00088ea4 __adj_fdivr_m16i 10089ea4 f LIBCMT:_adj_fdiv_.obj
0001:00088ed8 __adj_fdivr_m32i 10089ed8 f LIBCMT:_adj_fdiv_.obj
0001:00088f0c __safe_fdiv 10089f0c f LIBCMT:_adj_fdiv_.obj
0001:00088f21 __safe_fdivr 10089f21 f LIBCMT:_adj_fdiv_.obj
0001:00088f36 __fprem_common 10089f36 f LIBCMT:_adj_fdiv_.obj
0001:0008913c __adj_fprem 1008a13c f LIBCMT:_adj_fdiv_.obj
0001:000891ee __fprem1_common 1008a1ee f LIBCMT:_adj_fdiv_.obj
0001:000893f4 __adj_fprem1 1008a3f4 f LIBCMT:_adj_fdiv_.obj
0001:000894a9 __safe_fprem 1008a4a9 f LIBCMT:_adj_fdiv_.obj
0001:000894af __safe_fprem1 1008a4af f LIBCMT:_adj_fdiv_.obj
0001:000894b5 __adj_fpatan 1008a4b5 f LIBCMT:_adj_fdiv_.obj
0001:000894b8 __adj_fptan 1008a4b8 f LIBCMT:_adj_fdiv_.obj
0001:000894bb __87except 1008a4bb f LIBCMT:_87except_.obj
0001:000895fa __fpclass 1008a5fa f LIBCMT:_ieeemisc_.obj
0001:00089a33 ___crtLCMapStringA 1008aa33 f LIBCMT:a_map.obj
0001:00089c32 ___crtGetStringTypeA 1008ac32 f LIBCMT:a_str.obj
0001:00089c74 ___free_lc_time 1008ac74 f LIBCMT:inittime.obj
0001:00089e09 ___free_lconv_num 1008ae09 f LIBCMT:initnum.obj
0001:00089e4e ___free_lconv_mon 1008ae4e f LIBCMT:initmon.obj
0001:00089ee0 _strcspn 1008aee0 f LIBCMT:strcspn.obj
0001:00089f30 _strcmp 1008af30 f LIBCMT:strcmp.obj
0001:00089fc0 _strpbrk 1008afc0 f LIBCMT:strpbrk.obj
0001:0008a000 __isctype_l 1008b000 f LIBCMT:isctype.obj
0001:0008a0b8 __ld12tod 1008b0b8 f LIBCMT:_intrncvt_.obj
0001:0008a5fc __ld12tof 1008b5fc f LIBCMT:_intrncvt_.obj
0001:0008ab40 ___strgtold12_l 1008bb40 f LIBCMT:_strgtold_.obj
0001:0008b238 _$I10_OUTPUT 1008c238 f LIBCMT:_x10fout_.obj
0001:0008bb5c ___report_gsfailure 1008cb5c f LIBCMT:gs_report.obj
0001:0008bc62 __free_osfhnd 1008cc62 f LIBCMT:osfinfo.obj
0001:0008bce8 __get_osfhandle 1008cce8 f LIBCMT:osfinfo.obj
0001:0008bd5f ___lock_fhandle 1008cd5f f LIBCMT:osfinfo.obj
0001:0008bdff __unlock_fhandle 1008cdff f LIBCMT:osfinfo.obj
0001:0008be26 __putwch_nolock 1008ce26 f LIBCMT:putwch.obj
0001:0008beeb __mbtowc_l 1008ceeb f LIBCMT:mbtowc.obj
0001:0008c002 _mbtowc 1008d002 f LIBCMT:mbtowc.obj
0001:0008c01c __fcloseall 1008d01c f LIBCMT:closeall.obj
0001:0008c0bb __flush 1008d0bb f LIBCMT:fflush.obj
0001:0008c123 __fflush_nolock 1008d123 f LIBCMT:fflush.obj
0001:0008c245 __flushall 1008d245 f LIBCMT:fflush.obj
0001:0008c47d _strtol 1008d47d f LIBCMT:strtol.obj
0001:0008c4b0 __alloca_probe_16 1008d4b0 f LIBCMT:alloca16.obj
0001:0008c4c6 __alloca_probe_8 1008d4c6 LIBCMT:alloca16.obj
0001:0008c4dc ___ansicp 1008d4dc f LIBCMT:convrtcp.obj
0001:0008c525 ___convertcp 1008d525 f LIBCMT:convrtcp.obj
0001:0008c6d9 _atol 1008d6d9 f LIBCMT:atox.obj
0001:0008c6ef ___mtold12 1008d6ef f LIBCMT:_mantold_.obj
0001:0008c8bd ___initconout 1008d8bd f LIBCMT:initcon.obj
0001:0008c8dc ___termcon 1008d8dc f LIBCMT:initcon.obj
0001:0008c909 __fclose_nolock 1008d909 f LIBCMT:fclose.obj
0001:0008c980 _fclose 1008d980 f LIBCMT:fclose.obj
0001:0008c9fc __commit 1008d9fc f LIBCMT:commit.obj
0001:0008cae0 ___ascii_strnicmp 1008dae0 f LIBCMT:_strnicm.obj
0001:0008cb41 __close_nolock 1008db41 f LIBCMT:close.obj
0001:0008cbdd __close 1008dbdd f LIBCMT:close.obj
0001:0008ccaa __freebuf 1008dcaa f LIBCMT:_freebuf.obj
0001:0008ccf0 _strchr 1008dcf0 f LIBCMT:strchr.obj
0001:0008ccf6 ___from_strstr_to_strchr 1008dcf6 LIBCMT:strchr.obj
0001:0008cdae _RtlUnwind@16 1008ddae f kernel32:KERNEL32.dll
0002:00000000 __imp__Sleep@4 1008e000 kernel32:KERNEL32.dll
0002:00000004 __imp__InterlockedExchange@8 1008e004 kernel32:KERNEL32.dll
0002:00000008 __imp__GetSystemInfo@4 1008e008 kernel32:KERNEL32.dll
0002:0000000c __imp__CloseHandle@4 1008e00c kernel32:KERNEL32.dll
0002:00000010 __imp__WaitForMultipleObjects@16 1008e010 kernel32:KERNEL32.dll
0002:00000014 __imp__DeleteCriticalSection@4 1008e014 kernel32:KERNEL32.dll
0002:00000018 __imp__SetEvent@4 1008e018 kernel32:KERNEL32.dll
0002:0000001c __imp__LeaveCriticalSection@4 1008e01c kernel32:KERNEL32.dll
0002:00000020 __imp__ReleaseSemaphore@12 1008e020 kernel32:KERNEL32.dll
0002:00000024 __imp__EnterCriticalSection@4 1008e024 kernel32:KERNEL32.dll
0002:00000028 __imp__WaitForSingleObject@8 1008e028 kernel32:KERNEL32.dll
0002:0000002c __imp__InterlockedIncrement@4 1008e02c kernel32:KERNEL32.dll
0002:00000030 __imp__InterlockedDecrement@4 1008e030 kernel32:KERNEL32.dll
0002:00000034 __imp__InitializeCriticalSection@4 1008e034 kernel32:KERNEL32.dll
0002:00000038 __imp__CreateEventA@16 1008e038 kernel32:KERNEL32.dll
0002:0000003c __imp__CreateSemaphoreA@16 1008e03c kernel32:KERNEL32.dll
0002:00000040 __imp__HeapAlloc@12 1008e040 kernel32:KERNEL32.dll
0002:00000044 __imp__GetLastError@0 1008e044 kernel32:KERNEL32.dll
0002:00000048 __imp__HeapFree@12 1008e048 kernel32:KERNEL32.dll
0002:0000004c __imp__GetCurrentThreadId@0 1008e04c kernel32:KERNEL32.dll
0002:00000050 __imp__GetCommandLineA@0 1008e050 kernel32:KERNEL32.dll
0002:00000054 __imp__ExitThread@4 1008e054 kernel32:KERNEL32.dll
0002:00000058 __imp__CreateThread@24 1008e058 kernel32:KERNEL32.dll
0002:0000005c __imp__GetProcAddress@8 1008e05c kernel32:KERNEL32.dll
0002:00000060 __imp__GetModuleHandleA@4 1008e060 kernel32:KERNEL32.dll
0002:00000064 __imp__VirtualFree@12 1008e064 kernel32:KERNEL32.dll
0002:00000068 __imp__VirtualAlloc@16 1008e068 kernel32:KERNEL32.dll
0002:0000006c __imp__HeapReAlloc@16 1008e06c kernel32:KERNEL32.dll
0002:00000070 __imp__HeapCreate@12 1008e070 kernel32:KERNEL32.dll
0002:00000074 __imp__HeapDestroy@4 1008e074 kernel32:KERNEL32.dll
0002:00000078 __imp__GetModuleHandleW@4 1008e078 kernel32:KERNEL32.dll
0002:0000007c __imp__ExitProcess@4 1008e07c kernel32:KERNEL32.dll
0002:00000080 __imp__WriteFile@20 1008e080 kernel32:KERNEL32.dll
0002:00000084 __imp__GetStdHandle@4 1008e084 kernel32:KERNEL32.dll
0002:00000088 __imp__GetModuleFileNameA@12 1008e088 kernel32:KERNEL32.dll
0002:0000008c __imp__TlsGetValue@4 1008e08c kernel32:KERNEL32.dll
0002:00000090 __imp__TlsAlloc@0 1008e090 kernel32:KERNEL32.dll
0002:00000094 __imp__TlsSetValue@8 1008e094 kernel32:KERNEL32.dll
0002:00000098 __imp__TlsFree@4 1008e098 kernel32:KERNEL32.dll
0002:0000009c __imp__SetLastError@4 1008e09c kernel32:KERNEL32.dll
0002:000000a0 __imp__SetHandleCount@4 1008e0a0 kernel32:KERNEL32.dll
0002:000000a4 __imp__GetFileType@4 1008e0a4 kernel32:KERNEL32.dll
0002:000000a8 __imp__GetStartupInfoA@4 1008e0a8 kernel32:KERNEL32.dll
0002:000000ac __imp__FreeEnvironmentStringsA@4 1008e0ac kernel32:KERNEL32.dll
0002:000000b0 __imp__GetEnvironmentStrings@0 1008e0b0 kernel32:KERNEL32.dll
0002:000000b4 __imp__FreeEnvironmentStringsW@4 1008e0b4 kernel32:KERNEL32.dll
0002:000000b8 __imp__WideCharToMultiByte@32 1008e0b8 kernel32:KERNEL32.dll
0002:000000bc __imp__GetEnvironmentStringsW@0 1008e0bc kernel32:KERNEL32.dll
0002:000000c0 __imp__QueryPerformanceCounter@4 1008e0c0 kernel32:KERNEL32.dll
0002:000000c4 __imp__GetTickCount@0 1008e0c4 kernel32:KERNEL32.dll
0002:000000c8 __imp__GetCurrentProcessId@0 1008e0c8 kernel32:KERNEL32.dll
0002:000000cc __imp__GetSystemTimeAsFileTime@4 1008e0cc kernel32:KERNEL32.dll
0002:000000d0 __imp__TerminateProcess@8 1008e0d0 kernel32:KERNEL32.dll
0002:000000d4 __imp__GetCurrentProcess@0 1008e0d4 kernel32:KERNEL32.dll
0002:000000d8 __imp__UnhandledExceptionFilter@4 1008e0d8 kernel32:KERNEL32.dll
0002:000000dc __imp__SetUnhandledExceptionFilter@4 1008e0dc kernel32:KERNEL32.dll
0002:000000e0 __imp__IsDebuggerPresent@0 1008e0e0 kernel32:KERNEL32.dll
0002:000000e4 __imp__HeapSize@12 1008e0e4 kernel32:KERNEL32.dll
0002:000000e8 __imp__RtlUnwind@16 1008e0e8 kernel32:KERNEL32.dll
0002:000000ec __imp__VirtualQuery@12 1008e0ec kernel32:KERNEL32.dll
0002:000000f0 __imp__RaiseException@16 1008e0f0 kernel32:KERNEL32.dll
0002:000000f4 __imp__GetCPInfo@8 1008e0f4 kernel32:KERNEL32.dll
0002:000000f8 __imp__GetACP@0 1008e0f8 kernel32:KERNEL32.dll
0002:000000fc __imp__GetOEMCP@0 1008e0fc kernel32:KERNEL32.dll
0002:00000100 __imp__IsValidCodePage@4 1008e100 kernel32:KERNEL32.dll
0002:00000104 __imp__InitializeCriticalSectionAndSpinCount@8 1008e104 kernel32:KERNEL32.dll
0002:00000108 __imp__LoadLibraryA@4 1008e108 kernel32:KERNEL32.dll
0002:0000010c __imp__SetFilePointer@16 1008e10c kernel32:KERNEL32.dll
0002:00000110 __imp__GetConsoleCP@0 1008e110 kernel32:KERNEL32.dll
0002:00000114 __imp__GetConsoleMode@8 1008e114 kernel32:KERNEL32.dll
0002:00000118 __imp__GetLocaleInfoA@16 1008e118 kernel32:KERNEL32.dll
0002:0000011c __imp__LCMapStringA@24 1008e11c kernel32:KERNEL32.dll
0002:00000120 __imp__MultiByteToWideChar@24 1008e120 kernel32:KERNEL32.dll
0002:00000124 __imp__LCMapStringW@24 1008e124 kernel32:KERNEL32.dll
0002:00000128 __imp__GetStringTypeA@20 1008e128 kernel32:KERNEL32.dll
0002:0000012c __imp__GetStringTypeW@16 1008e12c kernel32:KERNEL32.dll
0002:00000130 __imp__SetStdHandle@8 1008e130 kernel32:KERNEL32.dll
0002:00000134 __imp__WriteConsoleA@20 1008e134 kernel32:KERNEL32.dll
0002:00000138 __imp__GetConsoleOutputCP@0 1008e138 kernel32:KERNEL32.dll
0002:0000013c __imp__WriteConsoleW@20 1008e13c kernel32:KERNEL32.dll
0002:00000140 __imp__CreateFileA@28 1008e140 kernel32:KERNEL32.dll
0002:00000144 __imp__FlushFileBuffers@4 1008e144 kernel32:KERNEL32.dll
0002:00000148 \177KERNEL32_NULL_THUNK_DATA 1008e148 kernel32:KERNEL32.dll
0002:0000014c ___xc_a 1008e14c LIBCMT:crt0init.obj
0002:00000154 ___xc_z 1008e154 LIBCMT:crt0init.obj
0002:00000158 ___xi_a 1008e158 LIBCMT:crt0init.obj
0002:00000170 ___xi_z 1008e170 LIBCMT:crt0init.obj
0002:00000174 ___xp_a 1008e174 LIBCMT:crt0init.obj
0002:00000180 ___xp_z 1008e180 LIBCMT:crt0init.obj
0002:00000184 ___xt_a 1008e184 LIBCMT:crt0init.obj
0002:00000188 ___xt_z 1008e188 LIBCMT:crt0init.obj
0002:000001b0 ??_C@_0IE@IMGBDMJL@Newton?5Game?5Dynamics?5is?5the?5prop@ 1008e1b0 Newton.obj
0002:00000238 __real@3727c5ac 1008e238 Newton.obj
0002:00000240 __real@3ff0000000000000 1008e240 Newton.obj
0002:00000248 __real@3f800000 1008e248 Newton.obj
0002:00000250 __real@3f947ae140000000 1008e250 Newton.obj
0002:00000258 __real@0000000000000000 1008e258 Newton.obj
0002:00000260 __real@3ddb7cdfe0000000 1008e260 Newton.obj
0002:00000268 __real@3c888889 1008e268 Newton.obj
0002:0000026c __real@3a83126f 1008e26c Newton.obj
0002:00000270 __real@4479ffff 1008e270 Newton.obj
0002:00000278 __real@408f3fffe0000000 1008e278 Newton.obj
0002:00000280 __real@426fffff 1008e280 Newton.obj
0002:00000288 __real@404dffffe0000000 1008e288 Newton.obj
0002:00000290 __real@3e000000 1008e290 Newton.obj
0002:00000298 __real@3fc0000000000000 1008e298 Newton.obj
0002:000002a0 __real@40000000 1008e2a0 Newton.obj
0002:000002a4 __real@3c23d70a 1008e2a4 Newton.obj
0002:000002a8 __real@3f333333 1008e2a8 Newton.obj
0002:000002b0 __real@42fc6bf520000000 1008e2b0 Newton.obj
0002:000002b8 __real@3e45798ee0000000 1008e2b8 Newton.obj
0002:000002c0 __real@3f1a36e2e0000000 1008e2c0 Newton.obj
0002:000002c8 __real@358637bd 1008e2c8 Newton.obj
0002:000002cc __real@58aa87bf 1008e2cc Newton.obj
0002:000002d0 __real@4059000000000000 1008e2d0 Newton.obj
0002:000002d8 __real@3f50624de0000000 1008e2d8 Newton.obj
0002:000002e0 __real@3feff7cee0000000 1008e2e0 Newton.obj
0002:000002e8 __real@42c80000 1008e2e8 Newton.obj
0002:000002ec __real@c2c80000 1008e2ec Newton.obj
0002:000002f0 __real@3d4ccccd 1008e2f0 NewtonAproximateConvexPartition.obj
0002:000002f4 ??_7NewtonUserJoint@@6B@ 1008e2f4 NewtonClass.obj
0002:00000324 __real@58635fa9 1008e324 NewtonClass.obj
0002:00000328 __real@430c6bf520000000 1008e328 NewtonClass.obj
0002:00000330 __real@ba83126f 1008e330 NewtonClass.obj
0002:00000334 __real@d8635fa9 1008e334 NewtonClass.obj
0002:00000338 __real@c30c6bf520000000 1008e338 NewtonClass.obj
0002:00000340 __real@4058c00000000000 1008e340 NewtonClass.obj
0002:00000348 ??_7NewtonMeshEffect@@6B@ 1008e348 NewtonMeshEffect.obj
0002:0000034c __real@3f19999a 1008e34c NewtonMeshEffect.obj
0002:00000350 __real@3fe0000000000000 1008e350 NewtonMeshEffect.obj
0002:00000358 __real@3ff921fb00000000 1008e358 NewtonMeshEffect.obj
0002:00000360 __real@3fc45f30c0000000 1008e360 NewtonMeshEffect.obj
0002:00000368 __real@3f7ff972 1008e368 NewtonMeshEffect.obj
0002:00000370 __real@3fefff2e40000000 1008e370 NewtonMeshEffect.obj
0002:00000378 __real@bf7ff972 1008e378 NewtonMeshEffect.obj
0002:00000380 __real@bfefff2e40000000 1008e380 NewtonMeshEffect.obj
0002:00000388 __real@401921fb00000000 1008e388 NewtonMeshEffect.obj
0002:00000390 __real@3fefae1480000000 1008e390 NewtonMeshEffect.obj
0002:00000398 __real@d01502f9 1008e398 NewtonMeshEffect.obj
0002:0000039c __real@501502f9 1008e39c NewtonMeshEffect.obj
0002:000003a0 __real@3c9cd2b2a0000000 1008e3a0 NewtonMeshEffect.obj
0002:000003a8 __real@b727c5ac 1008e3a8 NewtonMeshEffect.obj
0002:000003ac ??_C@_0P@GHFPNOJB@bad?5allocation?$AA@ 1008e3ac NewtonStdAfx.obj
0002:000003d0 ??_7dgCollisionPoint@@6B@ 1008e3d0 physics_2009:dgWorld.obj
0002:00000444 ??_C@_04IABPNMKE@simd?$AA@ 1008e444 physics_2009:dgWorld.obj
0002:0000044c ??_C@_03MKEPLMIM@x87?$AA@ 1008e44c physics_2009:dgWorld.obj
0002:00000450 ??_7dgWorkerThread@@6B@ 1008e450 physics_2009:dgWorld.obj
0002:00000458 ??_7dgSetTrreadRoundMode@dgWorld@@6B@ 1008e458 physics_2009:dgWorld.obj
0002:00000460 ??_7dgSolverWorlkerThreads@@6B@ 1008e460 physics_2009:dgWorld.obj
0002:00000468 ??_7dgParallelSolverClear@@6B@ 1008e468 physics_2009:dgWorld.obj
0002:00000470 ??_7dgParallelSolverBodyInertia@@6B@ 1008e470 physics_2009:dgWorld.obj
0002:00000478 ??_7dgParallelSolverUpdateVeloc@@6B@ 1008e478 physics_2009:dgWorld.obj
0002:00000480 ??_7dgParallelSolverUpdateForce@@6B@ 1008e480 physics_2009:dgWorld.obj
0002:00000488 ??_7dgParallelSolverCalculateForces@@6B@ 1008e488 physics_2009:dgWorld.obj
0002:00000490 ??_7dgParallelSolverInitInternalForces@@6B@ 1008e490 physics_2009:dgWorld.obj
0002:00000498 ??_7dgParallelSolverBuildJacobianRows@@6B@ 1008e498 physics_2009:dgWorld.obj
0002:000004a0 ??_7dgParallelSolverJointAcceleration@@6B@ 1008e4a0 physics_2009:dgWorld.obj
0002:000004a8 ??_7dgParallelSolverInitFeedbackUpdate@@6B@ 1008e4a8 physics_2009:dgWorld.obj
0002:000004b0 ??_7dgParallelSolverBuildJacobianMatrix@@6B@ 1008e4b0 physics_2009:dgWorld.obj
0002:000004b8 __real@58e35fa9 1008e4b8 physics_2009:dgWorld.obj
0002:000004bc __real@3dd60419 1008e4bc physics_2009:dgWorld.obj
0002:000004c0 __real@3f611f0c3704ff40 1008e4c0 physics_2009:dgWorld.obj
0002:000004c8 __real@3dcccccd 1008e4c8 physics_2009:dgWorld.obj
0002:000004d0 __real@3ff6666660000000 1008e4d0 physics_2009:dgWorld.obj
0002:000004d8 __real@3ff8000000000000 1008e4d8 physics_2009:dgWorld.obj
0002:000004e0 __real@3c23d70b 1008e4e0 physics_2009:dgWorld.obj
0002:000004e4 __real@3e800000 1008e4e4 physics_2009:dgWorld.obj
0002:000004e8 __real@60ad78ec 1008e4e8 physics_2009:dgWorldDynamicUpdate.obj
0002:000004ec __real@233877aa 1008e4ec physics_2009:dgWorldDynamicUpdate.obj
0002:000004f0 __real@40400000 1008e4f0 physics_2009:dgWorldDynamicUpdate.obj
0002:000004f4 __real@bf800000 1008e4f4 physics_2009:dgWorldDynamicUpdate.obj
0002:000004f8 __real@40800000 1008e4f8 physics_2009:dgWorldDynamicUpdate.obj
0002:000004fc __real@a4e69595 1008e4fc physics_2009:dgWorldDynamicUpdate.obj
0002:00000500 __real@24e69595 1008e500 physics_2009:dgWorldDynamicUpdate.obj
0002:00000504 __real@322bcc77 1008e504 physics_2009:dgWorldDynamicUpdate.obj
0002:00000508 __real@404e000000000000 1008e508 physics_2009:dgWorldDynamicUpdate.obj
0002:00000510 __real@3fecccccc0000000 1008e510 physics_2009:dgWorldDynamicUpdate.obj
0002:00000518 __real@3c670ef540000000 1008e518 physics_2009:dgWorldDynamicUpdate.obj
0002:00000520 __real@bc9cd2b2a0000000 1008e520 physics_2009:dgWorldDynamicUpdate.obj
0002:00000528 __real@4010000000000000 1008e528 physics_2009:dgWorldDynamicUpdate.obj
0002:00000530 __real@3fd0000000000000 1008e530 physics_2009:dgWorldDynamicUpdate.obj
0002:00000538 __real@c010000000000000 1008e538 physics_2009:dgWorldDynamicUpdate.obj
0002:00000540 __real@4000000000000000 1008e540 physics_2009:dgNarrowPhaseCollision.obj
0002:00000548 __real@3ca3d70a 1008e548 physics_2009:dgNarrowPhaseCollision.obj
0002:00000550 __real@3f847ae140000000 1008e550 physics_2009:dgNarrowPhaseCollision.obj
0002:00000558 __real@358637be 1008e558 physics_2009:dgNarrowPhaseCollision.obj
0002:00000560 __real@bff0000000000000 1008e560 physics_2009:dgNarrowPhaseCollision.obj
0002:00000568 __real@3feffbe760000000 1008e568 physics_2009:dgNarrowPhaseCollision.obj
0002:00000570 __real@3f13b646 1008e570 physics_2009:dgNarrowPhaseCollision.obj
0002:00000578 ??_7dgCollisionMesh@@6B@ 1008e578 physics_2009:dgCollisionMesh.obj
0002:000005e8 ??_7dgCollisionConvexPolygon@dgCollisionMesh@@6B@ 1008e5e8 physics_2009:dgCollisionMesh.obj
0002:00000660 __real@3af357c2a0000000 1008e660 physics_2009:dgCollisionMesh.obj
0002:00000668 __real@3b23d70b 1008e668 physics_2009:dgCollisionMesh.obj
0002:00000670 __real@3feffe5ca0000000 1008e670 physics_2009:dgCollisionMesh.obj
0002:00000678 __real@c000000000000000 1008e678 physics_2009:dgCollisionMesh.obj
0002:00000680 __real@bfb99999a0000000 1008e680 physics_2009:dgCollisionMesh.obj
0002:00000688 __real@3f80000000000000 1008e688 physics_2009:dgCollisionMesh.obj
0002:00000690 __real@bb800000 1008e690 physics_2009:dgCollisionMesh.obj
0002:00000694 __real@3e31c433 1008e694 physics_2009:dgCollisionMesh.obj
0002:00000698 __real@3fb99999a0000000 1008e698 physics_2009:dgCollisionMesh.obj
0002:000006a0 ??_7dgCollisionBVH@@6BdgCollisionMesh@@@ 1008e6a0 physics_2009:dgCollisionBVH.obj
0002:0000070c ??_7dgCollisionBVH@@6BdgAABBPolygonSoup@@@ 1008e70c physics_2009:dgCollisionBVH.obj
0002:00000730 __real@3f99999a 1008e730 physics_2009:dgCollisionBVH.obj
0002:00000734 __real@e0ad78ec 1008e734 physics_2009:dgCollisionBVH.obj
0002:00000738 __real@4050000000000000 1008e738 physics_2009:dgCollisionScene.obj
0002:00000740 ??_7dgCollisionScene@@6B@ 1008e740 physics_2009:dgCollisionScene.obj
0002:000007a8 __real@408f400000000000 1008e7a8 physics_2009:dgBody.obj
0002:000007b0 __real@41200000 1008e7b0 physics_2009:dgBody.obj
0002:000007b8 __real@4024000000000000 1008e7b8 physics_2009:dgBody.obj
0002:000007c0 __real@3ff99999a0000000 1008e7c0 physics_2009:dgBody.obj
0002:000007c8 __real@3f899999a0000000 1008e7c8 physics_2009:dgBody.obj
0002:000007d0 __real@3fe99999a0000000 1008e7d0 physics_2009:dgBody.obj
0002:000007d8 __real@4046800000000000 1008e7d8 physics_2009:dgBody.obj
0002:000007e4 ??_7dgBallConstraint@@6B@ 1008e7e4 physics_2009:dgBallConstraint.obj
0002:00000818 __real@4065e00000000000 1008e818 physics_2009:dgBallConstraint.obj
0002:00000820 __real@4056800000000000 1008e820 physics_2009:dgBallConstraint.obj
0002:00000828 __real@4014000000000000 1008e828 physics_2009:dgBallConstraint.obj
0002:00000830 __real@bfc90fd0 1008e830 physics_2009:dgBallConstraint.obj
0002:00000834 __real@3fc90fd0 1008e834 physics_2009:dgBallConstraint.obj
0002:00000838 __real@3ff19999a0000000 1008e838 physics_2009:dgBallConstraint.obj
0002:00000840 __real@4030000000000000 1008e840 physics_2009:dgBallConstraint.obj
0002:00000848 ??_7dgHingeConstraint@@6B@ 1008e848 physics_2009:dgHingeConstraint.obj
0002:00000878 __real@3ff028f5c0000000 1008e878 physics_2009:dgHingeConstraint.obj
0002:00000880 ??_7dgSlidingConstraint@@6B@ 1008e880 physics_2009:dgSlidingConstraint.obj
0002:000008b0 ??_7dgCorkscrewConstraint@@6B@ 1008e8b0 physics_2009:dgCorkscrewConstraint.obj
0002:000008e0 ??_7dgUniversalConstraint@@6B@ 1008e8e0 physics_2009:dgUniversalConstraint.obj
0002:00000910 ??_7dgUpVectorConstraint@@6B@ 1008e910 physics_2009:dgUpVectorConstraint.obj
0002:00000940 __real@3f7eb852 1008e940 physics_2009:dgUpVectorConstraint.obj
0002:00000944 ??_7dgBroadPhaseApplyExternalForce@@6B@ 1008e944 physics_2009:dgBroadPhaseCollision.obj
0002:0000094c ??_7dgBroadPhaseCellPairsWorkerThread@@6B@ 1008e94c physics_2009:dgBroadPhaseCollision.obj
0002:00000954 ??_7dgBroadPhaseMaterialCallbackWorkerThread@@6B@ 1008e954 physics_2009:dgBroadPhaseCollision.obj
0002:0000095c ??_7dgBroadPhaseCalculateContactsWorkerThread@@6B@ 1008e95c physics_2009:dgBroadPhaseCollision.obj
0002:00000964 __real@447a0000 1008e964 physics_2009:dgBroadPhaseCollision.obj
0002:00000968 __real@c47a0000 1008e968 physics_2009:dgBroadPhaseCollision.obj
0002:0000096c __real@3f8ccccd 1008e96c physics_2009:dgBroadPhaseCollision.obj
0002:00000970 __real@4060000000000000 1008e970 physics_2009:dgBroadPhaseCollision.obj
0002:00000978 ??_7dgCollisionConvexHull@@6B@ 1008e978 physics_2009:dgCollisionConvexHull.obj
0002:000009f0 __real@c202a05f20000000 1008e9f0 physics_2009:dgCollisionConvexHull.obj
0002:000009f8 __real@3fefff9720000000 1008e9f8 physics_2009:dgCollisionConvexHull.obj
0002:00000a00 __real@b58637bd 1008ea00 physics_2009:dgCollisionConvexHull.obj
0002:00000a08 __real@3f40000000000000 1008ea08 physics_2009:dgCollisionConvexHull.obj
0002:00000a10 __real@40a0000000000000 1008ea10 physics_2009:dgCollisionConvexHull.obj
0002:00000a18 __real@43000000 1008ea18 physics_2009:dgCollisionConvexHull.obj
0002:00000a20 __real@3eb0c6f7a0000000 1008ea20 physics_2009:dgCollisionConvexHull.obj
0002:00000a28 __real@3fef5c2900000000 1008ea28 physics_2009:dgCollisionConvexHull.obj
0002:00000a30 ??_7dgUserConstraint@@6B@ 1008ea30 physics_2009:dgUserConstraint.obj
0002:00000a60 ??_7dgConstraint@@6B@ 1008ea60 physics_2009:dgBilateralConstraint.obj
0002:00000a88 ??_7dgBilateralConstraint@@6B@ 1008ea88 physics_2009:dgBilateralConstraint.obj
0002:00000ab8 __real@3b23d70a 1008eab8 physics_2009:dgBilateralConstraint.obj
0002:00000ac0 __real@4097700000000000 1008eac0 physics_2009:dgBilateralConstraint.obj
0002:00000ac8 __real@461c4000 1008eac8 physics_2009:dgBilateralConstraint.obj
0002:00000acc __real@c61c4000 1008eacc physics_2009:dgBilateralConstraint.obj
0002:00000ad0 __real@3fb33334 1008ead0 physics_2009:dgBilateralConstraint.obj
0002:00000ad8 __real@4079000000000000 1008ead8 physics_2009:dgBilateralConstraint.obj
0002:00000ae0 __real@4077700000000000 1008eae0 physics_2009:dgBilateralConstraint.obj
0002:00000ae8 ??_7dgCollisionSphere@@6B@ 1008eae8 physics_2009:dgCollisionSphere.obj
0002:00000b60 __real@3fd99999a0000000 1008eb60 physics_2009:dgCollisionSphere.obj
0002:00000b68 __real@4010c15200000000 1008eb68 physics_2009:dgCollisionSphere.obj
0002:00000b78 ??_7dgConvexCollision@@6B@ 1008eb78 physics_2009:dgConvexCollision.obj
0002:00000bec __real@44800000 1008ebec physics_2009:dgConvexCollision.obj
0002:00000bf0 __real@4070000000000000 1008ebf0 physics_2009:dgConvexCollision.obj
0002:00000bf8 __real@38d1b717 1008ebf8 physics_2009:dgConvexCollision.obj
0002:00000bfc __real@179abe15 1008ebfc physics_2009:dgConvexCollision.obj
0002:00000c00 __real@bf1a36e2e0000000 1008ec00 physics_2009:dgConvexCollision.obj
0002:00000c08 __real@3716feb5 1008ec08 physics_2009:dgConvexCollision.obj
0002:00000c0c __real@979abe15 1008ec0c physics_2009:dgConvexCollision.obj
0002:00000c10 __real@2b8cbccc 1008ec10 physics_2009:dgConvexCollision.obj
0002:00000c18 ??_7dgCollisionNull@@6B@ 1008ec18 physics_2009:dgCollisionNull.obj
0002:00000c8c ??_C@_07FLDMKAK@contact?$AA@ 1008ec8c physics_2009:dgContact.obj
0002:00000c94 __real@3f000000 1008ec94 physics_2009:dgContact.obj
0002:00000c98 __real@3f666666 1008ec98 physics_2009:dgContact.obj
0002:00000c9c __real@3ecccccd 1008ec9c physics_2009:dgContact.obj
0002:00000ca0 __real@3e99999a 1008eca0 physics_2009:dgContact.obj
0002:00000ca4 __real@c0800000 1008eca4 physics_2009:dgContact.obj
0002:00000ca8 __real@4049000000000000 1008eca8 physics_2009:dgContact.obj
0002:00000cb0 ??_7dgContact@@6B@ 1008ecb0 physics_2009:dgContact.obj
0002:00000cd8 ??_7dgCollisionConvexModifier@@6B@ 1008ecd8 physics_2009:dgCollisionConvexModifier.obj
0002:00000d50 __real@3fa99999a0000000 1008ed50 physics_2009:dgCollisionConvexModifier.obj
0002:00000d58 __real@ccbebc20 1008ed58 physics_2009:dgCollisionConvexModifier.obj
0002:00000d60 ??_7dgCompoundCollision@@6B@ 1008ed60 physics_2009:dgCompoundCollision.obj
0002:00000dc4 __real@9e3ce508 1008edc4 physics_2009:dgCompoundCollision.obj
0002:00000dc8 ??_7dgCollisionUserMesh@@6B@ 1008edc8 physics_2009:dgCollisionUserMesh.obj
0002:00000e38 ??_7dgCollisionHeightField@@6B@ 1008ee38 physics_2009:dgCollisionHeightField.obj
0002:00000ea4 __real@d368d4a5 1008eea4 physics_2009:dgCollisionHeightField.obj
0002:00000ea8 __real@3feb851ec0000000 1008eea8 physics_2009:dgMinkowskiConv.obj
0002:00000eb0 __real@2edbe6ff 1008eeb0 physics_2009:dgMinkowskiConv.obj
0002:00000eb8 __real@4415af1d80000000 1008eeb8 physics_2009:dgMinkowskiConv.obj
0002:00000ec0 __real@3fa1de6660000000 1008eec0 physics_2009:dgMinkowskiConv.obj
0002:00000ec8 __real@3feffb00c0000000 1008eec8 physics_2009:dgMinkowskiConv.obj
0002:00000ed0 __real@3fe6a09e60000000 1008eed0 physics_2009:dgMinkowskiConv.obj
0002:00000ed8 __real@3fa1de58c0000000 1008eed8 physics_2009:dgMinkowskiConv.obj
0002:00000ee0 __real@3feffb0280000000 1008eee0 physics_2009:dgMinkowskiConv.obj
0002:00000ee8 __real@3a03126f 1008eee8 physics_2009:dgMinkowskiConv.obj
0002:00000eec __real@3089705f 1008eeec physics_2009:dgMinkowskiConv.obj
0002:00000ef0 __real@4202a05f20000000 1008eef0 physics_2009:dgMinkowskiConv.obj
0002:00000ef8 __real@3f40624de0000000 1008eef8 physics_2009:dgMinkowskiConv.obj
0002:00000f00 __real@3e112e0be0000000 1008ef00 physics_2009:dgMinkowskiConv.obj
0002:00000f08 __real@3f1a36e300000000 1008ef08 physics_2009:dgMinkowskiConv.obj
0002:00000f10 __real@3eb0c6f7c0000000 1008ef10 physics_2009:dgMinkowskiConv.obj
0002:00000f18 __real@3b000000 1008ef18 physics_2009:dgMinkowskiConv.obj
0002:00000f1c __real@3c000000 1008ef1c physics_2009:dgMinkowskiConv.obj
0002:00000f20 __real@3f60000000000000 1008ef20 physics_2009:dgMinkowskiConv.obj
0002:00000f28 __real@bf13cd36 1008ef28 physics_2009:dgMinkowskiConv.obj
0002:00000f2c __real@3f13cd36 1008ef2c physics_2009:dgMinkowskiConv.obj
0002:00000f30 __real@3fefef9dc0000000 1008ef30 physics_2009:dgMinkowskiConv.obj
0002:00000f38 __real@3f70000000000000 1008ef38 physics_2009:dgMinkowskiConv.obj
0002:00000f40 __real@3b800000 1008ef40 physics_2009:dgMinkowskiConv.obj
0002:00000f44 __real@3a000000 1008ef44 physics_2009:dgMinkowskiConv.obj
0002:00000f48 __real@4040000000000000 1008ef48 physics_2009:dgMinkowskiConv.obj
0002:00000f50 __real@3ee4f8b580000000 1008ef50 physics_2009:dgMinkowskiConv.obj
0002:00000f58 __real@3fb0000000000000 1008ef58 physics_2009:dgMinkowskiConv.obj
0002:00000f60 ??_7dgCollisionBox@@6B@ 1008ef60 physics_2009:dgCollisionBox.obj
0002:00000fd8 __real@3fd5555560000000 1008efd8 physics_2009:dgCollisionBox.obj
0002:00000fe0 __real@4020000000000000 1008efe0 physics_2009:dgCollisionBox.obj
0002:00000fe8 ??_7dgCollision@@6B@ 1008efe8 physics_2009:dgCollision.obj
0002:00001050 __real@4090000000000000 1008f050 physics_2009:dgCollision.obj
0002:00001058 ??_7dgCollisionEllipse@@6B@ 1008f058 physics_2009:dgCollisionEllipse.obj
0002:000010d0 ??_7dgCollisionCapsule@@6B@ 1008f0d0 physics_2009:dgCollisionCapsule.obj
0002:00001148 __real@4018000000000000 1008f148 physics_2009:dgCollisionCapsule.obj
0002:00001150 __real@4010dca360000000 1008f150 physics_2009:dgCollisionCapsule.obj
0002:00001158 __real@40194af500000000 1008f158 physics_2009:dgCollisionCapsule.obj
0002:00001160 __real@bfe0000000000000 1008f160 physics_2009:dgCollisionCapsule.obj
0002:00001170 ??_7dgCollisionCone@@6B@ 1008f170 physics_2009:dgCollisionCone.obj
0002:000011e8 __real@4038000000000000 1008f1e8 physics_2009:dgCollisionCone.obj
0002:000011f0 __real@3fc3333340000000 1008f1f0 physics_2009:dgCollisionCone.obj
0002:000011f8 __real@3fd3333340000000 1008f1f8 physics_2009:dgCollisionCone.obj
0002:00001200 __real@4000dca360000000 1008f200 physics_2009:dgCollisionCone.obj
0002:00001210 ??_7dgCollisionCylinder@@6B@ 1008f210 physics_2009:dgCollisionCylinder.obj
0002:00001288 ??_7dgCollisionChamferCylinder@@6B@ 1008f288 physics_2009:dgCollisionChamferCylinder.obj
0002:00001300 __real@3fe921fa00000000 1008f300 physics_2009:dgCollisionChamferCylinder.obj
0002:00001308 __real@3fd0c15160000000 1008f308 physics_2009:dgCollisionChamferCylinder.obj
0002:00001310 __real@3c32725de0000000 1008f310 physics_2009:dgCollisionChamferCylinder.obj
0002:00001328 __real@bfefff9720000000 1008f328 corelib_2009:dgMatrix.obj
0002:00001330 __real@3f7fffef 1008f330 corelib_2009:dgMatrix.obj
0002:00001338 __real@3feffffde0000000 1008f338 corelib_2009:dgMatrix.obj
0002:00001340 __real@bf7fffef 1008f340 corelib_2009:dgMatrix.obj
0002:00001348 __real@bfeffffde0000000 1008f348 corelib_2009:dgMatrix.obj
0002:00001350 __real@3f1a36e2eb1c432d 1008f350 corelib_2009:dgTypes.obj
0002:00001360 __real@3d71979980000000 1008f360 corelib_2009:dgPolyhedra.obj
0002:00001368 __real@3fe69fbe80000000 1008f368 corelib_2009:dgPolyhedra.obj
0002:00001370 __real@bfecccccc0000000 1008f370 corelib_2009:dgPolyhedra.obj
0002:00001378 ??_7dgPolyhedra@@6B@ 1008f378 corelib_2009:dgPolyhedra.obj
0002:0000137c ??_7dgPolygonSoupDatabase@@6B@ 1008f37c corelib_2009:dgAABBPolygonSoup.obj
0002:0000139c ??_7dgAABBPolygonSoup@@6B@ 1008f39c corelib_2009:dgAABBPolygonSoup.obj
0002:000013c0 ??_7dgPolySoupFilterAllocator@@6B@ 1008f3c0 corelib_2009:dgPolygonSoupBuilder.obj
0002:000013c8 __real@3bc79ca100000000 1008f3c8 corelib_2009:dgPolygonSoupBuilder.obj
0002:000013d0 __real@3fb5555560000000 1008f3d0 corelib_2009:dgPolygonSoupBuilder.obj
0002:00001428 __FPinit 1008f428 LIBCMT:_fpinit_.obj
0002:0000142c __FPmtinit 1008f42c LIBCMT:_fpinit_.obj
0002:00001430 __FPmtterm 1008f430 LIBCMT:_fpinit_.obj
0002:00001434 __pDefaultRawDllMain 1008f434 LIBCMT:dllcrt0.obj
0002:00001434 __pRawDllMain 1008f434 LIBCMT:dllcrt0.obj
0002:000014a0 ??_C@_03IIINPABG@tan?$AA@ 1008f4a0 LIBCMT:_libm_error_.obj
0002:000014a4 ??_C@_03LALBNOCG@cos?$AA@ 1008f4a4 LIBCMT:_libm_error_.obj
0002:000014a8 ??_C@_03BLEJJJBH@sin?$AA@ 1008f4a8 LIBCMT:_libm_error_.obj
0002:000014ac ??_C@_04EHEDPDJG@modf?$AA@ 1008f4ac LIBCMT:_libm_error_.obj
0002:000014b4 ??_C@_05PBJFFIGL@floor?$AA@ 1008f4b4 LIBCMT:_libm_error_.obj
0002:000014bc ??_C@_04GFPJNGEK@ceil?$AA@ 1008f4bc LIBCMT:_libm_error_.obj
0002:000014c4 ??_C@_04MLLJIGOK@atan?$AA@ 1008f4c4 LIBCMT:_libm_error_.obj
0002:000014cc ??_C@_05EOHGHCHD@exp10?$AA@ 1008f4cc LIBCMT:_libm_error_.obj
0002:000014d4 ??_C@_04PDIFKINK@acos?$AA@ 1008f4d4 LIBCMT:_libm_error_.obj
0002:000014dc ??_C@_04FIHNOPOL@asin?$AA@ 1008f4dc LIBCMT:_libm_error_.obj
0002:000014e4 ??_C@_03MGHMBJCF@log?$AA@ 1008f4e4 LIBCMT:_libm_error_.obj
0002:000014e8 ??_C@_05HGHHAHAP@log10?$AA@ 1008f4e8 LIBCMT:_libm_error_.obj
0002:000014f0 ??_C@_03KHJOGHMM@exp?$AA@ 1008f4f0 LIBCMT:_libm_error_.obj
0002:000014f4 ??_C@_03JGHBODFD@pow?$AA@ 1008f4f4 LIBCMT:_libm_error_.obj
0002:000014f8 ??_C@_05KLBDPFGC@e?$CL000?$AA@ 1008f4f8 LIBCMT:cvt.obj
0002:00001500 __real@4150017ec0000000 1008f500 LIBCMT:_testfdiv_.obj
0002:00001508 __real@4147ffff80000000 1008f508 LIBCMT:_testfdiv_.obj
0002:00001510 ??_C@_0BK@NHEOCAHP@IsProcessorFeaturePresent?$AA@ 1008f510 LIBCMT:_testfdiv_.obj
0002:0000152c ??_C@_08CPNIBGIE@KERNEL32?$AA@ 1008f52c LIBCMT:_testfdiv_.obj
0002:00001538 ??_C@_0P@MIGLKIOC@CorExitProcess?$AA@ 1008f538 LIBCMT:crt0dat.obj
0002:00001548 ??_C@_1BI@BGOHAHKC@?$AAm?$AAs?$AAc?$AAo?$AAr?$AAe?$AAe?$AA?4?$AAd?$AAl?$AAl?$AA?$AA@ 1008f548 LIBCMT:crt0dat.obj
0002:00001560 ??_C@_0P@GGKDKEEG@runtime?5error?5?$AA@ 1008f560 LIBCMT:crt0msg.obj
0002:00001570 ??_C@_02PCIJFNDE@?$AN?6?$AA@ 1008f570 LIBCMT:crt0msg.obj
0002:00001574 ??_C@_0O@MJNIPGOH@TLOSS?5error?$AN?6?$AA@ 1008f574 LIBCMT:crt0msg.obj
0002:00001584 ??_C@_0N@BONNPDHF@SING?5error?$AN?6?$AA@ 1008f584 LIBCMT:crt0msg.obj
0002:00001594 ??_C@_0P@MBDAJNE@DOMAIN?5error?$AN?6?$AA@ 1008f594 LIBCMT:crt0msg.obj
0002:000015a8 ??_C@_0JL@DFDOOABL@R6034?$AN?6An?5application?5has?5made?5a@ 1008f5a8 LIBCMT:crt0msg.obj
0002:00001648 ??_C@_0PH@EPAFIJ@R6033?$AN?6?9?5Attempt?5to?5use?5MSIL?5cod@ 1008f648 LIBCMT:crt0msg.obj
0002:00001740 ??_C@_0DD@BKEEABMM@R6032?$AN?6?9?5not?5enough?5space?5for?5lo@ 1008f740 LIBCMT:crt0msg.obj
0002:00001778 ??_C@_0GD@OFKILIED@R6031?$AN?6?9?5Attempt?5to?5initialize?5t@ 1008f778 LIBCMT:crt0msg.obj
0002:000017dc ??_C@_0BP@LPMHJOKI@R6030?$AN?6?9?5CRT?5not?5initialized?$AN?6?$AA@ 1008f7dc LIBCMT:crt0msg.obj
0002:000017fc ??_C@_0CF@KJDAIALP@R6028?$AN?6?9?5unable?5to?5initialize?5he@ 1008f7fc LIBCMT:crt0msg.obj
0002:00001824 ??_C@_0DF@GAKBPDFP@R6027?$AN?6?9?5not?5enough?5space?5for?5lo@ 1008f824 LIBCMT:crt0msg.obj
0002:0000185c ??_C@_0DF@IBLNNAIG@R6026?$AN?6?9?5not?5enough?5space?5for?5st@ 1008f85c LIBCMT:crt0msg.obj
0002:00001894 ??_C@_0CG@IOHKGFNJ@R6025?$AN?6?9?5pure?5virtual?5function?5c@ 1008f894 LIBCMT:crt0msg.obj
0002:000018bc ??_C@_0DF@JIJJFJDC@R6024?$AN?6?9?5not?5enough?5space?5for?5_o@ 1008f8bc LIBCMT:crt0msg.obj
0002:000018f4 ??_C@_0CJ@EGEJHFME@R6019?$AN?6?9?5unable?5to?5open?5console?5@ 1008f8f4 LIBCMT:crt0msg.obj
0002:00001920 ??_C@_0CB@GNHNIELH@R6018?$AN?6?9?5unexpected?5heap?5error?$AN?6@ 1008f920 LIBCMT:crt0msg.obj
0002:00001944 ??_C@_0CN@FOLDKNG@R6017?$AN?6?9?5unexpected?5multithread?5@ 1008f944 LIBCMT:crt0msg.obj
0002:00001974 ??_C@_0CM@FAHFJNHO@R6016?$AN?6?9?5not?5enough?5space?5for?5th@ 1008f974 LIBCMT:crt0msg.obj
0002:000019a0 ??_C@_0JG@LBKMGKLD@?$AN?6This?5application?5has?5requested@ 1008f9a0 LIBCMT:crt0msg.obj
0002:00001a38 ??_C@_0CM@FLCNIPKK@R6009?$AN?6?9?5not?5enough?5space?5for?5en@ 1008fa38 LIBCMT:crt0msg.obj
0002:00001a64 ??_C@_0CK@KMMJOAPP@R6008?$AN?6?9?5not?5enough?5space?5for?5ar@ 1008fa64 LIBCMT:crt0msg.obj
0002:00001a90 ??_C@_0CN@LEKKICBM@R6002?$AN?6?9?5floating?5point?5support?5@ 1008fa90 LIBCMT:crt0msg.obj
0002:00001ac0 ??_C@_0CF@GOGNBNAK@Microsoft?5Visual?5C?$CL?$CL?5Runtime?5Lib@ 1008fac0 LIBCMT:crt0msg.obj
0002:00001ae8 ??_C@_02PHMGELLB@?6?6?$AA@ 1008fae8 LIBCMT:crt0msg.obj
0002:00001aec ??_C@_03KHICJKCI@?4?4?4?$AA@ 1008faec LIBCMT:crt0msg.obj
0002:00001af0 ??_C@_0BH@DNAGHKFM@?$DMprogram?5name?5unknown?$DO?$AA@ 1008faf0 LIBCMT:crt0msg.obj
0002:00001b08 ??_C@_0BK@OFGJDLJJ@Runtime?5Error?$CB?6?6Program?3?5?$AA@ 1008fb08 LIBCMT:crt0msg.obj
0002:00001b24 ??_C@_0O@NLDKAIKN@EncodePointer?$AA@ 1008fb24 LIBCMT:tidtable.obj
0002:00001b34 ??_C@_1BK@DBDEIDLH@?$AAK?$AAE?$AAR?$AAN?$AAE?$AAL?$AA3?$AA2?$AA?4?$AAD?$AAL?$AAL?$AA?$AA@ 1008fb34 LIBCMT:tidtable.obj
0002:00001b50 ??_C@_0O@KBPMFGHI@DecodePointer?$AA@ 1008fb50 LIBCMT:tidtable.obj
0002:00001b60 ??_C@_07PEJMOBNF@FlsFree?$AA@ 1008fb60 LIBCMT:tidtable.obj
0002:00001b68 ??_C@_0M@JCPCPOEF@FlsSetValue?$AA@ 1008fb68 LIBCMT:tidtable.obj
0002:00001b74 ??_C@_0M@GDNOONDI@FlsGetValue?$AA@ 1008fb74 LIBCMT:tidtable.obj
0002:00001b80 ??_C@_08KNHFBNJ@FlsAlloc?$AA@ 1008fb80 LIBCMT:tidtable.obj
0002:00001b90 __XcptActTab 1008fb90 LIBCMT:winxfltr.obj
0002:00001c08 ??_C@_1O@CEDCILHN@?$AA?$CI?$AAn?$AAu?$AAl?$AAl?$AA?$CJ?$AA?$AA@ 1008fc08 LIBCMT:output.obj
0002:00001c18 ??_C@_06OJHGLDPL@?$CInull?$CJ?$AA@ 1008fc18 LIBCMT:output.obj
0002:00001c20 ___lookuptable 1008fc20 LIBCMT:output.obj
0002:00002588 __DEFAULT_CW_in_mem 10090588 LIBCMT:_common_.obj
0002:0000258a __pi_by_2_to_61 1009058a LIBCMT:_common_.obj
0002:00005f10 ??_C@_0L@KDOEJCKC@_nextafter?$AA@ 10093f10 LIBCMT:_fpexcept_.obj
0002:00005f1c ??_C@_05JGDBENOH@_logb?$AA@ 10093f1c LIBCMT:_fpexcept_.obj
0002:00005f24 ??_C@_03ONILCKOB@_yn?$AA@ 10093f24 LIBCMT:_fpexcept_.obj
0002:00005f28 ??_C@_03NAKIGLHK@_y1?$AA@ 10093f28 LIBCMT:_fpexcept_.obj
0002:00005f2c ??_C@_03MJLDFKDL@_y0?$AA@ 10093f2c LIBCMT:_fpexcept_.obj
0002:00005f30 ??_C@_05GKKHEGJL@frexp?$AA@ 10093f30 LIBCMT:_fpexcept_.obj
0002:00005f38 ??_C@_04KEPJIHGP@fmod?$AA@ 10093f38 LIBCMT:_fpexcept_.obj
0002:00005f40 ??_C@_06MEIMCGCF@_hypot?$AA@ 10093f40 LIBCMT:_fpexcept_.obj
0002:00005f48 ??_C@_05KBKMEMPO@_cabs?$AA@ 10093f48 LIBCMT:_fpexcept_.obj
0002:00005f50 ??_C@_05CEJMAHNP@ldexp?$AA@ 10093f50 LIBCMT:_fpexcept_.obj
0002:00005f58 ??_C@_04ODHECPBC@fabs?$AA@ 10093f58 LIBCMT:_fpexcept_.obj
0002:00005f60 ??_C@_04EIAKFFMI@sqrt?$AA@ 10093f60 LIBCMT:_fpexcept_.obj
0002:00005f68 ??_C@_05KNGEOGJB@atan2?$AA@ 10093f68 LIBCMT:_fpexcept_.obj
0002:00005f70 ??_C@_04FJHINJAO@tanh?$AA@ 10093f70 LIBCMT:_fpexcept_.obj
0002:00005f78 ??_C@_04HPJJNFIM@cosh?$AA@ 10093f78 LIBCMT:_fpexcept_.obj
0002:00005f80 ??_C@_04COOMCNPB@sinh?$AA@ 10093f80 LIBCMT:_fpexcept_.obj
0002:00006008 ??_C@_0BI@DFKBFLJE@GetProcessWindowStation?$AA@ 10094008 LIBCMT:crtmbox.obj
0002:00006020 ??_C@_0BK@CIDNPOGP@GetUserObjectInformationA?$AA@ 10094020 LIBCMT:crtmbox.obj
0002:0000603c ??_C@_0BD@HHGDFDBJ@GetLastActivePopup?$AA@ 1009403c LIBCMT:crtmbox.obj
0002:00006050 ??_C@_0BA@HNOPNCHB@GetActiveWindow?$AA@ 10094050 LIBCMT:crtmbox.obj
0002:00006060 ??_C@_0M@CHKKJDAI@MessageBoxA?$AA@ 10094060 LIBCMT:crtmbox.obj
0002:0000606c ??_C@_0L@NDEGIDAG@USER32?4DLL?$AA@ 1009406c LIBCMT:crtmbox.obj
0002:00006078 ___lookuptable_s 10094078 LIBCMT:outputs.obj
0002:000060d4 __real@00000000 100940d4 Newton.obj
0002:000060d4 ??_C@_13NOLLCAOD@?$AA?$AA?$AA?$AA@ 100940d4 LIBCMT:a_map.obj
0002:000060d8 ___newctype 100940d8 LIBCMT:ctype.obj
0002:000063d8 __wctype 100943d8 LIBCMT:ctype.obj
0002:000065e0 ___newclmap 100945e0 LIBCMT:ctype.obj
0002:00006760 ___newcumap 10094760 LIBCMT:ctype.obj
0002:000068e0 ??_C@_08JCCMCCIL@HH?3mm?3ss?$AA@ 100948e0 LIBCMT:strftime.obj
0002:000068ec ??_C@_0BE@CKGJFCPC@dddd?0?5MMMM?5dd?0?5yyyy?$AA@ 100948ec LIBCMT:strftime.obj
0002:00006900 ??_C@_08BPBNCDIB@MM?1dd?1yy?$AA@ 10094900 LIBCMT:strftime.obj
0002:0000690c ??_C@_02CJNFDJBF@PM?$AA@ 1009490c LIBCMT:strftime.obj
0002:00006910 ??_C@_02DEDBPAFC@AM?$AA@ 10094910 LIBCMT:strftime.obj
0002:00006914 ??_C@_08EDHMEBNP@December?$AA@ 10094914 LIBCMT:strftime.obj
0002:00006920 ??_C@_08HCHEGEOA@November?$AA@ 10094920 LIBCMT:strftime.obj
0002:0000692c ??_C@_07JJNFCEND@October?$AA@ 1009492c LIBCMT:strftime.obj
0002:00006934 ??_C@_09BHHEALKD@September?$AA@ 10094934 LIBCMT:strftime.obj
0002:00006940 ??_C@_06LBBHFDDG@August?$AA@ 10094940 LIBCMT:strftime.obj
0002:00006948 ??_C@_04MIEPOIFP@July?$AA@ 10094948 LIBCMT:strftime.obj
0002:00006950 ??_C@_04CNLMGBGM@June?$AA@ 10094950 LIBCMT:strftime.obj
0002:00006958 ??_C@_05DMJDNLEJ@April?$AA@ 10094958 LIBCMT:strftime.obj
0002:00006960 ??_C@_05HPCKOFNC@March?$AA@ 10094960 LIBCMT:strftime.obj
0002:00006968 ??_C@_08GNJGEPFN@February?$AA@ 10094968 LIBCMT:strftime.obj
0002:00006974 ??_C@_07CGJPFGJA@January?$AA@ 10094974 LIBCMT:strftime.obj
0002:0000697c ??_C@_03MKABNOCG@Dec?$AA@ 1009497c LIBCMT:strftime.obj
0002:00006980 ??_C@_03JPJOFNIA@Nov?$AA@ 10094980 LIBCMT:strftime.obj
0002:00006984 ??_C@_03BMAOKBAD@Oct?$AA@ 10094984 LIBCMT:strftime.obj
0002:00006988 ??_C@_03GGCAPAJC@Sep?$AA@ 10094988 LIBCMT:strftime.obj
0002:0000698c ??_C@_03IFJFEIGA@Aug?$AA@ 1009498c LIBCMT:strftime.obj
0002:00006990 ??_C@_03LBGABGKK@Jul?$AA@ 10094990 LIBCMT:strftime.obj
0002:00006994 ??_C@_03IDFGHECI@Jun?$AA@ 10094994 LIBCMT:strftime.obj
0002:00006998 ??_C@_03CNMDKL@May?$AA@ 10094998 LIBCMT:strftime.obj
0002:0000699c ??_C@_03LEOLGMJP@Apr?$AA@ 1009499c LIBCMT:strftime.obj
0002:000069a0 ??_C@_03ODNJBKGA@Mar?$AA@ 100949a0 LIBCMT:strftime.obj
0002:000069a4 ??_C@_03HJBDCHOM@Feb?$AA@ 100949a4 LIBCMT:strftime.obj
0002:000069a8 ??_C@_03JIHJHPIE@Jan?$AA@ 100949a8 LIBCMT:strftime.obj
0002:000069ac ??_C@_08INBOOONO@Saturday?$AA@ 100949ac LIBCMT:strftime.obj
0002:000069b8 ??_C@_06JECMNKMI@Friday?$AA@ 100949b8 LIBCMT:strftime.obj
0002:000069c0 ??_C@_08HACCIKIA@Thursday?$AA@ 100949c0 LIBCMT:strftime.obj
0002:000069cc ??_C@_09DLIGFAKA@Wednesday?$AA@ 100949cc LIBCMT:strftime.obj
0002:000069d8 ??_C@_07BAAGCFCM@Tuesday?$AA@ 100949d8 LIBCMT:strftime.obj
0002:000069e0 ??_C@_06JLEDEDGH@Monday?$AA@ 100949e0 LIBCMT:strftime.obj
0002:000069e8 ??_C@_06OOPIFAJ@Sunday?$AA@ 100949e8 LIBCMT:strftime.obj
0002:000069f0 ??_C@_03FEFJNEK@Sat?$AA@ 100949f0 LIBCMT:strftime.obj
0002:000069f4 ??_C@_03IDIOELNC@Fri?$AA@ 100949f4 LIBCMT:strftime.obj
0002:000069f8 ??_C@_03IOFIKPDN@Thu?$AA@ 100949f8 LIBCMT:strftime.obj
0002:000069fc ??_C@_03MHOMLAJA@Wed?$AA@ 100949fc LIBCMT:strftime.obj
0002:00006a00 ??_C@_03NAGEINEP@Tue?$AA@ 10094a00 LIBCMT:strftime.obj
0002:00006a04 ??_C@_03PDAGKDH@Mon?$AA@ 10094a04 LIBCMT:strftime.obj
0002:00006a08 ??_C@_03KOEHGMDN@Sun?$AA@ 10094a08 LIBCMT:strftime.obj
0002:00006a0c ??_C@_06IMKFLFPG@1?$CDQNAN?$AA@ 10094a0c LIBCMT:_x10fout_.obj
0002:00006a14 ??_C@_05DNEBIAHO@1?$CDINF?$AA@ 10094a14 LIBCMT:_x10fout_.obj
0002:00006a1c ??_C@_05PHHOCPM@1?$CDIND?$AA@ 10094a1c LIBCMT:_x10fout_.obj
0002:00006a24 ??_C@_06PGGFOGJG@1?$CDSNAN?$AA@ 10094a24 LIBCMT:_x10fout_.obj
0002:00006a34 ___dnames 10094a34 LIBCMT:timeset.obj
0002:00006a4c ___mnames 10094a4c LIBCMT:timeset.obj
0002:00006a74 ??_C@_07GPDNMNG@CONOUT$?$AA@ 10094a74 LIBCMT:initcon.obj
0002:00006a80 __load_config_used 10094a80 LIBCMT:loadcfg.obj
0002:00006b20 ___safe_se_handler_table 10094b20 <linker-defined>
0002:00006b30 ___rtc_iaa 10094b30 LIBCMT:_initsect_.obj
0002:00006b34 ___rtc_izz 10094b34 LIBCMT:_initsect_.obj
0002:00006b38 ___rtc_taa 10094b38 LIBCMT:_initsect_.obj
0002:00006b3c ___rtc_tzz 10094b3c LIBCMT:_initsect_.obj
0002:00006f44 __IMPORT_DESCRIPTOR_KERNEL32 10094f44 kernel32:KERNEL32.dll
0002:00006f58 __NULL_IMPORT_DESCRIPTOR 10094f58 kernel32:KERNEL32.dll
0003:00000020 ?m_rayCastSimplex@dgConvexCollision@@1PAY03HA 10098020 physics_2009:dgConvexCollision.obj
0003:00000060 ?m_hullDirs@dgConvexCollision@@1PAVdgTriplex@@A 10098060 physics_2009:dgConvexCollision.obj
0003:00000108 ?mult@dgConvexMassData@@2PAMA 10098108 physics_2009:dgConvexCollision.obj
0003:00000140 ?m_negOne@dgConvexCollision@@1VdgVector@@A 10098140 physics_2009:dgConvexCollision.obj
0003:00000150 ?m_nrh0p5@dgConvexCollision@@1VdgVector@@A 10098150 physics_2009:dgConvexCollision.obj
0003:00000160 ?m_nrh3p0@dgConvexCollision@@1VdgVector@@A 10098160 physics_2009:dgConvexCollision.obj
0003:00000170 ?m_indexStep@dgConvexCollision@@1VdgVector@@A 10098170 physics_2009:dgConvexCollision.obj
0003:00000180 ?m_index_0123@dgConvexCollision@@1VdgVector@@A 10098180 physics_2009:dgConvexCollision.obj
0003:00000190 ?m_index_4567@dgConvexCollision@@1VdgVector@@A 10098190 physics_2009:dgConvexCollision.obj
0003:000001a0 ?m_huge@dgConvexCollision@@1VdgVector@@A 100981a0 physics_2009:dgConvexCollision.obj
0003:000001b0 ?m_negativeTiny@dgConvexCollision@@1VdgVector@@A 100981b0 physics_2009:dgConvexCollision.obj
0003:000001c0 ?m_aabb_padd@dgConvexCollision@@1VdgVector@@A 100981c0 physics_2009:dgConvexCollision.obj
0003:000001d0 ?m_faceIndex@dgContactSolver@@2PAY03HA 100981d0 physics_2009:dgMinkowskiConv.obj
0003:00000210 ?m_edgeArray@dgCollisionBox@@1PAVdgConvexSimplexEdge@@A 10098210 physics_2009:dgCollisionBox.obj
0003:000003a0 ?g_allocaror@dgInternalMemory@@3VdgMemoryAllocator@@A 100983a0 corelib_2009:dgMemory.obj
0003:000008d0 __fltused 100988d0 LIBCMT:_fpinit_.obj
0003:000008d4 __ldused 100988d4 LIBCMT:_fpinit_.obj
0003:000008f0 __half 100988f0 LIBCMT:_pow_.obj
0003:00000914 __cfltcvt_tab 10098914 LIBCMT:cmiscdat.obj
0003:00000a60 __amblksiz 10098a60 LIBCMT:heapinit.obj
0003:00000a64 __aexit_rtn 10098a64 LIBCMT:crt0dat.obj
0003:00000c90 ___flsindex 10098c90 LIBCMT:tidtable.obj
0003:00000c94 ___getvalueindex 10098c94 LIBCMT:tidtable.obj
0003:00000c98 ___badioinfo 10098c98 LIBCMT:ioinit.obj
0003:00000cd8 __First_FPE_Indx 10098cd8 LIBCMT:winxfltr.obj
0003:00000cdc __Num_FPE 10098cdc LIBCMT:winxfltr.obj
0003:00000ce0 __XcptActTabSize 10098ce0 LIBCMT:winxfltr.obj
0003:00000ce4 __XcptActTabCount 10098ce4 LIBCMT:winxfltr.obj
0003:00000ce8 ___nullstring 10098ce8 LIBCMT:output.obj
0003:00000cec ___wnullstring 10098cec LIBCMT:output.obj
0003:00000d0c ___abort_behavior 10098d0c LIBCMT:abort.obj
0003:00000d10 __infinity 10098d10 LIBCMT:_87tran_.obj
0003:00000d1a __minfinity 10098d1a LIBCMT:_87tran_.obj
0003:00000d24 __logemax 10098d24 LIBCMT:_87tran_.obj
0003:00000d4a __OP_EXPjmptab 10098d4a LIBCMT:_87tran_.obj
0003:00000d70 __indefinite 10098d70 LIBCMT:_87disp_.obj
0003:00000d7a __piby2 10098d7a LIBCMT:_87disp_.obj
0003:00000da0 __NLG_Destination 10098da0 LIBCMT:exsup.obj
0003:00000db0 __matherr_flag 10098db0 LIBCMT:_matherr_.obj
0003:00000ea0 __d_inf 10098ea0 LIBCMT:_util_.obj
0003:00000ea8 __d_ind 10098ea8 LIBCMT:_util_.obj
0003:00000eb0 __d_max 10098eb0 LIBCMT:_util_.obj
0003:00000eb8 __d_min 10098eb8 LIBCMT:_util_.obj
0003:00000ec0 __d_mzero 10098ec0 LIBCMT:_util_.obj
0003:00000ed0 ___initialmbcinfo 10098ed0 LIBCMT:mbctype.obj
0003:000010f0 __mbctype 100990f0 LIBCMT:mbctype.obj
0003:000011f8 __mbcasemap 100991f8 LIBCMT:mbctype.obj
0003:000012f8 ___ptmbcinfo 100992f8 LIBCMT:mbctype.obj
0003:000013f4 ___globallocalestatus 100993f4 LIBCMT:glstatus.obj
0003:000013f8 ___clocalestr 100993f8 LIBCMT:nlsdata2.obj
0003:00001400 ___initiallocinfo 10099400 LIBCMT:nlsdata2.obj
0003:000014d8 ___ptlocinfo 100994d8 LIBCMT:nlsdata2.obj
0003:000014dc ___lc_clike 100994dc LIBCMT:nlsdata2.obj
0003:000014e0 ___initiallocalestructinfo 100994e0 LIBCMT:nlsdata2.obj
0003:000014f0 ___security_cookie 100994f0 LIBCMT:gs_cookie.obj
0003:000014f4 ___security_cookie_complement 100994f4 LIBCMT:gs_cookie.obj
0003:00001500 __iob 10099500 LIBCMT:_file.obj
0003:000018e0 __pctype 100998e0 LIBCMT:ctype.obj
0003:000018e4 __pwctype 100998e4 LIBCMT:ctype.obj
0003:000018e8 ___lc_time_c 100998e8 LIBCMT:strftime.obj
0003:000019a0 ___lc_time_curr 100999a0 LIBCMT:strftime.obj
0003:000019a4 ___lconv_static_decimal 100999a4 LIBCMT:lconv.obj
0003:000019a8 ___lconv_c 100999a8 LIBCMT:lconv.obj
0003:000019d8 ___lconv 100999d8 LIBCMT:lconv.obj
0003:000019dc ___mb_cur_max 100999dc LIBCMT:nlsdata1.obj
0003:000019e0 ___decimal_point 100999e0 LIBCMT:nlsdata1.obj
0003:000019e4 ___decimal_point_length 100999e4 LIBCMT:nlsdata1.obj
0003:00001a30 __timezone 10099a30 LIBCMT:timeset.obj
0003:00001a34 __daylight 10099a34 LIBCMT:timeset.obj
0003:00001a38 __dstbias 10099a38 LIBCMT:timeset.obj
0003:00001ac0 __tzname 10099ac0 LIBCMT:timeset.obj
0003:00001ae0 __pow10pos 10099ae0 LIBCMT:_constpow_.obj
0003:00001c40 __pow10neg 10099c40 LIBCMT:_constpow_.obj
0003:00001d9c __coninpfh 10099d9c LIBCMT:initcon.obj
0003:00001da0 __confh 10099da0 LIBCMT:initcon.obj
0003:00001da4 __lpdays 10099da4 LIBCMT:days.obj
0003:00001dd8 __days 10099dd8 LIBCMT:days.obj
0003:00001e30 ?m_edgeArray@dgCollisionSphere@@1PAVdgConvexSimplexEdge@@A 10099e30 physics_2009:dgCollisionSphere.obj
0003:00002430 ?m_shapeRefCount@dgCollisionSphere@@1HA 1009a430 physics_2009:dgCollisionSphere.obj
0003:00002440 ?m_unitSphere@dgCollisionSphere@@1PAVdgVector@@A 1009a440 physics_2009:dgCollisionSphere.obj
0003:00002560 ?m_iniliazised@dgConvexCollision@@1HA 1009a560 physics_2009:dgConvexCollision.obj
0003:00002570 ?m_zero@dgConvexCollision@@1VdgVector@@A 1009a570 physics_2009:dgConvexCollision.obj
0003:00002580 ?m_signMask@dgConvexCollision@@1VdgVector@@A 1009a580 physics_2009:dgConvexCollision.obj
0003:00002590 ?m_triplexMask@dgConvexCollision@@1VdgVector@@A 1009a590 physics_2009:dgConvexCollision.obj
0003:000025a0 ?m_multiResDir@dgConvexCollision@@1PAVdgVector@@A 1009a5a0 physics_2009:dgConvexCollision.obj
0003:00002620 ?m_multiResDir_sse@dgConvexCollision@@1PAVdgVector@@A 1009a620 physics_2009:dgConvexCollision.obj
0003:00002680 ?m_vertex@dgCollisionHeightField@@0PAPAVdgVector@@A 1009a680 physics_2009:dgCollisionHeightField.obj
0003:000026a0 ?m_vertexCount@dgCollisionHeightField@@0PAHA 1009a6a0 physics_2009:dgCollisionHeightField.obj
0003:000026c0 ?m_refCount@dgCollisionHeightField@@0HA 1009a6c0 physics_2009:dgCollisionHeightField.obj
0003:000026d0 ?m_negIndex@dgContactSolver@@2T__m128@@A 1009a6d0 physics_2009:dgMinkowskiConv.obj
0003:000026e0 ?m_zero@dgContactSolver@@2T__m128@@A 1009a6e0 physics_2009:dgMinkowskiConv.obj
0003:000026f0 ?m_index_yx@dgContactSolver@@2T__m128@@A 1009a6f0 physics_2009:dgMinkowskiConv.obj
0003:00002700 ?m_index_wz@dgContactSolver@@2T__m128@@A 1009a700 physics_2009:dgMinkowskiConv.obj
0003:00002710 ?m_zeroTolerenace@dgContactSolver@@2T__m128@@A 1009a710 physics_2009:dgMinkowskiConv.obj
0003:00002720 ?m_nrh0p5@dgContactSolver@@2T__m128@@A 1009a720 physics_2009:dgMinkowskiConv.obj
0003:00002730 ?m_nrh3p0@dgContactSolver@@2T__m128@@A 1009a730 physics_2009:dgMinkowskiConv.obj
0003:00002740 ?m_negativeOne@dgContactSolver@@2T__m128@@A 1009a740 physics_2009:dgMinkowskiConv.obj
0003:00002750 ?m_dir@dgContactSolver@@2PAVdgVector@@A 1009a750 physics_2009:dgMinkowskiConv.obj
0003:00002830 ?m_edgeArray@dgCollisionCapsule@@0PAVdgConvexSimplexEdge@@A 1009a830 physics_2009:dgCollisionCapsule.obj
0003:00003370 ?m_shapeRefCount@dgCollisionCapsule@@0HA 1009b370 physics_2009:dgCollisionCapsule.obj
0003:00003378 ?m_edgeArray@dgCollisionCone@@0PAVdgConvexSimplexEdge@@A 1009b378 physics_2009:dgCollisionCone.obj
0003:00003578 ?m_shapeRefCount@dgCollisionCone@@0HA 1009b578 physics_2009:dgCollisionCone.obj
0003:00003580 ?m_edgeArray@dgCollisionCylinder@@0PAVdgConvexSimplexEdge@@A 1009b580 physics_2009:dgCollisionCylinder.obj
0003:00003880 ?m_shapeRefCount@dgCollisionCylinder@@0HA 1009b880 physics_2009:dgCollisionCylinder.obj
0003:00003890 ?m_edgeArray@dgCollisionChamferCylinder@@0PAVdgConvexSimplexEdge@@A 1009b890 physics_2009:dgCollisionChamferCylinder.obj
0003:00004190 ?m_shapeRefCount@dgCollisionChamferCylinder@@0HA 1009c190 physics_2009:dgCollisionChamferCylinder.obj
0003:000041a0 ?m_shapesDirs@dgCollisionChamferCylinder@@0PAVdgVector@@A 1009c1a0 physics_2009:dgCollisionChamferCylinder.obj
0003:00004264 ___fastflag 1009c264 LIBCMT:_fpinit_.obj
0003:00004268 __adjust_fdiv 1009c268 LIBCMT:_fpinit_.obj
0003:00004270 __aenvptr 1009c270 LIBCMT:dllcrt0.obj
0003:00004274 __wenvptr 1009c274 LIBCMT:dllcrt0.obj
0003:00004278 ___error_mode 1009c278 LIBCMT:dllcrt0.obj
0003:0000427c ___app_type 1009c27c LIBCMT:dllcrt0.obj
0003:000043d8 ___sbh_pHeaderDefer 1009c3d8 LIBCMT:sbheap.obj
0003:000043dc __crtheap 1009c3dc LIBCMT:heapinit.obj
0003:000043e0 __umaskval 1009c3e0 LIBCMT:crt0dat.obj
0003:000043e4 ___argc 1009c3e4 LIBCMT:crt0dat.obj
0003:000043e8 ___argv 1009c3e8 LIBCMT:crt0dat.obj
0003:000043ec ___wargv 1009c3ec LIBCMT:crt0dat.obj
0003:000043f0 __environ 1009c3f0 LIBCMT:crt0dat.obj
0003:000043f4 ___initenv 1009c3f4 LIBCMT:crt0dat.obj
0003:000043f8 __wenviron 1009c3f8 LIBCMT:crt0dat.obj
0003:000043fc ___winitenv 1009c3fc LIBCMT:crt0dat.obj
0003:00004400 __pgmptr 1009c400 LIBCMT:crt0dat.obj
0003:00004404 __wpgmptr 1009c404 LIBCMT:crt0dat.obj
0003:00004408 __exitflag 1009c408 LIBCMT:crt0dat.obj
0003:0000440c __C_Termination_Done 1009c40c LIBCMT:crt0dat.obj
0003:00004410 __C_Exit_Done 1009c410 LIBCMT:crt0dat.obj
0003:0000472c ?_pnhHeap@@3P6AHI@ZA 1009c72c LIBCMT:handler.obj
0003:00004730 __newmode 1009c730 LIBCMT:_newmode.obj
0003:00004734 _gpFlsAlloc 1009c734 LIBCMT:tidtable.obj
0003:00004738 _gpFlsGetValue 1009c738 LIBCMT:tidtable.obj
0003:0000473c _gpFlsSetValue 1009c73c LIBCMT:tidtable.obj
0003:00004740 _gpFlsFree 1009c740 LIBCMT:tidtable.obj
0003:00004744 __maxwait 1009c744 LIBCMT:crtheap.obj
0003:00004854 ___pInvalidArgHandler 1009c854 LIBCMT:invarg.obj
0003:00004874 ___pPurecall 1009c874 LIBCMT:inithelp.obj
0003:00004904 ___mbulinfo 1009c904 LIBCMT:mbctype.obj
0003:00004910 ___mbcodepage 1009c910 LIBCMT:mbctype.obj
0003:00004914 ___ismbcodepage 1009c914 LIBCMT:mbctype.obj
0003:00004918 ___mblcid 1009c918 LIBCMT:mbctype.obj
0003:0000491c ___locale_changed 1009c91c LIBCMT:setlocal.obj
0003:00004920 ___lc_handle 1009c920 LIBCMT:nlsdata2.obj
0003:00004938 ___lc_codepage 1009c938 LIBCMT:nlsdata2.obj
0003:0000493c ___lc_collate_cp 1009c93c LIBCMT:nlsdata2.obj
0003:00004940 __outputformat 1009c940 LIBCMT:outputformat.obj
0003:00004948 ?__pInconsistency@@3P6AXXZA 1009c948 LIBCMT:hooks.obj
0003:00004964 __cflush 1009c964 LIBCMT:_file.obj
0003:00004974 ___lconv_static_null 1009c974 LIBCMT:lconv.obj
0003:00004c9c __stdbuf 1009cc9c LIBCMT:_sftbuf.obj
0003:00004d60 __debugger_hook_dummy 1009cd60 <common>
0003:00004d64 ___piob 1009cd64 <common>
0003:00004d80 __bufin 1009cd80 <common>
0003:00005d80 __nstream 1009dd80 <common>
0003:00005d84 __nhandle 1009dd84 <common>
0003:00005da0 ___pioinfo 1009dda0 <common>
0003:00005ea0 ___env_initialized 1009dea0 <common>
0003:00005ea4 ___onexitend 1009dea4 <common>
0003:00005ea8 ___onexitbegin 1009dea8 <common>
0003:00005eac ___mbctype_initialized 1009deac <common>
0003:00005eb0 ___dyn_tls_init_callback 1009deb0 <common>
0003:00005eb4 ___active_heap 1009deb4 <common>
0003:00005eb8 __pDestructExceptionObject 1009deb8 <common>
0003:00005ebc ___sbh_cntHeaderList 1009debc <common>
0003:00005ec0 ___sbh_pHeaderList 1009dec0 <common>
0003:00005ec4 ___sbh_threshold 1009dec4 <common>
0003:00005ec8 ___sbh_pHeaderScan 1009dec8 <common>
0003:00005ecc ___sbh_sizeHeaderList 1009decc <common>
0003:00005ed0 ___sbh_indGroupDefer 1009ded0 <common>
0003:00005ed4 ___use_sse2_mathfcns 1009ded4 <common>
0003:00005ed8 ___sse2_available 1009ded8 <common>
0003:00005edc __pmatherr 1009dedc <common>
0003:00005ee0 __acmdln 1009dee0 <common>
entry point at 0001:0007d8b6
Static symbols
0001:0006c780 ?DetectSSE@@YA_NXZ 1006d780 f corelib_2009:dgTypes.obj
0001:0006c780 ?DetectSSE_3@@YA_NXZ 1006d780 f corelib_2009:dgTypes.obj
0001:0006ce60 ?SortVertices@InternalGeoUtil@@YAHQAMHHHHM@Z 1006de60 f corelib_2009:dgTypes.obj
0001:0006d8a0 ?QuickSortVertices@InternalGeoUtil@@YAHQAMHHHHM@Z 1006e8a0 f corelib_2009:dgTypes.obj
0001:0006edd0 ?NormalizeVertex@InternalPolyhedra@@YAXHQAVdgTriplex@@QBMH@Z 1006fdd0 f corelib_2009:dgPolyhedra.obj
0001:0006ef20 ?EdgePlane@InternalPolyhedra@@YA?AVdgBigPlane@@HHHQBVdgTriplex@@@Z 1006ff20 f corelib_2009:dgPolyhedra.obj
0001:0006f040 ?UnboundedLoopPlane@InternalPolyhedra@@YA?AVdgBigPlane@@HHHQBVdgTriplex@@@Z 10070040 f corelib_2009:dgPolyhedra.obj
0001:0006f190 ?BigFaceNormal@InternalPolyhedra@@YA?AVdgBigVector@@PAVdgEdge@@QBMH@Z 10070190 f corelib_2009:dgPolyhedra.obj
0001:0006f2a0 ?CalculateVertexMetrics@InternalPolyhedra@@YAXQAUVERTEX_METRIC_STRUCT@1@QBVdgTriplex@@PAVdgEdge@@@Z 100702a0 f corelib_2009:dgPolyhedra.obj
0001:0006f380 ?IsEssensialPointDiagonal@InternalPolyhedra@@YA_NPAVdgEdge@@ABVdgBigVector@@QBMH@Z 10070380 f corelib_2009:dgPolyhedra.obj
0001:0006f880 ?CalculateAllMetrics@InternalPolyhedra@@YAXPBVdgPolyhedra@@QAUVERTEX_METRIC_STRUCT@1@QBVdgTriplex@@@Z 10070880 f corelib_2009:dgPolyhedra.obj
0001:0006fb10 ?EdgePenalty@InternalPolyhedra@@YAMABVdgPolyhedra@@QBVdgTriplex@@PAVdgEdge@@@Z 10070b10 f corelib_2009:dgPolyhedra.obj
0001:00070200 ?GetInteriorDiagonals@InternalPolyhedra@@YAHAAVdgPolyhedra@@QAPAVdgEdge@@H@Z 10071200 f corelib_2009:dgPolyhedra.obj
0001:000704a0 ?MatchTwins@InternalPolyhedra@@YA_NPAVdgPolyhedra@@@Z 100714a0 f corelib_2009:dgPolyhedra.obj
0001:00070550 ?FindEarTip@InternalPolyhedra@@YAPAVdgEdge@@ABVdgPolyhedra@@PAV2@QBMHAAV?$dgDownHeap@PAVdgEdge@@M@@ABVdgVector@@@Z 10071550 f corelib_2009:dgPolyhedra.obj
0001:000713d0 ?CloseOpenBounds@InternalPolyhedra@@YAXPAVdgPolyhedra@@@Z 100723d0 f corelib_2009:dgPolyhedra.obj
0001:00072550 ?MarkAdjacentCoplanarFaces@InternalPolyhedra@@YAXAAVdgPolyhedra@@0PAVdgEdge@@QBMH@Z 10073550 f corelib_2009:dgPolyhedra.obj
0001:00072880 ?ConvexPartition@InternalPolyhedra@@YA_NAAVdgPolyhedra@@QBMH@Z 10073880 f corelib_2009:dgPolyhedra.obj
0001:000732e0 ?TriangulateFace@InternalPolyhedra@@YAPAVdgEdge@@AAVdgPolyhedra@@PAV2@QBMHAAV?$dgDownHeap@PAVdgEdge@@M@@PAVdgVector@@@Z 100742e0 f corelib_2009:dgPolyhedra.obj
0001:0007d7c0 ___DllMainCRTStartup 1007e7c0 f LIBCMT:dllcrt0.obj
0001:0007d956 __hw_cw 1007e956 f LIBCMT:_ieee87_.obj
0001:0007d9e4 ___hw_cw_sse2 1007e9e4 f LIBCMT:_ieee87_.obj
0001:0007e56a __onexit_nolock 1007f56a f LIBCMT:onexit.obj
0001:0007e806 __callthreadstartex 1007f806 f LIBCMT:threadex.obj
0001:0007e847 __threadstartex@4 1007f847 f LIBCMT:threadex.obj
0001:0007ef41 __shift 1007ff41 f LIBCMT:cvt.obj
0001:0007ef86 __cftoe2_l 1007ff86 f LIBCMT:cvt.obj
0001:0007f558 __cftof2_l 10080558 f LIBCMT:cvt.obj
0001:0008091e __initterm 1008191e f LIBCMT:crt0dat.obj
0001:000809e4 _doexit 100819e4 f LIBCMT:crt0dat.obj
0001:00080e29 _fastzero_I 10081e29 f LIBCMT:p4_memset.obj
0001:00080f0f _fastcopy_I 10081f0f f LIBCMT:p4_memcpy.obj
0001:00081b20 _parse_cmdline 10082b20 f LIBCMT:stdargv.obj
0001:00082273 _write_char 10083273 f LIBCMT:output.obj
0001:000822a6 _write_multi_char 100832a6 f LIBCMT:output.obj
0001:000822cc _write_string 100832cc f LIBCMT:output.obj
0001:000831ac _siglookup 100841ac f LIBCMT:winsig.obj
0001:00084b34 __unwind_handler 10085b34 f LIBCMT:exsup.obj
0001:00084c50 _ValidateScopeTableHandlers 10085c50 f LIBCMT:eh3valid.obj
0001:000851b0 _has_osfxsr_set 100861b0 f LIBCMT:cpu_disp.obj
0001:00085afd ?CPtoLCID@@YAHH@Z 10086afd f LIBCMT:mbctype.obj
0001:00085b2c ?setSBCS@@YAXPAUthreadmbcinfostruct@@@Z 10086b2c f LIBCMT:mbctype.obj
0001:00085b90 ?setSBUpLow@@YAXPAUthreadmbcinfostruct@@@Z 10086b90 f LIBCMT:mbctype.obj
0001:00085dc7 ?getSystemCP@@YAHH@Z 10086dc7 f LIBCMT:mbctype.obj
0001:00086451 __updatetlocinfoEx_nolock 10087451 f LIBCMT:setlocal.obj
0001:000870a8 __unwind_handler4 100880a8 f LIBCMT:exsup4.obj
0001:000877da ?x_ismbbtype_l@@YAHPAUlocaleinfo_struct@@IHH@Z 100887da f LIBCMT:ismbbyte.obj
0001:0008968e ?__crtLCMapStringA_stat@@YAHPAUlocaleinfo_struct@@KKPBDHPADHHH@Z 1008a68e f LIBCMT:a_map.obj
0001:00089a78 ?__crtGetStringTypeA_stat@@YAHPAUlocaleinfo_struct@@KPBDHPAGHHH@Z 1008aa78 f LIBCMT:a_str.obj
0001:0008c16b _flsall 1008d16b f LIBCMT:fflush.obj
0001:0008c24e ?strtoxl@@YAKPAUlocaleinfo_struct@@PBDPAPBDHH@Z 1008d24e f LIBCMT:strtol.obj
0001:0008cdc0 ??__Eg_allocaror@dgInternalMemory@@YAXXZ 1008ddc0 f corelib_2009:dgMemory.obj
0001:0008cdd0 ??__Fg_allocaror@dgInternalMemory@@YAXXZ 1008ddd0 f corelib_2009:dgMemory.obj

Archive Download the corresponding diff file

Branches

Tags

Page rendered in 3.15241s using 14 queries.