Merged from 1.5 branch to trunk, all changes from 1913 to 1932. Mostly example and test fixes. Some bug fixes, camera interface changes.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@1933 dfc29bdd-3216-0410-991c-e03cc46cb475master
parent
ace653f4fc
commit
ad43762777
|
@ -1,5 +1,9 @@
|
|||
Changes in version 1.5 (...12.2008)
|
||||
|
||||
- Construction calls for FPS camera changed to take speed in units/milliseconds, just as the setSpeed method does.
|
||||
|
||||
- Code::Blocks workspaces added. C::B projects (using gcc) now output to /lib/gcc and /bin/gcc, when built on either Windows or Linux.
|
||||
|
||||
- Added a test suite in the /tests directory. This can be used to perform regression tests, and should be updated with new tests to verify fixes or validate new features.
|
||||
|
||||
- Changed the preferred way of altering light node's radius: Use the new member methods of ILightSceneNode instead of directly modifying the SLight structure.
|
||||
|
|
|
@ -0,0 +1,39 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||
<CodeBlocks_project_file>
|
||||
<FileVersion major="1" minor="6" />
|
||||
<Project>
|
||||
<Option title="Irrlicht Example 01 Hello World" />
|
||||
<Option pch_mode="0" />
|
||||
<Option compiler="gcc" />
|
||||
<Build>
|
||||
<Target title="default">
|
||||
<Option output="..\..\bin\gcc\HelloWorld" prefix_auto="0" extension_auto="1" />
|
||||
<Option type="1" />
|
||||
<Option compiler="gcc" />
|
||||
<Option projectResourceIncludeDirsRelation="1" />
|
||||
<Compiler>
|
||||
<Add option="-Wall" />
|
||||
<Add option="-g" />
|
||||
</Compiler>
|
||||
</Target>
|
||||
</Build>
|
||||
<VirtualTargets>
|
||||
<Add alias="All" targets="default;" />
|
||||
</VirtualTargets>
|
||||
<Compiler>
|
||||
<Add option="-Wall" />
|
||||
<Add option="-g" />
|
||||
<Add directory="..\..\include" />
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add library="Irrlicht" />
|
||||
<Add directory="..\..\lib\gcc" />
|
||||
</Linker>
|
||||
<Unit filename="main.cpp" />
|
||||
<Extensions>
|
||||
<code_completion />
|
||||
<debugger />
|
||||
<envvars />
|
||||
</Extensions>
|
||||
</Project>
|
||||
</CodeBlocks_project_file>
|
|
@ -1,32 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<!DOCTYPE CodeBlocks_project_file>
|
||||
<CodeBlocks_project_file>
|
||||
<FileVersion major="1" minor="1"/>
|
||||
<Project>
|
||||
<Option title="Irrlicht Example 01 Hello World"/>
|
||||
<Option makefile="Makefile"/>
|
||||
<Option makefile_is_custom="0"/>
|
||||
<Option compiler="0"/>
|
||||
<Build>
|
||||
<Target title="default">
|
||||
<Option output="..\..\bin\win32-gcc\01.HelloWorld.exe"/>
|
||||
<Option working_dir="."/>
|
||||
<Option object_output=".objs"/>
|
||||
<Option deps_output=".deps"/>
|
||||
<Option type="1"/>
|
||||
<Option compiler="0"/>
|
||||
<Option projectResourceIncludeDirsRelation="1"/>
|
||||
</Target>
|
||||
</Build>
|
||||
<Compiler>
|
||||
<Add directory="..\..\include"/>
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add option="../../lib/Win32-gcc/libIrrlicht.a"/>
|
||||
</Linker>
|
||||
<Unit filename="main.cpp">
|
||||
<Option compilerVar="CPP"/>
|
||||
<Option target="default"/>
|
||||
</Unit>
|
||||
</Project>
|
||||
</CodeBlocks_project_file>
|
|
@ -0,0 +1,38 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||
<CodeBlocks_project_file>
|
||||
<FileVersion major="1" minor="6" />
|
||||
<Project>
|
||||
<Option title="Irrlicht Example 02 Quake Map" />
|
||||
<Option pch_mode="0" />
|
||||
<Option compiler="gcc" />
|
||||
<Build>
|
||||
<Target title="default">
|
||||
<Option output="..\..\bin\gcc\Quake3Map" prefix_auto="0" extension_auto="1" />
|
||||
<Option type="1" />
|
||||
<Option compiler="gcc" />
|
||||
<Option projectResourceIncludeDirsRelation="1" />
|
||||
<Compiler>
|
||||
<Add option="-Wall" />
|
||||
<Add option="-g" />
|
||||
</Compiler>
|
||||
</Target>
|
||||
</Build>
|
||||
<VirtualTargets>
|
||||
<Add alias="All" targets="default;" />
|
||||
</VirtualTargets>
|
||||
<Compiler>
|
||||
<Add option="-Wall" />
|
||||
<Add option="-g" />
|
||||
<Add directory="..\..\include" />
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add library="Irrlicht" />
|
||||
<Add directory="..\..\lib\gcc" />
|
||||
</Linker>
|
||||
<Unit filename="main.cpp" />
|
||||
<Extensions>
|
||||
<code_completion />
|
||||
<debugger />
|
||||
</Extensions>
|
||||
</Project>
|
||||
</CodeBlocks_project_file>
|
|
@ -1,32 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<!DOCTYPE CodeBlocks_project_file>
|
||||
<CodeBlocks_project_file>
|
||||
<FileVersion major="1" minor="1"/>
|
||||
<Project>
|
||||
<Option title="Irrlicht Example 02 Quake Map"/>
|
||||
<Option makefile="Makefile"/>
|
||||
<Option makefile_is_custom="0"/>
|
||||
<Option compiler="0"/>
|
||||
<Build>
|
||||
<Target title="default">
|
||||
<Option output="..\..\bin\Win32-gcc\02.Quake3Map.exe"/>
|
||||
<Option working_dir="."/>
|
||||
<Option object_output=".objs"/>
|
||||
<Option deps_output=".deps"/>
|
||||
<Option type="1"/>
|
||||
<Option compiler="0"/>
|
||||
<Option projectResourceIncludeDirsRelation="1"/>
|
||||
</Target>
|
||||
</Build>
|
||||
<Compiler>
|
||||
<Add directory="..\..\include"/>
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add option="../../lib/Win32-gcc/libIrrlicht.a"/>
|
||||
</Linker>
|
||||
<Unit filename="main.cpp">
|
||||
<Option compilerVar="CPP"/>
|
||||
<Option target="default"/>
|
||||
</Unit>
|
||||
</Project>
|
||||
</CodeBlocks_project_file>
|
|
@ -0,0 +1,35 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||
<CodeBlocks_project_file>
|
||||
<FileVersion major="1" minor="6" />
|
||||
<Project>
|
||||
<Option title="Irrlicht Example 03 Custom Scene Node" />
|
||||
<Option pch_mode="0" />
|
||||
<Option compiler="gcc" />
|
||||
<Build>
|
||||
<Target title="default">
|
||||
<Option output="../../bin/gcc/CustomSceneNode" prefix_auto="0" extension_auto="1" />
|
||||
<Option type="1" />
|
||||
<Option compiler="gcc" />
|
||||
<Option projectResourceIncludeDirsRelation="1" />
|
||||
</Target>
|
||||
</Build>
|
||||
<VirtualTargets>
|
||||
<Add alias="All" targets="default;" />
|
||||
</VirtualTargets>
|
||||
<Compiler>
|
||||
<Add option="-Wall" />
|
||||
<Add option="-g" />
|
||||
<Add directory="../../include" />
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add library="Irrlicht" />
|
||||
<Add directory="../../bin/gcc" />
|
||||
</Linker>
|
||||
<Unit filename="main.cpp" />
|
||||
<Extensions>
|
||||
<code_completion />
|
||||
<debugger />
|
||||
<envvars />
|
||||
</Extensions>
|
||||
</Project>
|
||||
</CodeBlocks_project_file>
|
|
@ -1,32 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<!DOCTYPE CodeBlocks_project_file>
|
||||
<CodeBlocks_project_file>
|
||||
<FileVersion major="1" minor="1"/>
|
||||
<Project>
|
||||
<Option title="Irrlicht Example 03 Custom Scene Node"/>
|
||||
<Option makefile="Makefile"/>
|
||||
<Option makefile_is_custom="0"/>
|
||||
<Option compiler="0"/>
|
||||
<Build>
|
||||
<Target title="default">
|
||||
<Option output="..\..\bin\Win32-gcc\03.CustomSceneNode.exe"/>
|
||||
<Option working_dir="."/>
|
||||
<Option object_output=".objs"/>
|
||||
<Option deps_output=".deps"/>
|
||||
<Option type="1"/>
|
||||
<Option compiler="0"/>
|
||||
<Option projectResourceIncludeDirsRelation="1"/>
|
||||
</Target>
|
||||
</Build>
|
||||
<Compiler>
|
||||
<Add directory="..\..\include"/>
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add option="../../lib/Win32-gcc/libIrrlicht.a"/>
|
||||
</Linker>
|
||||
<Unit filename="main.cpp">
|
||||
<Option compilerVar="CPP"/>
|
||||
<Option target="default"/>
|
||||
</Unit>
|
||||
</Project>
|
||||
</CodeBlocks_project_file>
|
|
@ -0,0 +1,34 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||
<CodeBlocks_project_file>
|
||||
<FileVersion major="1" minor="6" />
|
||||
<Project>
|
||||
<Option title="Irrlicht Example 04 Movement" />
|
||||
<Option pch_mode="0" />
|
||||
<Option compiler="gcc" />
|
||||
<Build>
|
||||
<Target title="default">
|
||||
<Option output="..\..\bin\gcc\Movement" prefix_auto="0" extension_auto="1" />
|
||||
<Option type="1" />
|
||||
<Option compiler="gcc" />
|
||||
<Option projectResourceIncludeDirsRelation="1" />
|
||||
</Target>
|
||||
</Build>
|
||||
<VirtualTargets>
|
||||
<Add alias="All" targets="default;" />
|
||||
</VirtualTargets>
|
||||
<Compiler>
|
||||
<Add option="-Wall" />
|
||||
<Add option="-g" />
|
||||
<Add directory="..\..\include" />
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add library="Irrlicht" />
|
||||
<Add directory="..\..\lib\gcc" />
|
||||
</Linker>
|
||||
<Unit filename="main.cpp" />
|
||||
<Extensions>
|
||||
<code_completion />
|
||||
<debugger />
|
||||
</Extensions>
|
||||
</Project>
|
||||
</CodeBlocks_project_file>
|
|
@ -1,32 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<!DOCTYPE CodeBlocks_project_file>
|
||||
<CodeBlocks_project_file>
|
||||
<FileVersion major="1" minor="1"/>
|
||||
<Project>
|
||||
<Option title="Irrlicht Example 04 Movement"/>
|
||||
<Option makefile="Makefile"/>
|
||||
<Option makefile_is_custom="0"/>
|
||||
<Option compiler="0"/>
|
||||
<Build>
|
||||
<Target title="default">
|
||||
<Option output="..\..\bin\Win32-gcc\04.Movement.exe"/>
|
||||
<Option working_dir="."/>
|
||||
<Option object_output=".objs"/>
|
||||
<Option deps_output=".deps"/>
|
||||
<Option type="1"/>
|
||||
<Option compiler="0"/>
|
||||
<Option projectResourceIncludeDirsRelation="1"/>
|
||||
</Target>
|
||||
</Build>
|
||||
<Compiler>
|
||||
<Add directory="..\..\include"/>
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add option="../../lib/Win32-gcc/libIrrlicht.a"/>
|
||||
</Linker>
|
||||
<Unit filename="main.cpp">
|
||||
<Option compilerVar="CPP"/>
|
||||
<Option target="default"/>
|
||||
</Unit>
|
||||
</Project>
|
||||
</CodeBlocks_project_file>
|
|
@ -0,0 +1,34 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||
<CodeBlocks_project_file>
|
||||
<FileVersion major="1" minor="6" />
|
||||
<Project>
|
||||
<Option title="Irrlicht Example 05 User Interface" />
|
||||
<Option pch_mode="0" />
|
||||
<Option compiler="gcc" />
|
||||
<Build>
|
||||
<Target title="default">
|
||||
<Option output="..\..\bin\gcc\UserInterface" prefix_auto="0" extension_auto="1" />
|
||||
<Option type="1" />
|
||||
<Option compiler="gcc" />
|
||||
<Option projectResourceIncludeDirsRelation="1" />
|
||||
</Target>
|
||||
</Build>
|
||||
<VirtualTargets>
|
||||
<Add alias="All" targets="default;" />
|
||||
</VirtualTargets>
|
||||
<Compiler>
|
||||
<Add option="-Wall" />
|
||||
<Add option="-g" />
|
||||
<Add directory="..\..\include" />
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add library="Irrlicht" />
|
||||
<Add directory="..\..\lib\gcc" />
|
||||
</Linker>
|
||||
<Unit filename="main.cpp" />
|
||||
<Extensions>
|
||||
<code_completion />
|
||||
<debugger />
|
||||
</Extensions>
|
||||
</Project>
|
||||
</CodeBlocks_project_file>
|
|
@ -1,32 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<!DOCTYPE CodeBlocks_project_file>
|
||||
<CodeBlocks_project_file>
|
||||
<FileVersion major="1" minor="1"/>
|
||||
<Project>
|
||||
<Option title="Irrlicht Example 05 User Interface"/>
|
||||
<Option makefile="Makefile"/>
|
||||
<Option makefile_is_custom="0"/>
|
||||
<Option compiler="0"/>
|
||||
<Build>
|
||||
<Target title="default">
|
||||
<Option output="..\..\bin\Win32-gcc\05.UserInterface.exe"/>
|
||||
<Option working_dir="."/>
|
||||
<Option object_output=".objs"/>
|
||||
<Option deps_output=".deps"/>
|
||||
<Option type="1"/>
|
||||
<Option compiler="0"/>
|
||||
<Option projectResourceIncludeDirsRelation="1"/>
|
||||
</Target>
|
||||
</Build>
|
||||
<Compiler>
|
||||
<Add directory="..\..\include"/>
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add option="../../lib/Win32-gcc/libIrrlicht.a"/>
|
||||
</Linker>
|
||||
<Unit filename="main.cpp">
|
||||
<Option compilerVar="CPP"/>
|
||||
<Option target="default"/>
|
||||
</Unit>
|
||||
</Project>
|
||||
</CodeBlocks_project_file>
|
|
@ -0,0 +1,34 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||
<CodeBlocks_project_file>
|
||||
<FileVersion major="1" minor="6" />
|
||||
<Project>
|
||||
<Option title="Irrlicht Example 06 2D Graphics" />
|
||||
<Option pch_mode="0" />
|
||||
<Option compiler="gcc" />
|
||||
<Build>
|
||||
<Target title="default">
|
||||
<Option output="..\..\bin\gcc\2DGraphics" prefix_auto="0" extension_auto="1" />
|
||||
<Option type="1" />
|
||||
<Option compiler="gcc" />
|
||||
<Option projectResourceIncludeDirsRelation="1" />
|
||||
</Target>
|
||||
</Build>
|
||||
<VirtualTargets>
|
||||
<Add alias="All" targets="default;" />
|
||||
</VirtualTargets>
|
||||
<Compiler>
|
||||
<Add option="-Wall" />
|
||||
<Add option="-g" />
|
||||
<Add directory="..\..\include" />
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add library="Irrlicht" />
|
||||
<Add directory="..\..\lib\gcc" />
|
||||
</Linker>
|
||||
<Unit filename="main.cpp" />
|
||||
<Extensions>
|
||||
<code_completion />
|
||||
<debugger />
|
||||
</Extensions>
|
||||
</Project>
|
||||
</CodeBlocks_project_file>
|
|
@ -1,32 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<!DOCTYPE CodeBlocks_project_file>
|
||||
<CodeBlocks_project_file>
|
||||
<FileVersion major="1" minor="1"/>
|
||||
<Project>
|
||||
<Option title="Irrlicht Example 06 2D Graphics"/>
|
||||
<Option makefile="Makefile"/>
|
||||
<Option makefile_is_custom="0"/>
|
||||
<Option compiler="0"/>
|
||||
<Build>
|
||||
<Target title="default">
|
||||
<Option output="..\..\bin\Win32-gcc\06.2DGraphics.exe"/>
|
||||
<Option working_dir="."/>
|
||||
<Option object_output=".objs"/>
|
||||
<Option deps_output=".deps"/>
|
||||
<Option type="1"/>
|
||||
<Option compiler="0"/>
|
||||
<Option projectResourceIncludeDirsRelation="1"/>
|
||||
</Target>
|
||||
</Build>
|
||||
<Compiler>
|
||||
<Add directory="..\..\include"/>
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add option="../../lib/Win32-gcc/libIrrlicht.a"/>
|
||||
</Linker>
|
||||
<Unit filename="main.cpp">
|
||||
<Option compilerVar="CPP"/>
|
||||
<Option target="default"/>
|
||||
</Unit>
|
||||
</Project>
|
||||
</CodeBlocks_project_file>
|
|
@ -0,0 +1,34 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||
<CodeBlocks_project_file>
|
||||
<FileVersion major="1" minor="6" />
|
||||
<Project>
|
||||
<Option title="Irrlicht Example 07 Collision" />
|
||||
<Option pch_mode="0" />
|
||||
<Option compiler="gcc" />
|
||||
<Build>
|
||||
<Target title="default">
|
||||
<Option output="..\..\bin\gcc\Collision" prefix_auto="0" extension_auto="1" />
|
||||
<Option type="1" />
|
||||
<Option compiler="gcc" />
|
||||
<Option projectResourceIncludeDirsRelation="1" />
|
||||
</Target>
|
||||
</Build>
|
||||
<VirtualTargets>
|
||||
<Add alias="All" targets="default;" />
|
||||
</VirtualTargets>
|
||||
<Compiler>
|
||||
<Add option="-Wall" />
|
||||
<Add option="-g" />
|
||||
<Add directory="..\..\include" />
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add library="Irrlicht" />
|
||||
<Add directory="..\..\lib\gcc" />
|
||||
</Linker>
|
||||
<Unit filename="main.cpp" />
|
||||
<Extensions>
|
||||
<code_completion />
|
||||
<debugger />
|
||||
</Extensions>
|
||||
</Project>
|
||||
</CodeBlocks_project_file>
|
|
@ -1,32 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<!DOCTYPE CodeBlocks_project_file>
|
||||
<CodeBlocks_project_file>
|
||||
<FileVersion major="1" minor="1"/>
|
||||
<Project>
|
||||
<Option title="Irrlicht Example 07 Collision"/>
|
||||
<Option makefile="Makefile"/>
|
||||
<Option makefile_is_custom="0"/>
|
||||
<Option compiler="0"/>
|
||||
<Build>
|
||||
<Target title="default">
|
||||
<Option output="..\..\bin\Win32-gcc\07.Collision.exe"/>
|
||||
<Option working_dir="."/>
|
||||
<Option object_output=".objs"/>
|
||||
<Option deps_output=".deps"/>
|
||||
<Option type="1"/>
|
||||
<Option compiler="0"/>
|
||||
<Option projectResourceIncludeDirsRelation="1"/>
|
||||
</Target>
|
||||
</Build>
|
||||
<Compiler>
|
||||
<Add directory="..\..\include"/>
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add option="../../lib/Win32-gcc/libIrrlicht.a"/>
|
||||
</Linker>
|
||||
<Unit filename="main.cpp">
|
||||
<Option compilerVar="CPP"/>
|
||||
<Option target="default"/>
|
||||
</Unit>
|
||||
</Project>
|
||||
</CodeBlocks_project_file>
|
|
@ -0,0 +1,34 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||
<CodeBlocks_project_file>
|
||||
<FileVersion major="1" minor="6" />
|
||||
<Project>
|
||||
<Option title="Irrlicht Example 08 Special Effects" />
|
||||
<Option pch_mode="0" />
|
||||
<Option compiler="gcc" />
|
||||
<Build>
|
||||
<Target title="default">
|
||||
<Option output="..\..\bin\gcc\SpecialFX" prefix_auto="0" extension_auto="1" />
|
||||
<Option type="1" />
|
||||
<Option compiler="gcc" />
|
||||
<Option projectResourceIncludeDirsRelation="1" />
|
||||
</Target>
|
||||
</Build>
|
||||
<VirtualTargets>
|
||||
<Add alias="All" targets="default;" />
|
||||
</VirtualTargets>
|
||||
<Compiler>
|
||||
<Add option="-Wall" />
|
||||
<Add option="-g" />
|
||||
<Add directory="..\..\include" />
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add library="Irrlicht" />
|
||||
<Add directory="..\..\lib\gcc" />
|
||||
</Linker>
|
||||
<Unit filename="main.cpp" />
|
||||
<Extensions>
|
||||
<code_completion />
|
||||
<debugger />
|
||||
</Extensions>
|
||||
</Project>
|
||||
</CodeBlocks_project_file>
|
|
@ -1,32 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<!DOCTYPE CodeBlocks_project_file>
|
||||
<CodeBlocks_project_file>
|
||||
<FileVersion major="1" minor="1"/>
|
||||
<Project>
|
||||
<Option title="Irrlicht Example 08 Special Effects"/>
|
||||
<Option makefile="Makefile"/>
|
||||
<Option makefile_is_custom="0"/>
|
||||
<Option compiler="0"/>
|
||||
<Build>
|
||||
<Target title="default">
|
||||
<Option output="..\..\bin\Win32-gcc\08.SpecialFX.exe"/>
|
||||
<Option working_dir="."/>
|
||||
<Option object_output=".objs"/>
|
||||
<Option deps_output=".deps"/>
|
||||
<Option type="1"/>
|
||||
<Option compiler="0"/>
|
||||
<Option projectResourceIncludeDirsRelation="1"/>
|
||||
</Target>
|
||||
</Build>
|
||||
<Compiler>
|
||||
<Add directory="..\..\include"/>
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add option="../../lib/Win32-gcc/libIrrlicht.a"/>
|
||||
</Linker>
|
||||
<Unit filename="main.cpp">
|
||||
<Option compilerVar="CPP"/>
|
||||
<Option target="default"/>
|
||||
</Unit>
|
||||
</Project>
|
||||
</CodeBlocks_project_file>
|
|
@ -0,0 +1,34 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||
<CodeBlocks_project_file>
|
||||
<FileVersion major="1" minor="6" />
|
||||
<Project>
|
||||
<Option title="Irrlicht Example 09 Mesh Viewer" />
|
||||
<Option pch_mode="0" />
|
||||
<Option compiler="gcc" />
|
||||
<Build>
|
||||
<Target title="default">
|
||||
<Option output="..\..\bin\gcc\MeshViewer" prefix_auto="0" extension_auto="1" />
|
||||
<Option type="1" />
|
||||
<Option compiler="gcc" />
|
||||
<Option projectResourceIncludeDirsRelation="1" />
|
||||
</Target>
|
||||
</Build>
|
||||
<VirtualTargets>
|
||||
<Add alias="All" targets="default;" />
|
||||
</VirtualTargets>
|
||||
<Compiler>
|
||||
<Add option="-Wall" />
|
||||
<Add option="-g" />
|
||||
<Add directory="..\..\include" />
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add library="Irrlicht" />
|
||||
<Add directory="..\..\lib\gcc" />
|
||||
</Linker>
|
||||
<Unit filename="main.cpp" />
|
||||
<Extensions>
|
||||
<code_completion />
|
||||
<debugger />
|
||||
</Extensions>
|
||||
</Project>
|
||||
</CodeBlocks_project_file>
|
|
@ -1,32 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<!DOCTYPE CodeBlocks_project_file>
|
||||
<CodeBlocks_project_file>
|
||||
<FileVersion major="1" minor="1"/>
|
||||
<Project>
|
||||
<Option title="Irrlicht Example 09 Mesh Viewer"/>
|
||||
<Option makefile="Makefile"/>
|
||||
<Option makefile_is_custom="0"/>
|
||||
<Option compiler="0"/>
|
||||
<Build>
|
||||
<Target title="default">
|
||||
<Option output="..\..\bin\Win32-gcc\09.MeshViewer.exe"/>
|
||||
<Option working_dir="."/>
|
||||
<Option object_output=".objs"/>
|
||||
<Option deps_output=".deps"/>
|
||||
<Option type="1"/>
|
||||
<Option compiler="0"/>
|
||||
<Option projectResourceIncludeDirsRelation="1"/>
|
||||
</Target>
|
||||
</Build>
|
||||
<Compiler>
|
||||
<Add directory="..\..\include"/>
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add option="../../lib/Win32-gcc/libIrrlicht.a"/>
|
||||
</Linker>
|
||||
<Unit filename="main.cpp">
|
||||
<Option compilerVar="CPP"/>
|
||||
<Option target="default"/>
|
||||
</Unit>
|
||||
</Project>
|
||||
</CodeBlocks_project_file>
|
|
@ -36,7 +36,7 @@ scene::ISceneNode* Model = 0;
|
|||
scene::ISceneNode* SkyBox = 0;
|
||||
bool Octree=false;
|
||||
|
||||
scene::ICameraSceneNode* Camera[2] = { 0, 0};
|
||||
scene::ICameraSceneNode* Camera[2] = {0, 0};
|
||||
|
||||
/*
|
||||
Toggle between various cameras
|
||||
|
@ -83,15 +83,11 @@ void loadModel(const c8* fn)
|
|||
extension.make_lower();
|
||||
|
||||
// if a texture is loaded apply it to the current model..
|
||||
if (extension == ".jpg" ||
|
||||
extension == ".pcx" ||
|
||||
extension == ".png" ||
|
||||
extension == ".ppm" ||
|
||||
extension == ".pgm" ||
|
||||
extension == ".pbm" ||
|
||||
extension == ".psd" ||
|
||||
extension == ".tga" ||
|
||||
extension == ".bmp")
|
||||
if (extension == ".jpg" || extension == ".pcx" ||
|
||||
extension == ".png" || extension == ".ppm" ||
|
||||
extension == ".pgm" || extension == ".pbm" ||
|
||||
extension == ".psd" || extension == ".tga" ||
|
||||
extension == ".bmp" || extension == ".wal")
|
||||
{
|
||||
video::ITexture * texture =
|
||||
Device->getVideoDriver()->getTexture( filename.c_str() );
|
||||
|
@ -105,12 +101,15 @@ void loadModel(const c8* fn)
|
|||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// if a archive is loaded add it to the FileSystems..
|
||||
if (extension == ".pk3" ||
|
||||
extension == ".zip")
|
||||
else if (extension == ".pk3" || extension == ".zip")
|
||||
{
|
||||
Device->getFileSystem()->addZipFileArchive( filename.c_str() );
|
||||
Device->getFileSystem()->addZipFileArchive(filename.c_str());
|
||||
return;
|
||||
}
|
||||
else if (extension == ".pak")
|
||||
{
|
||||
Device->getFileSystem()->addPakFileArchive(filename.c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -745,7 +744,7 @@ int main(int argc, char* argv[])
|
|||
|
||||
// show about message box and load default model
|
||||
if (argc==1)
|
||||
showAboutText();
|
||||
showAboutText();
|
||||
loadModel(StartUpModelFile.c_str());
|
||||
|
||||
// add skybox
|
||||
|
@ -761,10 +760,14 @@ int main(int argc, char* argv[])
|
|||
// add a camera scene node
|
||||
Camera[0] = smgr->addCameraSceneNodeMaya();
|
||||
Camera[0]->setFarValue(20000.f);
|
||||
Camera[0]->setPosition(core::vector3df(0,0,-100));
|
||||
// Maya cameras reposition themselves relative to their target, so target the location
|
||||
// where the mesh scene node is placed.
|
||||
Camera[0]->setTarget(core::vector3df(0,30,0));
|
||||
|
||||
Camera[1] = smgr->addCameraSceneNodeFPS();
|
||||
Camera[1]->setFarValue(20000.f);
|
||||
Camera[1]->setPosition(core::vector3df(0,0,-100));
|
||||
Camera[1]->setPosition(core::vector3df(0,0,-70));
|
||||
Camera[1]->setTarget(core::vector3df(0,30,0));
|
||||
|
||||
setActiveCamera(Camera[0]);
|
||||
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||
<CodeBlocks_project_file>
|
||||
<FileVersion major="1" minor="6" />
|
||||
<Project>
|
||||
<Option title="Irrlicht Example 10 Shaders" />
|
||||
<Option pch_mode="0" />
|
||||
<Option compiler="gcc" />
|
||||
<Build>
|
||||
<Target title="default">
|
||||
<Option output="..\..\bin\gcc\Shaders" prefix_auto="0" extension_auto="1" />
|
||||
<Option type="1" />
|
||||
<Option compiler="gcc" />
|
||||
<Option projectResourceIncludeDirsRelation="1" />
|
||||
</Target>
|
||||
</Build>
|
||||
<VirtualTargets>
|
||||
<Add alias="All" targets="default;" />
|
||||
</VirtualTargets>
|
||||
<Compiler>
|
||||
<Add option="-Wall" />
|
||||
<Add option="-g" />
|
||||
<Add directory="..\..\include" />
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add library="Irrlicht" />
|
||||
<Add directory="..\..\lib\gcc" />
|
||||
</Linker>
|
||||
<Unit filename="main.cpp" />
|
||||
<Extensions>
|
||||
<code_completion />
|
||||
<debugger />
|
||||
</Extensions>
|
||||
</Project>
|
||||
</CodeBlocks_project_file>
|
|
@ -1,32 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<!DOCTYPE CodeBlocks_project_file>
|
||||
<CodeBlocks_project_file>
|
||||
<FileVersion major="1" minor="1"/>
|
||||
<Project>
|
||||
<Option title="Irrlicht Example 10 Shaders"/>
|
||||
<Option makefile="Makefile"/>
|
||||
<Option makefile_is_custom="0"/>
|
||||
<Option compiler="0"/>
|
||||
<Build>
|
||||
<Target title="default">
|
||||
<Option output="..\..\bin\Win32-gcc\10.Shaders.exe"/>
|
||||
<Option working_dir="."/>
|
||||
<Option object_output=".objs"/>
|
||||
<Option deps_output=".deps"/>
|
||||
<Option type="1"/>
|
||||
<Option compiler="0"/>
|
||||
<Option projectResourceIncludeDirsRelation="1"/>
|
||||
</Target>
|
||||
</Build>
|
||||
<Compiler>
|
||||
<Add directory="..\..\include"/>
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add option="../../lib/Win32-gcc/libIrrlicht.a"/>
|
||||
</Linker>
|
||||
<Unit filename="main.cpp">
|
||||
<Option compilerVar="CPP"/>
|
||||
<Option target="default"/>
|
||||
</Unit>
|
||||
</Project>
|
||||
</CodeBlocks_project_file>
|
|
@ -0,0 +1,34 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||
<CodeBlocks_project_file>
|
||||
<FileVersion major="1" minor="6" />
|
||||
<Project>
|
||||
<Option title="Irrlicht Example 11 Per-Pixel Lighting" />
|
||||
<Option pch_mode="0" />
|
||||
<Option compiler="gcc" />
|
||||
<Build>
|
||||
<Target title="default">
|
||||
<Option output="..\..\bin\gcc\PerPixelLighting" prefix_auto="0" extension_auto="1" />
|
||||
<Option type="1" />
|
||||
<Option compiler="gcc" />
|
||||
<Option projectResourceIncludeDirsRelation="1" />
|
||||
</Target>
|
||||
</Build>
|
||||
<VirtualTargets>
|
||||
<Add alias="All" targets="default;" />
|
||||
</VirtualTargets>
|
||||
<Compiler>
|
||||
<Add option="-Wall" />
|
||||
<Add option="-g" />
|
||||
<Add directory="..\..\include" />
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add library="Irrlicht" />
|
||||
<Add directory="..\..\lib\gcc" />
|
||||
</Linker>
|
||||
<Unit filename="main.cpp" />
|
||||
<Extensions>
|
||||
<code_completion />
|
||||
<debugger />
|
||||
</Extensions>
|
||||
</Project>
|
||||
</CodeBlocks_project_file>
|
|
@ -1,32 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<!DOCTYPE CodeBlocks_project_file>
|
||||
<CodeBlocks_project_file>
|
||||
<FileVersion major="1" minor="1"/>
|
||||
<Project>
|
||||
<Option title="Irrlicht Example 11 Per-Pixel Lighting"/>
|
||||
<Option makefile="Makefile"/>
|
||||
<Option makefile_is_custom="0"/>
|
||||
<Option compiler="0"/>
|
||||
<Build>
|
||||
<Target title="default">
|
||||
<Option output="..\..\bin\Win32-gcc\11.PerPixelLighting.exe"/>
|
||||
<Option working_dir="."/>
|
||||
<Option object_output=".objs"/>
|
||||
<Option deps_output=".deps"/>
|
||||
<Option type="1"/>
|
||||
<Option compiler="0"/>
|
||||
<Option projectResourceIncludeDirsRelation="1"/>
|
||||
</Target>
|
||||
</Build>
|
||||
<Compiler>
|
||||
<Add directory="..\..\include"/>
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add option="../../lib/Win32-gcc/libIrrlicht.a"/>
|
||||
</Linker>
|
||||
<Unit filename="main.cpp">
|
||||
<Option compilerVar="CPP"/>
|
||||
<Option target="default"/>
|
||||
</Unit>
|
||||
</Project>
|
||||
</CodeBlocks_project_file>
|
|
@ -0,0 +1,34 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||
<CodeBlocks_project_file>
|
||||
<FileVersion major="1" minor="6" />
|
||||
<Project>
|
||||
<Option title="Irrlicht Example 12 Terrain Rendering" />
|
||||
<Option pch_mode="0" />
|
||||
<Option compiler="gcc" />
|
||||
<Build>
|
||||
<Target title="default">
|
||||
<Option output="..\..\bin\gcc\TerrainRendering" prefix_auto="0" extension_auto="1" />
|
||||
<Option type="1" />
|
||||
<Option compiler="gcc" />
|
||||
<Option projectResourceIncludeDirsRelation="1" />
|
||||
</Target>
|
||||
</Build>
|
||||
<VirtualTargets>
|
||||
<Add alias="All" targets="default;" />
|
||||
</VirtualTargets>
|
||||
<Compiler>
|
||||
<Add option="-Wall" />
|
||||
<Add option="-g" />
|
||||
<Add directory="..\..\include" />
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add library="Irrlicht" />
|
||||
<Add directory="..\..\lib\gcc" />
|
||||
</Linker>
|
||||
<Unit filename="main.cpp" />
|
||||
<Extensions>
|
||||
<code_completion />
|
||||
<debugger />
|
||||
</Extensions>
|
||||
</Project>
|
||||
</CodeBlocks_project_file>
|
|
@ -1,32 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<!DOCTYPE CodeBlocks_project_file>
|
||||
<CodeBlocks_project_file>
|
||||
<FileVersion major="1" minor="1"/>
|
||||
<Project>
|
||||
<Option title="Irrlicht Example 12 Terrain Rendering"/>
|
||||
<Option makefile="Makefile"/>
|
||||
<Option makefile_is_custom="0"/>
|
||||
<Option compiler="0"/>
|
||||
<Build>
|
||||
<Target title="default">
|
||||
<Option output="..\..\bin\Win32-gcc\12.TerrainRendering.exe"/>
|
||||
<Option working_dir="."/>
|
||||
<Option object_output=".objs"/>
|
||||
<Option deps_output=".deps"/>
|
||||
<Option type="1"/>
|
||||
<Option compiler="0"/>
|
||||
<Option projectResourceIncludeDirsRelation="1"/>
|
||||
</Target>
|
||||
</Build>
|
||||
<Compiler>
|
||||
<Add directory="..\..\include"/>
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add option="../../lib/Win32-gcc/libIrrlicht.a"/>
|
||||
</Linker>
|
||||
<Unit filename="main.cpp">
|
||||
<Option compilerVar="CPP"/>
|
||||
<Option target="default"/>
|
||||
</Unit>
|
||||
</Project>
|
||||
</CodeBlocks_project_file>
|
|
@ -208,6 +208,14 @@ int main()
|
|||
camera->addAnimator(anim);
|
||||
anim->drop();
|
||||
|
||||
/* If you need access to the terrain data you can also do this directly via the following code fragment.
|
||||
*/
|
||||
scene::CDynamicMeshBuffer* buffer = new scene::CDynamicMeshBuffer(video::EVT_2TCOORDS, video::EIT_16BIT);
|
||||
terrain->getMeshBufferForLOD(*buffer, 0);
|
||||
video::S3DVertex2TCoords* data = (video::S3DVertex2TCoords*)buffer->getVertexBuffer().getData();
|
||||
// Work on data or get the IndexBuffer with a similar call.
|
||||
buffer->drop(); // When done drop the buffer again.
|
||||
|
||||
/*
|
||||
To make the user be able to switch between normal and wireframe mode,
|
||||
we create an instance of the event reciever from above and let Irrlicht
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||
<CodeBlocks_project_file>
|
||||
<FileVersion major="1" minor="6" />
|
||||
<Project>
|
||||
<Option title="Irrlicht Example 13 Render to Texture" />
|
||||
<Option pch_mode="0" />
|
||||
<Option compiler="gcc" />
|
||||
<Build>
|
||||
<Target title="default">
|
||||
<Option output="..\..\bin\gcc\RenderToTexture" prefix_auto="0" extension_auto="1" />
|
||||
<Option type="1" />
|
||||
<Option compiler="gcc" />
|
||||
<Option projectResourceIncludeDirsRelation="1" />
|
||||
</Target>
|
||||
</Build>
|
||||
<VirtualTargets>
|
||||
<Add alias="All" targets="default;" />
|
||||
</VirtualTargets>
|
||||
<Compiler>
|
||||
<Add option="-Wall" />
|
||||
<Add option="-g" />
|
||||
<Add directory="..\..\include" />
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add library="Irrlicht" />
|
||||
<Add directory="..\..\lib\gcc" />
|
||||
</Linker>
|
||||
<Unit filename="main.cpp" />
|
||||
<Extensions>
|
||||
<code_completion />
|
||||
<debugger />
|
||||
</Extensions>
|
||||
</Project>
|
||||
</CodeBlocks_project_file>
|
|
@ -1,32 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<!DOCTYPE CodeBlocks_project_file>
|
||||
<CodeBlocks_project_file>
|
||||
<FileVersion major="1" minor="1"/>
|
||||
<Project>
|
||||
<Option title="Irrlicht Example 13 Render to Texture"/>
|
||||
<Option makefile="Makefile"/>
|
||||
<Option makefile_is_custom="0"/>
|
||||
<Option compiler="0"/>
|
||||
<Build>
|
||||
<Target title="default">
|
||||
<Option output="..\..\bin\Win32-gcc\13.RenderToTexture.exe"/>
|
||||
<Option working_dir="."/>
|
||||
<Option object_output=".objs"/>
|
||||
<Option deps_output=".deps"/>
|
||||
<Option type="1"/>
|
||||
<Option compiler="0"/>
|
||||
<Option projectResourceIncludeDirsRelation="1"/>
|
||||
</Target>
|
||||
</Build>
|
||||
<Compiler>
|
||||
<Add directory="..\..\include"/>
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add option="../../lib/Win32-gcc/libIrrlicht.a"/>
|
||||
</Linker>
|
||||
<Unit filename="main.cpp">
|
||||
<Option compilerVar="CPP"/>
|
||||
<Option target="default"/>
|
||||
</Unit>
|
||||
</Project>
|
||||
</CodeBlocks_project_file>
|
|
@ -0,0 +1,36 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||
<CodeBlocks_project_file>
|
||||
<FileVersion major="1" minor="6" />
|
||||
<Project>
|
||||
<Option title="Irrlicht Example 14 Win32 Window" />
|
||||
<Option platforms="Windows;" />
|
||||
<Option pch_mode="0" />
|
||||
<Option compiler="gcc" />
|
||||
<Build>
|
||||
<Target title="default">
|
||||
<Option output="..\..\bin\gcc\Win32Window" prefix_auto="0" extension_auto="1" />
|
||||
<Option type="1" />
|
||||
<Option compiler="gcc" />
|
||||
<Option projectResourceIncludeDirsRelation="1" />
|
||||
</Target>
|
||||
</Build>
|
||||
<VirtualTargets>
|
||||
<Add alias="All" targets="default;" />
|
||||
</VirtualTargets>
|
||||
<Compiler>
|
||||
<Add option="-Wall" />
|
||||
<Add option="-g" />
|
||||
<Add directory="..\..\include" />
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add library="Irrlicht" />
|
||||
<Add directory="..\..\lib\gcc" />
|
||||
</Linker>
|
||||
<Unit filename="main.cpp" />
|
||||
<Extensions>
|
||||
<code_completion />
|
||||
<debugger />
|
||||
<envvars />
|
||||
</Extensions>
|
||||
</Project>
|
||||
</CodeBlocks_project_file>
|
|
@ -1,32 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<!DOCTYPE CodeBlocks_project_file>
|
||||
<CodeBlocks_project_file>
|
||||
<FileVersion major="1" minor="1"/>
|
||||
<Project>
|
||||
<Option title="Irrlicht Example 14 Win32 Window"/>
|
||||
<Option makefile="Makefile"/>
|
||||
<Option makefile_is_custom="0"/>
|
||||
<Option compiler="0"/>
|
||||
<Build>
|
||||
<Target title="default">
|
||||
<Option output="..\..\bin\Win32-gcc\14.Win32Window.exe"/>
|
||||
<Option working_dir="."/>
|
||||
<Option object_output=".objs"/>
|
||||
<Option deps_output=".deps"/>
|
||||
<Option type="1"/>
|
||||
<Option compiler="0"/>
|
||||
<Option projectResourceIncludeDirsRelation="1"/>
|
||||
</Target>
|
||||
</Build>
|
||||
<Compiler>
|
||||
<Add directory="..\..\include"/>
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add option="../../lib/Win32-gcc/libIrrlicht.a"/>
|
||||
</Linker>
|
||||
<Unit filename="main.cpp">
|
||||
<Option compilerVar="CPP"/>
|
||||
<Option target="default"/>
|
||||
</Unit>
|
||||
</Project>
|
||||
</CodeBlocks_project_file>
|
|
@ -0,0 +1,38 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||
<CodeBlocks_project_file>
|
||||
<FileVersion major="1" minor="6" />
|
||||
<Project>
|
||||
<Option title="Irrlicht Example 15 Load .irr File" />
|
||||
<Option pch_mode="0" />
|
||||
<Option compiler="gcc" />
|
||||
<Build>
|
||||
<Target title="default">
|
||||
<Option output="..\..\bin\gcc\LoadIrrFile" prefix_auto="0" extension_auto="1" />
|
||||
<Option type="1" />
|
||||
<Option compiler="gcc" />
|
||||
<Option projectResourceIncludeDirsRelation="1" />
|
||||
<Compiler>
|
||||
<Add option="-Wall" />
|
||||
<Add option="-g" />
|
||||
</Compiler>
|
||||
</Target>
|
||||
</Build>
|
||||
<VirtualTargets>
|
||||
<Add alias="All" targets="default;" />
|
||||
</VirtualTargets>
|
||||
<Compiler>
|
||||
<Add option="-Wall" />
|
||||
<Add option="-g" />
|
||||
<Add directory="..\..\include" />
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add library="Irrlicht" />
|
||||
<Add directory="..\..\lib\gcc" />
|
||||
</Linker>
|
||||
<Unit filename="main.cpp" />
|
||||
<Extensions>
|
||||
<code_completion />
|
||||
<debugger />
|
||||
</Extensions>
|
||||
</Project>
|
||||
</CodeBlocks_project_file>
|
|
@ -1,32 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<!DOCTYPE CodeBlocks_project_file>
|
||||
<CodeBlocks_project_file>
|
||||
<FileVersion major="1" minor="1"/>
|
||||
<Project>
|
||||
<Option title="Irrlicht Example 15 Load .irr File"/>
|
||||
<Option makefile="Makefile"/>
|
||||
<Option makefile_is_custom="0"/>
|
||||
<Option compiler="0"/>
|
||||
<Build>
|
||||
<Target title="default">
|
||||
<Option output="..\..\bin\Win32-gcc\02.LoadIrrFile.exe"/>
|
||||
<Option working_dir="."/>
|
||||
<Option object_output=".objs"/>
|
||||
<Option deps_output=".deps"/>
|
||||
<Option type="1"/>
|
||||
<Option compiler="0"/>
|
||||
<Option projectResourceIncludeDirsRelation="1"/>
|
||||
</Target>
|
||||
</Build>
|
||||
<Compiler>
|
||||
<Add directory="..\..\include"/>
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add option="../../lib/Win32-gcc/libIrrlicht.a"/>
|
||||
</Linker>
|
||||
<Unit filename="main.cpp">
|
||||
<Option compilerVar="CPP"/>
|
||||
<Option target="default"/>
|
||||
</Unit>
|
||||
</Project>
|
||||
</CodeBlocks_project_file>
|
|
@ -0,0 +1,34 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||
<CodeBlocks_project_file>
|
||||
<FileVersion major="1" minor="6" />
|
||||
<Project>
|
||||
<Option title="Irrlicht Example 16 Quake 3 Map Shader" />
|
||||
<Option pch_mode="0" />
|
||||
<Option compiler="gcc" />
|
||||
<Build>
|
||||
<Target title="default">
|
||||
<Option output="..\..\bin\gcc\LoadIrrFile" prefix_auto="0" extension_auto="1" />
|
||||
<Option type="1" />
|
||||
<Option compiler="gcc" />
|
||||
<Option projectResourceIncludeDirsRelation="1" />
|
||||
</Target>
|
||||
</Build>
|
||||
<VirtualTargets>
|
||||
<Add alias="All" targets="default;" />
|
||||
</VirtualTargets>
|
||||
<Compiler>
|
||||
<Add option="-Wall" />
|
||||
<Add option="-g" />
|
||||
<Add directory="..\..\include" />
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add library="Irrlicht" />
|
||||
<Add directory="..\..\lib\gcc" />
|
||||
</Linker>
|
||||
<Unit filename="main.cpp" />
|
||||
<Extensions>
|
||||
<code_completion />
|
||||
<debugger />
|
||||
</Extensions>
|
||||
</Project>
|
||||
</CodeBlocks_project_file>
|
|
@ -0,0 +1,34 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||
<CodeBlocks_project_file>
|
||||
<FileVersion major="1" minor="6" />
|
||||
<Project>
|
||||
<Option title="Irrlicht Example 18 Split Screen" />
|
||||
<Option pch_mode="0" />
|
||||
<Option compiler="gcc" />
|
||||
<Build>
|
||||
<Target title="default">
|
||||
<Option output="..\..\bin\gcc\LoadIrrFile" prefix_auto="0" extension_auto="1" />
|
||||
<Option type="1" />
|
||||
<Option compiler="gcc" />
|
||||
<Option projectResourceIncludeDirsRelation="1" />
|
||||
</Target>
|
||||
</Build>
|
||||
<VirtualTargets>
|
||||
<Add alias="All" targets="default;" />
|
||||
</VirtualTargets>
|
||||
<Compiler>
|
||||
<Add option="-Wall" />
|
||||
<Add option="-g" />
|
||||
<Add directory="..\..\include" />
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add library="Irrlicht" />
|
||||
<Add directory="..\..\lib\gcc" />
|
||||
</Linker>
|
||||
<Unit filename="main.cpp" />
|
||||
<Extensions>
|
||||
<code_completion />
|
||||
<debugger />
|
||||
</Extensions>
|
||||
</Project>
|
||||
</CodeBlocks_project_file>
|
|
@ -93,7 +93,7 @@ int main()
|
|||
case 'e': driverType = video::EDT_BURNINGSVIDEO;break;
|
||||
case 'f': driverType = video::EDT_NULL; break;
|
||||
default: return 1;
|
||||
}
|
||||
}
|
||||
|
||||
//Instance of the EventReceiver
|
||||
MyEventReceiver receiver;
|
||||
|
@ -240,10 +240,11 @@ Sounds a little complicated, but you'll see it isn't:
|
|||
//Get and show fps
|
||||
if (driver->getFPS() != lastFPS)
|
||||
{
|
||||
lastFPS = driver->getFPS();
|
||||
wchar_t tmp[1024];
|
||||
swprintf( tmp, 1024, L"Irrlicht SplitScreen-Example (FPS: %d)", lastFPS);
|
||||
device->setWindowCaption(tmp);
|
||||
lastFPS = driver->getFPS();
|
||||
core::stringw tmp = L"Irrlicht SplitScreen-Example (FPS: ";
|
||||
tmp += lastFPS;
|
||||
tmp += ")";
|
||||
device->setWindowCaption(tmp.c_str());
|
||||
}
|
||||
}
|
||||
//Delete device
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||
<CodeBlocks_project_file>
|
||||
<FileVersion major="1" minor="6" />
|
||||
<Project>
|
||||
<Option title="Irrlicht Example 19 MouseAndJoystick" />
|
||||
<Option pch_mode="0" />
|
||||
<Option compiler="gcc" />
|
||||
<Build>
|
||||
<Target title="default">
|
||||
<Option output="..\..\bin\gcc\MouseAndJoystick" prefix_auto="0" extension_auto="1" />
|
||||
<Option type="1" />
|
||||
<Option compiler="gcc" />
|
||||
<Option projectResourceIncludeDirsRelation="1" />
|
||||
<Compiler>
|
||||
<Add option="-Wall" />
|
||||
<Add option="-g" />
|
||||
</Compiler>
|
||||
</Target>
|
||||
</Build>
|
||||
<VirtualTargets>
|
||||
<Add alias="All" targets="default;" />
|
||||
</VirtualTargets>
|
||||
<Compiler>
|
||||
<Add option="-Wall" />
|
||||
<Add option="-g" />
|
||||
<Add directory="..\..\include" />
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add library="Irrlicht" />
|
||||
<Add directory="..\..\lib\gcc" />
|
||||
</Linker>
|
||||
<Unit filename="main.cpp" />
|
||||
<Extensions>
|
||||
<code_completion />
|
||||
<debugger />
|
||||
</Extensions>
|
||||
</Project>
|
||||
</CodeBlocks_project_file>
|
|
@ -1,32 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<!DOCTYPE CodeBlocks_project_file>
|
||||
<CodeBlocks_project_file>
|
||||
<FileVersion major="1" minor="1"/>
|
||||
<Project>
|
||||
<Option title="Irrlicht Example 04 MouseAndJoystick"/>
|
||||
<Option makefile="Makefile"/>
|
||||
<Option makefile_is_custom="0"/>
|
||||
<Option compiler="0"/>
|
||||
<Build>
|
||||
<Target title="default">
|
||||
<Option output="..\..\bin\Win32-gcc\19.MouseAndJoystick.exe"/>
|
||||
<Option working_dir="."/>
|
||||
<Option object_output=".objs"/>
|
||||
<Option deps_output=".deps"/>
|
||||
<Option type="1"/>
|
||||
<Option compiler="0"/>
|
||||
<Option projectResourceIncludeDirsRelation="1"/>
|
||||
</Target>
|
||||
</Build>
|
||||
<Compiler>
|
||||
<Add directory="..\..\include"/>
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add option="../../lib/Win32-gcc/libIrrlicht.a"/>
|
||||
</Linker>
|
||||
<Unit filename="main.cpp">
|
||||
<Option compilerVar="CPP"/>
|
||||
<Option target="default"/>
|
||||
</Unit>
|
||||
</Project>
|
||||
</CodeBlocks_project_file>
|
|
@ -123,7 +123,7 @@ int main()
|
|||
case 'e': driverType = video::EDT_BURNINGSVIDEO;break;
|
||||
case 'f': driverType = video::EDT_NULL; break;
|
||||
default: return 0;
|
||||
}
|
||||
}
|
||||
|
||||
// create device
|
||||
MyEventReceiver receiver;
|
||||
|
@ -171,9 +171,10 @@ int main()
|
|||
std::cout << "Joystick support is not enabled." << std::endl;
|
||||
}
|
||||
|
||||
wchar_t tmp[1024];
|
||||
swprintf(tmp, 1024, L"Irrlicht Joystick Example (%u joysticks)", joystickInfo.size());
|
||||
device->setWindowCaption(tmp);
|
||||
core::stringw tmp = L"Irrlicht Joystick Example (";
|
||||
tmp += joystickInfo.size();
|
||||
tmp += " joysticks)";
|
||||
device->setWindowCaption(tmp.c_str());
|
||||
|
||||
video::IVideoDriver* driver = device->getVideoDriver();
|
||||
scene::ISceneManager* smgr = device->getSceneManager();
|
||||
|
@ -209,12 +210,12 @@ int main()
|
|||
const SEvent::SJoystickEvent & joystickData = receiver.GetJoystickState();
|
||||
|
||||
// Use the analog range of the axes, and a 5% dead zone
|
||||
moveHorizontal =
|
||||
moveHorizontal =
|
||||
(f32)joystickData.Axis[SEvent::SJoystickEvent::AXIS_X] / 32767.f;
|
||||
if(fabs(moveHorizontal) < 0.05f)
|
||||
moveHorizontal = 0.f;
|
||||
|
||||
moveVertical =
|
||||
moveVertical =
|
||||
(f32)joystickData.Axis[SEvent::SJoystickEvent::AXIS_Y] / -32767.f;
|
||||
if(fabs(moveVertical) < 0.05f)
|
||||
moveVertical = 0.f;
|
||||
|
@ -267,12 +268,9 @@ int main()
|
|||
}
|
||||
|
||||
node->setPosition(nodePosition);
|
||||
|
||||
|
||||
// Turn lighting on and off depending on whether the left mouse button is down.
|
||||
if(receiver.GetMouseState().LeftButtonDown)
|
||||
node->setMaterialFlag(video::EMF_LIGHTING, true);
|
||||
else
|
||||
node->setMaterialFlag(video::EMF_LIGHTING, false);
|
||||
node->setMaterialFlag(video::EMF_LIGHTING, receiver.GetMouseState().LeftButtonDown);
|
||||
|
||||
driver->beginScene(true, true, video::SColor(255,113,113,133));
|
||||
smgr->drawAll(); // draw the 3d scene
|
||||
|
@ -283,6 +281,6 @@ int main()
|
|||
In the end, delete the Irrlicht device.
|
||||
*/
|
||||
device->drop();
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||
<CodeBlocks_workspace_file>
|
||||
<Workspace title="Build all examples">
|
||||
<Project filename="01.HelloWorld\HelloWorld.cbp" active="1" />
|
||||
<Project filename="02.Quake3Map\Quake3Map.cbp" />
|
||||
<Project filename="03.CustomSceneNode\CustomSceneNode.cbp" />
|
||||
<Project filename="04.Movement\Movement.cbp" />
|
||||
<Project filename="05.UserInterface\UserInterface.cbp" />
|
||||
<Project filename="06.2DGraphics\2DGraphics.cbp" />
|
||||
<Project filename="07.Collision\Collision.cbp" />
|
||||
<Project filename="08.SpecialFX\SpecialFX.cbp" />
|
||||
<Project filename="09.Meshviewer\Meshviewer.cbp" />
|
||||
<Project filename="10.Shaders\Shaders.cbp" />
|
||||
<Project filename="11.PerPixelLighting\PerPixelLighting.cbp" />
|
||||
<Project filename="12.TerrainRendering\TerrainRendering.cbp" />
|
||||
<Project filename="13.RenderToTexture\RenderToTexture.cbp" />
|
||||
<Project filename="14.Win32Window\Win32Window.cbp" />
|
||||
<Project filename="15.LoadIrrFile\LoadIrrFile.cbp" />
|
||||
<Project filename="16.Quake3MapShader\Quake3MapShader.cbp" />
|
||||
<Project filename="18.SplitScreen\SplitScreen.cbp" />
|
||||
<Project filename="19.MouseAndJoystick\MouseAndJoystick.cbp" />
|
||||
<Project filename="Demo\demo.cbp" />
|
||||
<Project filename="..\source\Irrlicht\Irrlicht-gcc.cbp" />
|
||||
</Workspace>
|
||||
</CodeBlocks_workspace_file>
|
|
@ -1,63 +1,42 @@
|
|||
<?xml version="1.0"?>
|
||||
<!DOCTYPE CodeBlocks_project_file>
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||
<CodeBlocks_project_file>
|
||||
<FileVersion major="1" minor="1"/>
|
||||
<FileVersion major="1" minor="6" />
|
||||
<Project>
|
||||
<Option title="Irrlicht Tech Demo"/>
|
||||
<Option makefile="Makefile"/>
|
||||
<Option makefile_is_custom="0"/>
|
||||
<Option compiler="0"/>
|
||||
<Option title="Irrlicht Tech Demo" />
|
||||
<Option pch_mode="0" />
|
||||
<Option compiler="gcc" />
|
||||
<Build>
|
||||
<Target title="default">
|
||||
<Option output="..\..\bin\Win32-gcc\Demo.exe"/>
|
||||
<Option working_dir="."/>
|
||||
<Option object_output=".objs"/>
|
||||
<Option deps_output=".deps"/>
|
||||
<Option type="1"/>
|
||||
<Option compiler="0"/>
|
||||
<Option projectResourceIncludeDirsRelation="1"/>
|
||||
<Option output="..\..\bin\gcc\Demo" prefix_auto="0" extension_auto="1" />
|
||||
<Option type="1" />
|
||||
<Option compiler="gcc" />
|
||||
<Option projectResourceIncludeDirsRelation="1" />
|
||||
</Target>
|
||||
</Build>
|
||||
<VirtualTargets>
|
||||
<Add alias="All" targets="default;" />
|
||||
</VirtualTargets>
|
||||
<Compiler>
|
||||
<Add directory="..\..\include"/>
|
||||
<Add option="-Wall" />
|
||||
<Add option="-g" />
|
||||
<Add directory="..\..\include" />
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add option="../../lib/Win32-gcc/libIrrlicht.a"/>
|
||||
<Add library="Irrlicht" />
|
||||
<Add directory="..\..\lib\gcc" />
|
||||
</Linker>
|
||||
<Unit filename="CDemo.cpp">
|
||||
<Option compilerVar="CPP"/>
|
||||
<Option target="default"/>
|
||||
</Unit>
|
||||
<Unit filename="CDemo.h">
|
||||
<Option compilerVar="CPP"/>
|
||||
<Option compile="0"/>
|
||||
<Option link="0"/>
|
||||
<Option target="default"/>
|
||||
</Unit>
|
||||
<Unit filename="Demo\CMainMenu.cpp">
|
||||
<Option compilerVar="CPP"/>
|
||||
<Option target="default"/>
|
||||
</Unit>
|
||||
<Unit filename="CMainMenu.h">
|
||||
<Option compilerVar="CPP"/>
|
||||
<Option compile="0"/>
|
||||
<Option link="0"/>
|
||||
<Option target="default"/>
|
||||
</Unit>
|
||||
<Unit filename="resource.h">
|
||||
<Option compilerVar="CPP"/>
|
||||
<Option compile="0"/>
|
||||
<Option link="0"/>
|
||||
<Option target="default"/>
|
||||
</Unit>
|
||||
<Unit filename="CDemo.cpp" />
|
||||
<Unit filename="CDemo.h" />
|
||||
<Unit filename="CMainMenu.h" />
|
||||
<Unit filename="Demo\CMainMenu.cpp" />
|
||||
<Unit filename="main.cpp" />
|
||||
<Unit filename="resource.h" />
|
||||
<Unit filename="resscript.rc">
|
||||
<Option compilerVar="CPP"/>
|
||||
<Option objectName="irrlicht-svnnew\irrlicht\examples\Demo\resscript.res"/>
|
||||
<Option target="default"/>
|
||||
</Unit>
|
||||
<Unit filename="main.cpp">
|
||||
<Option compilerVar="CPP"/>
|
||||
<Option target="default"/>
|
||||
<Option compilerVar="CPP" />
|
||||
</Unit>
|
||||
<Extensions>
|
||||
<code_completion />
|
||||
<debugger />
|
||||
</Extensions>
|
||||
</Project>
|
||||
</CodeBlocks_project_file>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#! /bin/sh
|
||||
#! /bin/bash
|
||||
[ -z $1 ] || TARGET=$1
|
||||
[ -z $TARGET ] && TARGET=all
|
||||
for i in [01]* Demo; do
|
||||
|
|
|
@ -72,12 +72,15 @@ namespace scene
|
|||
public:
|
||||
IVertexList *Vertices;
|
||||
|
||||
CVertexBuffer(video::E_VERTEX_TYPE vertexType) :Vertices(0), MappingHint(EHM_NEVER), ChangedID(1)
|
||||
CVertexBuffer(video::E_VERTEX_TYPE vertexType) : Vertices(0),
|
||||
MappingHint(EHM_NEVER), ChangedID(1)
|
||||
{
|
||||
setType(vertexType);
|
||||
}
|
||||
|
||||
CVertexBuffer(const IVertexBuffer &VertexBufferCopy) :Vertices(0), MappingHint(EHM_NEVER), ChangedID(1)
|
||||
CVertexBuffer(const IVertexBuffer &VertexBufferCopy) :
|
||||
Vertices(0), MappingHint(EHM_NEVER),
|
||||
ChangedID(1)
|
||||
{
|
||||
setType(VertexBufferCopy.getType());
|
||||
reallocate(VertexBufferCopy.size());
|
||||
|
@ -91,7 +94,6 @@ namespace scene
|
|||
delete Vertices;
|
||||
}
|
||||
|
||||
//virtual void setType(video::E_VERTEX_TYPE vertexType);
|
||||
|
||||
virtual void setType(video::E_VERTEX_TYPE vertexType)
|
||||
{
|
||||
|
|
|
@ -15,10 +15,10 @@ namespace scene
|
|||
struct SViewFrustum;
|
||||
|
||||
//! Scene Node which is a (controlable) camera.
|
||||
/** The whole scene will be
|
||||
rendered from the cameras point of view. Because the ICameraScenNode
|
||||
is a SceneNode, it can be attached to any other scene node, and will
|
||||
follow its parents movement, rotation and so on.
|
||||
/** The whole scene will be rendered from the cameras point of view.
|
||||
Because the ICameraScenNode is a SceneNode, it can be attached to any
|
||||
other scene node, and will follow its parents movement, rotation and so
|
||||
on.
|
||||
*/
|
||||
class ICameraSceneNode : public ISceneNode, public IEventReceiver
|
||||
{
|
||||
|
@ -32,13 +32,16 @@ namespace scene
|
|||
: ISceneNode(parent, mgr, id, position, rotation, scale), IsOrthogonal(false) {}
|
||||
|
||||
//! Sets the projection matrix of the camera.
|
||||
/** The core::matrix4 class has some methods
|
||||
to build a projection matrix. e.g: core::matrix4::buildProjectionMatrixPerspectiveFovLH.
|
||||
Note that the matrix will only stay as set by this method until one of
|
||||
the following Methods are called: setNearValue, setFarValue, setAspectRatio, setFOV.
|
||||
/** The core::matrix4 class has some methods to build a
|
||||
projection matrix. e.g:
|
||||
core::matrix4::buildProjectionMatrixPerspectiveFovLH.
|
||||
Note that the matrix will only stay as set by this method until
|
||||
one of the following Methods are called: setNearValue,
|
||||
setFarValue, setAspectRatio, setFOV.
|
||||
\param projection The new projection matrix of the camera.
|
||||
\param isOrthogonal Set this to true if the matrix is an
|
||||
orthogonal one (e.g. from matrix4::buildProjectionMatrixOrtho... */
|
||||
orthogonal one (e.g. from matrix4::buildProjectionMatrixOrtho).
|
||||
*/
|
||||
virtual void setProjectionMatrix(const core::matrix4& projection, bool isOrthogonal = false) = 0;
|
||||
|
||||
//! Gets the current projection matrix of the camera.
|
||||
|
@ -52,8 +55,8 @@ namespace scene
|
|||
//! It is possible to send mouse and key events to the camera.
|
||||
/** Most cameras may ignore this input, but camera scene nodes
|
||||
which are created for example with
|
||||
ISceneManager::addMayaCameraSceneNode or
|
||||
ISceneManager::addMeshViewerCameraSceneNode, may want to get
|
||||
ISceneManager::addCameraSceneNodeMaya or
|
||||
ISceneManager::addCameraSceneNodeFPS, may want to get
|
||||
this input for changing their position, look at target or
|
||||
whatever. */
|
||||
virtual bool OnEvent(const SEvent& event) = 0;
|
||||
|
@ -67,8 +70,9 @@ namespace scene
|
|||
|
||||
//! Sets the rotation of the node.
|
||||
/** This only modifies the relative rotation of the node.
|
||||
If the camera's target and rotation are bound ( @see bindTargetAndRotation() )
|
||||
then calling this will also change the camera's target to match the rotation.
|
||||
If the camera's target and rotation are bound ( @see
|
||||
bindTargetAndRotation() ) then calling this will also change
|
||||
the camera's target to match the rotation.
|
||||
\param rotation New rotation of the node in degrees. */
|
||||
virtual void setRotation(const core::vector3df& rotation) = 0;
|
||||
|
||||
|
@ -122,8 +126,8 @@ namespace scene
|
|||
virtual const SViewFrustum* getViewFrustum() const = 0;
|
||||
|
||||
//! Disables or enables the camera to get key or mouse inputs.
|
||||
/** If this is set to true, the camera will respond to key inputs
|
||||
otherwise not. */
|
||||
/** If this is set to true, the camera will respond to key
|
||||
inputs otherwise not. */
|
||||
virtual void setInputReceiverEnabled(bool enabled) = 0;
|
||||
|
||||
//! Checks if the input receiver of the camera is currently enabled.
|
||||
|
@ -137,10 +141,13 @@ namespace scene
|
|||
}
|
||||
|
||||
//! Binds the camera scene node's rotation to its target position and vice vera, or unbinds them.
|
||||
/** When bound, calling setRotation() will update the camera's target position to be along
|
||||
its +Z axis, and likewise calling setTarget() will update its rotation so that its +Z axis
|
||||
will point at the target point. FPS camera use this binding by default; other cameras do not.
|
||||
\param binding true to bind the camera's scene node rotation and targetting, false to unbind them.
|
||||
/** When bound, calling setRotation() will update the camera's
|
||||
target position to be along its +Z axis, and likewise calling
|
||||
setTarget() will update its rotation so that its +Z axis will
|
||||
point at the target point. FPS camera use this binding by
|
||||
default; other cameras do not.
|
||||
\param binding true to bind the camera's scene node rotation
|
||||
and targetting, false to unbind them.
|
||||
@see getTargetAndRotationBinding() */
|
||||
virtual void bindTargetAndRotation(bool bound) = 0;
|
||||
|
||||
|
|
|
@ -156,7 +156,7 @@ namespace scene
|
|||
* <TR>
|
||||
* <TD>3D Studio (.3ds)</TD>
|
||||
* <TD>Loader for 3D-Studio files which lots of 3D packages
|
||||
* are able to export. Only static meshes are currently
|
||||
* are able to export. Only static meshes are currently
|
||||
* supported by this importer. </TD>
|
||||
* </TR>
|
||||
* <TR>
|
||||
|
@ -170,7 +170,7 @@ namespace scene
|
|||
* architecture and calculating lighting. Irrlicht can
|
||||
* directly import .csm files thanks to the IrrCSM library
|
||||
* created by Saurav Mohapatra which is now integrated
|
||||
* directly in Irrlicht. If you are using this loader,
|
||||
* directly in Irrlicht. If you are using this loader,
|
||||
* please note that you'll have to set the path of the
|
||||
* textures before loading .csm files. You can do this
|
||||
* using
|
||||
|
@ -180,52 +180,51 @@ namespace scene
|
|||
* <TR>
|
||||
* <TD>COLLADA (.dae, .xml)</TD>
|
||||
* <TD>COLLADA is an open Digital Asset Exchange Schema for
|
||||
* the interactive 3D industry. There are exporters and
|
||||
* importers for this format available for most of the
|
||||
* big 3d packagesat http://collada.org. Irrlicht can
|
||||
* import COLLADA files by using the
|
||||
* ISceneManager::getMesh() method. COLLADA files need
|
||||
* not contain only one single mesh but multiple meshes
|
||||
* and a whole scene setup with lights, cameras and mesh
|
||||
* instances, this loader can set up a scene as
|
||||
* described by the COLLADA file instead of loading and
|
||||
* returning one single mesh. By default, this loader
|
||||
* behaves like the other loaders and does not create
|
||||
* instances, but it can be switched into this mode by
|
||||
* using
|
||||
* SceneManager->getParameters()->setParameter(COLLADA_CREATE_SCENE_INSTANCES, true);
|
||||
* Created scene nodes will be named as the names of the
|
||||
* nodes in the COLLADA file. The returned mesh is just
|
||||
* a dummy object in this mode. Meshes included in the
|
||||
* scene will be added into the scene manager with the
|
||||
* following naming scheme:
|
||||
* path/to/file/file.dea#meshname. The loading of such
|
||||
* meshes is logged. Currently, this loader is able to
|
||||
* create meshes (made of only polygons), lights, and
|
||||
* cameras. Materials and animations are currently not
|
||||
* supported but this will change with future releases.
|
||||
* the interactive 3D industry. There are exporters and
|
||||
* importers for this format available for most of the
|
||||
* big 3d packagesat http://collada.org. Irrlicht can
|
||||
* import COLLADA files by using the
|
||||
* ISceneManager::getMesh() method. COLLADA files need
|
||||
* not contain only one single mesh but multiple meshes
|
||||
* and a whole scene setup with lights, cameras and mesh
|
||||
* instances, this loader can set up a scene as
|
||||
* described by the COLLADA file instead of loading and
|
||||
* returning one single mesh. By default, this loader
|
||||
* behaves like the other loaders and does not create
|
||||
* instances, but it can be switched into this mode by
|
||||
* using
|
||||
* SceneManager->getParameters()->setParameter(COLLADA_CREATE_SCENE_INSTANCES, true);
|
||||
* Created scene nodes will be named as the names of the
|
||||
* nodes in the COLLADA file. The returned mesh is just
|
||||
* a dummy object in this mode. Meshes included in the
|
||||
* scene will be added into the scene manager with the
|
||||
* following naming scheme:
|
||||
* path/to/file/file.dea#meshname. The loading of such
|
||||
* meshes is logged. Currently, this loader is able to
|
||||
* create meshes (made of only polygons), lights, and
|
||||
* cameras. Materials and animations are currently not
|
||||
* supported but this will change with future releases.
|
||||
* </TD>
|
||||
* </TR>
|
||||
* <TR>
|
||||
* <TD>Delgine DeleD (.dmf)</TD>
|
||||
* <TD>DeleD (delgine.com) is a 3D editor and level-editor
|
||||
* combined into one and is specifically designed for 3D
|
||||
* game-development. With this loader, it is possible to
|
||||
* directly load all geometry is as well as textures and
|
||||
* lightmaps from .dmf files. To set texture and
|
||||
* material paths, see scene::DMF_USE_MATERIALS_DIRS and
|
||||
* scene::DMF_TEXTURE_PATH. It is also possible to flip
|
||||
* the alpha texture by setting
|
||||
* scene::DMF_FLIP_ALPHA_TEXTURES to true and to set the
|
||||
* material transparent reference value by setting
|
||||
* scene::DMF_ALPHA_CHANNEL_REF to a float between 0 and
|
||||
* 1. The loader is based on Salvatore Russo's .dmf
|
||||
* loader, I just changed some parts of it. Thanks to
|
||||
* Salvatore for his work and for allowing me to use his
|
||||
* code in Irrlicht and put it under Irrlicht's license.
|
||||
* For newer and more enchanced versions of the loader,
|
||||
* take a look at delgine.com.
|
||||
* </TD>
|
||||
* combined into one and is specifically designed for 3D
|
||||
* game-development. With this loader, it is possible to
|
||||
* directly load all geometry is as well as textures and
|
||||
* lightmaps from .dmf files. To set texture and
|
||||
* material paths, see scene::DMF_USE_MATERIALS_DIRS and
|
||||
* scene::DMF_TEXTURE_PATH. It is also possible to flip
|
||||
* the alpha texture by setting
|
||||
* scene::DMF_FLIP_ALPHA_TEXTURES to true and to set the
|
||||
* material transparent reference value by setting
|
||||
* scene::DMF_ALPHA_CHANNEL_REF to a float between 0 and
|
||||
* 1. The loader is based on Salvatore Russo's .dmf
|
||||
* loader, I just changed some parts of it. Thanks to
|
||||
* Salvatore for his work and for allowing me to use his
|
||||
* code in Irrlicht and put it under Irrlicht's license.
|
||||
* For newer and more enchanced versions of the loader,
|
||||
* take a look at delgine.com.</TD>
|
||||
* </TR>
|
||||
* <TR>
|
||||
* <TD>DirectX (.x)</TD>
|
||||
|
@ -234,7 +233,7 @@ namespace scene
|
|||
* and there are several tools for them available, e.g.
|
||||
* the Maya exporter included in the DX SDK.
|
||||
* .x files can include skeletal animations and Irrlicht
|
||||
* is able to play and display them. Currently, Irrlicht
|
||||
* is able to play and display them. Currently, Irrlicht
|
||||
* only supports uncompressed .x files.</TD>
|
||||
* </TR>
|
||||
* <TR>
|
||||
|
@ -249,91 +248,90 @@ namespace scene
|
|||
* <TD>.MS3D files contain models and sometimes skeletal
|
||||
* animations from the Milkshape 3D modeling and animation
|
||||
* software. This importer for Irrlicht can display and/or
|
||||
* animate these files. </TD>
|
||||
* animate these files. </TD>
|
||||
* </TR>
|
||||
* <TR>
|
||||
* <TD>My3D (.my3d)</TD>
|
||||
* <TD>.my3D is a flexible 3D file format. The My3DTools
|
||||
* contains plug-ins to export .my3D files from several
|
||||
* 3D packages. With this built-in importer, Irrlicht
|
||||
* can read and display those files directly. This
|
||||
* loader was written by Zhuck Dimitry who also created
|
||||
* the whole My3DTools package. If you are using this
|
||||
* loader, please note that you can set the path of the
|
||||
* textures before loading .my3d files. You can do this
|
||||
* using
|
||||
* SceneManager->getParameters()->setParameter(scene::MY3D_TEXTURE_PATH,
|
||||
* "path/to/your/textures");
|
||||
* </TD>
|
||||
* </TR>
|
||||
* <TR>
|
||||
* <TD>OCT (.oct)</TD>
|
||||
* <TD>The oct file format contains 3D geometry and
|
||||
* lightmaps and can be loaded directly by Irrlicht. OCT
|
||||
* files<br> can be created by FSRad, Paul Nette's
|
||||
* radiosity processor or exported from Blender using
|
||||
* OCTTools which can be found in the exporters/OCTTools
|
||||
* directory of the SDK. Thanks to Murphy McCauley for
|
||||
* creating all this.</TD>
|
||||
* </TR>
|
||||
* <TR>
|
||||
* <TD>OGRE Meshes (.mesh)</TD>
|
||||
* <TD>Ogre .mesh files contain 3D data for the OGRE 3D
|
||||
* engine. Irrlicht can read and display them directly
|
||||
* with this importer. To define materials for the mesh,
|
||||
* copy a .material file named like the corresponding
|
||||
* .mesh file where the .mesh file is. (For example
|
||||
* ogrehead.material for ogrehead.mesh). Thanks to
|
||||
* Christian Stehno who wrote and contributed this
|
||||
* loader.</TD>
|
||||
* </TR>
|
||||
* <TR>
|
||||
* <TD>Pulsar LMTools (.lmts)</TD>
|
||||
* <TD>LMTools is a set of tools (Windows & Linux) for
|
||||
* creating lightmaps. Irrlicht can directly read .lmts
|
||||
* files thanks to<br> the importer created by Jonas
|
||||
* Petersen. If you are using this loader, please note
|
||||
* that you can set the path of the textures before
|
||||
* loading .lmts files. You can do this using
|
||||
* SceneManager->getParameters()->setParameter(scene::LMTS_TEXTURE_PATH,
|
||||
* "path/to/your/textures");
|
||||
* Notes for<br> this version of the loader:<br>
|
||||
* - It does not recognise/support user data in the
|
||||
* *.lmts files.<br>
|
||||
* - The TGAs generated by LMTools don't work in
|
||||
* Irrlicht for some reason (the textures are upside
|
||||
* down). Opening and resaving them in a graphics app
|
||||
* will solve the problem.</TD>
|
||||
* </TR>
|
||||
* <TR>
|
||||
* <TD>Quake 3 levels (.bsp)</TD>
|
||||
* <TD>Quake 3 is a popular game by IDSoftware, and .pk3
|
||||
* files contain .bsp files and textures/lightmaps
|
||||
* describing huge prelighted levels. Irrlicht can read
|
||||
* .pk3 and .bsp files directly and thus render Quake 3
|
||||
* levels directly. Written by Nikolaus Gebhardt
|
||||
* enhanced by Dean P. Macri with the curved surfaces
|
||||
* feature. </TD>
|
||||
* </TR>
|
||||
* <TR>
|
||||
* <TD>Quake 2 models (.md2)</TD>
|
||||
* <TD>Quake 2 models are characters with morph target
|
||||
* animation. Irrlicht can read, display and animate
|
||||
* them directly with this importer. </TD>
|
||||
* </TR>
|
||||
* </TABLE>
|
||||
* <TD>My3D (.my3d)</TD>
|
||||
* <TD>.my3D is a flexible 3D file format. The My3DTools
|
||||
* contains plug-ins to export .my3D files from several
|
||||
* 3D packages. With this built-in importer, Irrlicht
|
||||
* can read and display those files directly. This
|
||||
* loader was written by Zhuck Dimitry who also created
|
||||
* the whole My3DTools package. If you are using this
|
||||
* loader, please note that you can set the path of the
|
||||
* textures before loading .my3d files. You can do this
|
||||
* using
|
||||
* SceneManager->getParameters()->setParameter(scene::MY3D_TEXTURE_PATH,
|
||||
* "path/to/your/textures");</TD>
|
||||
* </TR>
|
||||
* <TR>
|
||||
* <TD>OCT (.oct)</TD>
|
||||
* <TD>The oct file format contains 3D geometry and
|
||||
* lightmaps and can be loaded directly by Irrlicht. OCT
|
||||
* files<br> can be created by FSRad, Paul Nette's
|
||||
* radiosity processor or exported from Blender using
|
||||
* OCTTools which can be found in the exporters/OCTTools
|
||||
* directory of the SDK. Thanks to Murphy McCauley for
|
||||
* creating all this.</TD>
|
||||
* </TR>
|
||||
* <TR>
|
||||
* <TD>OGRE Meshes (.mesh)</TD>
|
||||
* <TD>Ogre .mesh files contain 3D data for the OGRE 3D
|
||||
* engine. Irrlicht can read and display them directly
|
||||
* with this importer. To define materials for the mesh,
|
||||
* copy a .material file named like the corresponding
|
||||
* .mesh file where the .mesh file is. (For example
|
||||
* ogrehead.material for ogrehead.mesh). Thanks to
|
||||
* Christian Stehno who wrote and contributed this
|
||||
* loader.</TD>
|
||||
* </TR>
|
||||
* <TR>
|
||||
* <TD>Pulsar LMTools (.lmts)</TD>
|
||||
* <TD>LMTools is a set of tools (Windows & Linux) for
|
||||
* creating lightmaps. Irrlicht can directly read .lmts
|
||||
* files thanks to<br> the importer created by Jonas
|
||||
* Petersen. If you are using this loader, please note
|
||||
* that you can set the path of the textures before
|
||||
* loading .lmts files. You can do this using
|
||||
* SceneManager->getParameters()->setParameter(scene::LMTS_TEXTURE_PATH,
|
||||
* "path/to/your/textures");
|
||||
* Notes for<br> this version of the loader:<br>
|
||||
* - It does not recognise/support user data in the
|
||||
* *.lmts files.<br>
|
||||
* - The TGAs generated by LMTools don't work in
|
||||
* Irrlicht for some reason (the textures are upside
|
||||
* down). Opening and resaving them in a graphics app
|
||||
* will solve the problem.</TD>
|
||||
* </TR>
|
||||
* <TR>
|
||||
* <TD>Quake 3 levels (.bsp)</TD>
|
||||
* <TD>Quake 3 is a popular game by IDSoftware, and .pk3
|
||||
* files contain .bsp files and textures/lightmaps
|
||||
* describing huge prelighted levels. Irrlicht can read
|
||||
* .pk3 and .bsp files directly and thus render Quake 3
|
||||
* levels directly. Written by Nikolaus Gebhardt
|
||||
* enhanced by Dean P. Macri with the curved surfaces
|
||||
* feature.</TD>
|
||||
* </TR>
|
||||
* <TR>
|
||||
* <TD>Quake 2 models (.md2)</TD>
|
||||
* <TD>Quake 2 models are characters with morph target
|
||||
* animation. Irrlicht can read, display and animate
|
||||
* them directly with this importer. </TD>
|
||||
* </TR>
|
||||
* </TABLE>
|
||||
*
|
||||
* To load and display a mesh quickly, just do this:
|
||||
* \code
|
||||
* SceneManager->addAnimatedMeshSceneNode(
|
||||
* To load and display a mesh quickly, just do this:
|
||||
* \code
|
||||
* SceneManager->addAnimatedMeshSceneNode(
|
||||
* SceneManager->getMesh("yourmesh.3ds"));
|
||||
* \endcode
|
||||
* If you would like to implement and add your own file format loader to Irrlicht,
|
||||
* see addExternalMeshLoader().
|
||||
* \param filename: Filename of the mesh to load.
|
||||
* \return Returns NULL if failed and the pointer to the mesh if
|
||||
* successful.
|
||||
* This pointer should not be dropped. See IReferenceCounted::drop() for more information.
|
||||
* \endcode
|
||||
* If you would like to implement and add your own file format loader to Irrlicht,
|
||||
* see addExternalMeshLoader().
|
||||
* \param filename: Filename of the mesh to load.
|
||||
* \return Returns NULL if failed and the pointer to the mesh if
|
||||
* successful.
|
||||
* This pointer should not be dropped. See IReferenceCounted::drop() for more information.
|
||||
**/
|
||||
virtual IAnimatedMesh* getMesh(const c8* filename) = 0;
|
||||
|
||||
|
@ -341,7 +339,7 @@ namespace scene
|
|||
/** Works just as getMesh(const char* filename). If you want to
|
||||
remove a loaded mesh from the cache again, use removeMesh().
|
||||
\param file File handle of the mesh to load.
|
||||
\return NULL if failed and pointer to the mesh if successful.
|
||||
\return 0 if failed and pointer to the mesh if successful.
|
||||
This pointer should not be dropped. See
|
||||
IReferenceCounted::drop() for more information. */
|
||||
virtual IAnimatedMesh* getMesh(io::IReadFile* file) = 0;
|
||||
|
@ -367,8 +365,8 @@ namespace scene
|
|||
/** Example Usage:
|
||||
scene::IVolumeLightSceneNode * n = smgr->addVolumeLightSceneNode(NULL, -1,
|
||||
32, 32, //Subdivide U/V
|
||||
video::SColor(0, 180, 180, 180), //foot color
|
||||
video::SColor(0, 0, 0, 0) //tail color
|
||||
video::SColor(0, 180, 180, 180), //foot color
|
||||
video::SColor(0, 0, 0, 0) //tail color
|
||||
);
|
||||
if (n)
|
||||
{
|
||||
|
@ -527,71 +525,77 @@ namespace scene
|
|||
const core::vector3df& lookat = core::vector3df(0,0,100), s32 id=-1) = 0;
|
||||
|
||||
//! Adds a maya style user controlled camera scene node to the scene graph.
|
||||
/** This is a standard camera with an animator that provides mouse control similar
|
||||
to camera in the 3D Software Maya by Alias Wavefront.
|
||||
\param parent: Parent scene node of the camera. Can be null.
|
||||
\param rotateSpeed: Rotation speed of the camera.
|
||||
\param zoomSpeed: Zoom speed of the camera.
|
||||
\param translationSpeed: TranslationSpeed of the camera.
|
||||
\param id: id of the camera. This id can be used to identify the camera.
|
||||
\return Returns a pointer to the interface of the camera if successful, otherwise 0.
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
|
||||
/** This is a standard camera with an animator that provides
|
||||
mouse control similar to camera in the 3D Software Maya.
|
||||
\param parent: Parent scene node of the camera. Can be null.
|
||||
\param rotateSpeed: Rotation speed of the camera.
|
||||
\param zoomSpeed: Zoom speed of the camera.
|
||||
\param translationSpeed: Translation speed of the camera.
|
||||
\param id: id of the camera. This id can be used to identify the camera.
|
||||
\return Pointer to the interface of the camera if successful, otherwise 0.
|
||||
This pointer should not be dropped. See
|
||||
IReferenceCounted::drop() for more information. */
|
||||
virtual ICameraSceneNode* addCameraSceneNodeMaya(ISceneNode* parent = 0,
|
||||
f32 rotateSpeed = -1500.0f, f32 zoomSpeed = 200.0f,
|
||||
f32 translationSpeed = 1500.0f, s32 id=-1) = 0;
|
||||
|
||||
//! Adds a camera scene node with an animator which provides mouse and keyboard control appropriate for first person shooters (FPS).
|
||||
/** This FPS camera is intended to provide a demonstration of a camera that behaves
|
||||
like a typical First Person Shooter. It is useful for simple demos and prototyping but is not
|
||||
intended to provide a full solution for a production quality game. It binds the camera scene node
|
||||
rotation to the look-at target; @see ICameraSceneNode::bindTargetAndRotation().
|
||||
With this camera, you look with the mouse, and move with cursor keys. If you want to
|
||||
change the key layout, you can specify your own keymap. For example to make the camera
|
||||
be controlled by the cursor keys AND the keys W,A,S, and D, do something
|
||||
like this:
|
||||
\code
|
||||
SKeyMap keyMap[8];
|
||||
keyMap[0].Action = EKA_MOVE_FORWARD;
|
||||
keyMap[0].KeyCode = KEY_UP;
|
||||
keyMap[1].Action = EKA_MOVE_FORWARD;
|
||||
keyMap[1].KeyCode = KEY_KEY_W;
|
||||
/** This FPS camera is intended to provide a demonstration of a
|
||||
camera that behaves like a typical First Person Shooter. It is
|
||||
useful for simple demos and prototyping but is not intended to
|
||||
provide a full solution for a production quality game. It binds
|
||||
the camera scene node rotation to the look-at target; @see
|
||||
ICameraSceneNode::bindTargetAndRotation(). With this camera,
|
||||
you look with the mouse, and move with cursor keys. If you want
|
||||
to change the key layout, you can specify your own keymap. For
|
||||
example to make the camera be controlled by the cursor keys AND
|
||||
the keys W,A,S, and D, do something like this:
|
||||
\code
|
||||
SKeyMap keyMap[8];
|
||||
keyMap[0].Action = EKA_MOVE_FORWARD;
|
||||
keyMap[0].KeyCode = KEY_UP;
|
||||
keyMap[1].Action = EKA_MOVE_FORWARD;
|
||||
keyMap[1].KeyCode = KEY_KEY_W;
|
||||
|
||||
keyMap[2].Action = EKA_MOVE_BACKWARD;
|
||||
keyMap[2].KeyCode = KEY_DOWN;
|
||||
keyMap[3].Action = EKA_MOVE_BACKWARD;
|
||||
keyMap[3].KeyCode = KEY_KEY_S;
|
||||
keyMap[2].Action = EKA_MOVE_BACKWARD;
|
||||
keyMap[2].KeyCode = KEY_DOWN;
|
||||
keyMap[3].Action = EKA_MOVE_BACKWARD;
|
||||
keyMap[3].KeyCode = KEY_KEY_S;
|
||||
|
||||
keyMap[4].Action = EKA_STRAFE_LEFT;
|
||||
keyMap[4].KeyCode = KEY_LEFT;
|
||||
keyMap[5].Action = EKA_STRAFE_LEFT;
|
||||
keyMap[5].KeyCode = KEY_KEY_A;
|
||||
keyMap[4].Action = EKA_STRAFE_LEFT;
|
||||
keyMap[4].KeyCode = KEY_LEFT;
|
||||
keyMap[5].Action = EKA_STRAFE_LEFT;
|
||||
keyMap[5].KeyCode = KEY_KEY_A;
|
||||
|
||||
keyMap[6].Action = EKA_STRAFE_RIGHT;
|
||||
keyMap[6].KeyCode = KEY_RIGHT;
|
||||
keyMap[7].Action = EKA_STRAFE_RIGHT;
|
||||
keyMap[7].KeyCode = KEY_KEY_D;
|
||||
keyMap[6].Action = EKA_STRAFE_RIGHT;
|
||||
keyMap[6].KeyCode = KEY_RIGHT;
|
||||
keyMap[7].Action = EKA_STRAFE_RIGHT;
|
||||
keyMap[7].KeyCode = KEY_KEY_D;
|
||||
|
||||
camera = sceneManager->addCameraSceneNodeFPS(0, 100, 500, -1, keyMap, 8);
|
||||
\endcode
|
||||
\param parent: Parent scene node of the camera. Can be null.
|
||||
\param rotateSpeed: Speed with which the camera is rotated. This can be done
|
||||
only with the mouse.
|
||||
\param moveSpeed: Speed with which the camera is moved. Movement is done with
|
||||
the cursor keys.
|
||||
\param id: id of the camera. This id can be used to identify the camera.
|
||||
\param keyMapArray: Optional pointer to an array of a keymap, specifying what
|
||||
keys should be used to move the camera. If this is null, the default keymap
|
||||
is used. You can define actions more then one time in the array, to bind
|
||||
multiple keys to the same action.
|
||||
\param keyMapSize: Amount of items in the keymap array.
|
||||
\param noVerticalMovement: Setting this to true makes the camera only move within a
|
||||
horizontal plane, and disables vertical movement as known from most ego shooters. Default
|
||||
is 'false', with which it is possible to fly around in space, if no gravity is there.
|
||||
\param jumpSpeed: Speed with which the camera is moved when jumping.
|
||||
\return Returns a pointer to the interface of the camera if successful, otherwise 0.
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
|
||||
camera = sceneManager->addCameraSceneNodeFPS(0, 100, 500, -1, keyMap, 8);
|
||||
\endcode
|
||||
\param parent: Parent scene node of the camera. Can be null.
|
||||
\param rotateSpeed: Speed in degress with which the camera is
|
||||
rotated. This can be done only with the mouse.
|
||||
\param moveSpeed: Speed in units per millisecond with which
|
||||
the camera is moved. Movement is done with the cursor keys.
|
||||
\param id: id of the camera. This id can be used to identify the camera.
|
||||
\param keyMapArray: Optional pointer to an array of a keymap, specifying what
|
||||
keys should be used to move the camera. If this is null, the default keymap
|
||||
is used. You can define actions more then one time in the array, to bind
|
||||
multiple keys to the same action.
|
||||
\param keyMapSize: Amount of items in the keymap array.
|
||||
\param noVerticalMovement: Setting this to true makes the
|
||||
camera only move within a horizontal plane, and disables
|
||||
vertical movement as known from most ego shooters. Default is
|
||||
'false', with which it is possible to fly around in space, if
|
||||
no gravity is there.
|
||||
\param jumpSpeed: Speed with which the camera is moved when jumping.
|
||||
\return Pointer to the interface of the camera if successful, otherwise 0.
|
||||
This pointer should not be dropped. See
|
||||
IReferenceCounted::drop() for more information. */
|
||||
virtual ICameraSceneNode* addCameraSceneNodeFPS(ISceneNode* parent = 0,
|
||||
f32 rotateSpeed = 100.0f, f32 moveSpeed = 500.0f, s32 id=-1,
|
||||
f32 rotateSpeed = 100.0f, f32 moveSpeed = .5f, s32 id=-1,
|
||||
SKeyMap* keyMapArray=0, s32 keyMapSize=0, bool noVerticalMovement=false,
|
||||
f32 jumpSpeed = 0.f) = 0;
|
||||
|
||||
|
@ -829,11 +833,11 @@ namespace scene
|
|||
ISceneNode* parent = 0, const core::vector3df& position = core::vector3df(0,0,0),
|
||||
s32 id=-1) = 0;
|
||||
|
||||
//! Adds a text scene node, which uses billboards. The node, and the text on it, will scale with distance.
|
||||
//! Adds a text scene node, which uses billboards. The node, and the text on it, will scale with distance.
|
||||
/**
|
||||
\param font The font to use on the billboard. Pass 0 to use the GUI environment's default font.
|
||||
\param text The text to display on the billboard.
|
||||
\param parent The billboard's parent. Pass 0 to use the root scene node.
|
||||
\param parent The billboard's parent. Pass 0 to use the root scene node.
|
||||
\param size The billboard's width and height.
|
||||
\param position The billboards position relative to its parent.
|
||||
\param colorTop: The color of the vertices at the top of the billboard (default: white).
|
||||
|
|
|
@ -46,8 +46,8 @@ namespace scene
|
|||
virtual ISceneNodeAnimator* createClone(ISceneNode* node, ISceneManager* newManager=0) = 0;
|
||||
|
||||
//! Returns true if this animator receives events.
|
||||
/** When attached to the an active camera, this animator will be able to respond to events
|
||||
such as mouse and keyboard events. */
|
||||
/** When attached to an active camera, this animator will be
|
||||
able to respond to events such as mouse and keyboard events. */
|
||||
virtual bool isEventReceiverEnabled() const
|
||||
{
|
||||
return false;
|
||||
|
|
|
@ -16,8 +16,8 @@ namespace scene
|
|||
{
|
||||
|
||||
//! Special scene node animator for FPS cameras
|
||||
/** This scene node animator can be attached to a camera to make it act like a first
|
||||
person shooter
|
||||
/** This scene node animator can be attached to a camera to make it act
|
||||
like a first person shooter
|
||||
*/
|
||||
class ISceneNodeAnimatorCameraFPS : public ISceneNodeAnimator
|
||||
{
|
||||
|
@ -29,21 +29,24 @@ namespace scene
|
|||
//! Sets the speed of movement in units per millisecond
|
||||
virtual void setMoveSpeed(f32 moveSpeed) = 0;
|
||||
|
||||
//! Returns the rotation speed
|
||||
//! Returns the rotation speed in degrees
|
||||
/** The degrees are equivalent to a half screen movement of the mouse,
|
||||
i.e. if the mouse cursor had been moved to the border of the screen since
|
||||
the last animation. */
|
||||
virtual f32 getRotateSpeed() const = 0;
|
||||
|
||||
//! Set the rotation speed
|
||||
//! Set the rotation speed in degrees
|
||||
virtual void setRotateSpeed(f32 rotateSpeed) = 0;
|
||||
|
||||
//! Sets the keyboard mapping for this animator
|
||||
//! \param keymap: an array of keyboard mappings, see SKeyMap
|
||||
//! \param count: the size of the keyboard map array
|
||||
/** \param keymap Array of keyboard mappings, see SKeyMap
|
||||
\param count Size of the keyboard map array */
|
||||
virtual void setKeyMap(SKeyMap *map, u32 count) = 0;
|
||||
|
||||
//! Sets whether vertical movement should be allowed.
|
||||
//! If vertical movement is enabled then the camera may fight with
|
||||
//! gravity causing camera shake. Disable this if the camera has
|
||||
//! a collision animator with gravity enabled.
|
||||
/** If vertical movement is enabled then the camera may fight with
|
||||
gravity causing camera shake. Disable this if the camera has
|
||||
a collision animator with gravity enabled. */
|
||||
virtual void setVerticalMovement(bool allow) = 0;
|
||||
};
|
||||
} // end namespace scene
|
||||
|
|
|
@ -13,18 +13,20 @@ namespace irr
|
|||
namespace scene
|
||||
{
|
||||
|
||||
//! Special scene node animator for FPS cameras
|
||||
/** This scene node animator can be attached to a camera to make it act like a first
|
||||
person shooter
|
||||
//! Special scene node animator for Maya-style cameras
|
||||
/** This scene node animator can be attached to a camera to make it act like a 3d
|
||||
modelling tool.
|
||||
The camera is moving relative to the target with the mouse, by pressing either
|
||||
of the three buttons.
|
||||
*/
|
||||
class ISceneNodeAnimatorCameraMaya : public ISceneNodeAnimator
|
||||
{
|
||||
public:
|
||||
|
||||
//! Returns the speed of movement in units per millisecond
|
||||
//! Returns the speed of movement
|
||||
virtual f32 getMoveSpeed() const = 0;
|
||||
|
||||
//! Sets the speed of movement in units per millisecond
|
||||
//! Sets the speed of movement
|
||||
virtual void setMoveSpeed(f32 moveSpeed) = 0;
|
||||
|
||||
//! Returns the rotation speed
|
||||
|
|
|
@ -33,8 +33,8 @@ namespace scene
|
|||
*
|
||||
* This scene node is capable of very quickly loading
|
||||
* terrains and updating the indices at runtime to enable viewing very large terrains. It uses a
|
||||
* CLOD ( Continuous Level of Detail ) algorithm which updates the indices for each patch based on
|
||||
* a LOD ( Level of Detail ) which is determined based on a patch's distance from the camera.
|
||||
* CLOD (Continuous Level of Detail) algorithm which updates the indices for each patch based on
|
||||
* a LOD (Level of Detail) which is determined based on a patch's distance from the camera.
|
||||
*
|
||||
* The Patch Size of the terrain must always be a size of ( 2^N+1, i.e. 8+1(9), 16+1(17), etc. ).
|
||||
* The MaxLOD available is directly dependent on the patch size of the terrain. LOD 0 contains all
|
||||
|
@ -49,7 +49,6 @@ namespace scene
|
|||
class ITerrainSceneNode : public ISceneNode
|
||||
{
|
||||
public:
|
||||
|
||||
//! Constructor
|
||||
ITerrainSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id,
|
||||
const core::vector3df& position = core::vector3df(0.0f, 0.0f, 0.0f),
|
||||
|
@ -57,34 +56,30 @@ namespace scene
|
|||
const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f) )
|
||||
: ISceneNode (parent, mgr, id, position, rotation, scale) {}
|
||||
|
||||
//! Destructor
|
||||
virtual ~ITerrainSceneNode() {}
|
||||
|
||||
//! Get the bounding box of the terrain.
|
||||
/** \return The bounding box of the entire terrain. */
|
||||
virtual const core::aabbox3d<f32>& getBoundingBox() const = 0;
|
||||
virtual const core::aabbox3d<f32>& getBoundingBox() const =0;
|
||||
|
||||
//! Get the bounding box of a patch
|
||||
/** \return The bounding box of the chosen patch. */
|
||||
virtual const core::aabbox3d<f32>& getBoundingBox(s32 patchX, s32 patchZ) const = 0;
|
||||
virtual const core::aabbox3d<f32>& getBoundingBox(s32 patchX, s32 patchZ) const =0;
|
||||
|
||||
//! Get the number of indices currently in the meshbuffer
|
||||
/** \return The index count. */
|
||||
virtual u32 getIndexCount() const = 0;
|
||||
virtual u32 getIndexCount() const =0;
|
||||
|
||||
//! Get pointer to the mesh
|
||||
/** \return Pointer to the mesh. */
|
||||
virtual IMesh* getMesh() = 0;
|
||||
virtual IMesh* getMesh() =0;
|
||||
|
||||
|
||||
//! Returns a pointer to the buffer used by the terrain (most users will not need this)
|
||||
virtual IMeshBuffer* getRenderBuffer() = 0;
|
||||
//! Get pointer to the buffer used by the terrain (most users will not need this)
|
||||
virtual IMeshBuffer* getRenderBuffer() =0;
|
||||
|
||||
|
||||
//! Gets the meshbuffer data based on a specified level of detail.
|
||||
/** \param mb A reference to an SMeshBuffer object
|
||||
/** \param mb A reference to an IDynamicMeshBuffer object
|
||||
\param LOD The level of detail you want the indices from. */
|
||||
virtual void getMeshBufferForLOD(IDynamicMeshBuffer& mb, s32 LOD) const = 0;
|
||||
virtual void getMeshBufferForLOD(IDynamicMeshBuffer& mb, s32 LOD=0) const =0;
|
||||
|
||||
//! Gets the indices for a specified patch at a specified Level of Detail.
|
||||
/** \param indices A reference to an array of u32 indices.
|
||||
|
@ -93,42 +88,42 @@ namespace scene
|
|||
\param LOD The level of detail to get for that patch. If -1,
|
||||
then get the CurrentLOD. If the CurrentLOD is set to -1,
|
||||
meaning it's not shown, then it will retrieve the triangles at
|
||||
the highest LOD ( 0 ).
|
||||
the highest LOD (0).
|
||||
\return Number of indices put into the buffer. */
|
||||
virtual s32 getIndicesForPatch(core::array<u32>& indices,
|
||||
s32 patchX, s32 patchZ, s32 LOD = 0 ) = 0;
|
||||
s32 patchX, s32 patchZ, s32 LOD=0) =0;
|
||||
|
||||
//! Populates an array with the CurrentLOD of each patch.
|
||||
/** \param LODs A reference to a core::array<s32> to hold the
|
||||
values
|
||||
\return Number of elements in the array */
|
||||
virtual s32 getCurrentLODOfPatches(core::array<s32>& LODs) const = 0;
|
||||
virtual s32 getCurrentLODOfPatches(core::array<s32>& LODs) const =0;
|
||||
|
||||
//! Manually sets the LOD of a patch
|
||||
/** \param patchX Patch x coordinate.
|
||||
\param patchZ Patch z coordinate.
|
||||
\param LOD The level of detail to set the patch to. */
|
||||
virtual void setLODOfPatch( s32 patchX, s32 patchZ, s32 LOD ) = 0;
|
||||
virtual void setLODOfPatch(s32 patchX, s32 patchZ, s32 LOD=0) =0;
|
||||
|
||||
//! Get center of terrain.
|
||||
virtual const core::vector3df& getTerrainCenter() const = 0;
|
||||
virtual const core::vector3df& getTerrainCenter() const =0;
|
||||
|
||||
//! Get height of a point of the terrain.
|
||||
virtual f32 getHeight( f32 x, f32 y ) const = 0;
|
||||
virtual f32 getHeight(f32 x, f32 y) const =0;
|
||||
|
||||
//! Sets the movement camera threshold.
|
||||
/** It is used to determine when to recalculate
|
||||
indices for the scene node. The default value is 10.0f. */
|
||||
virtual void setCameraMovementDelta(f32 delta) = 0;
|
||||
virtual void setCameraMovementDelta(f32 delta) =0;
|
||||
|
||||
//! Sets the rotation camera threshold.
|
||||
/** It is used to determine when to recalculate
|
||||
indices for the scene node. The default value is 1.0f. */
|
||||
virtual void setCameraRotationDelta(f32 delta) = 0;
|
||||
virtual void setCameraRotationDelta(f32 delta) =0;
|
||||
|
||||
//! Sets whether or not the node should dynamically update its associated selector when the geomipmap data changes.
|
||||
/** \param bVal: Boolean value representing whether or not to update selector dynamically. */
|
||||
virtual void setDynamicSelectorUpdate(bool bVal) = 0;
|
||||
virtual void setDynamicSelectorUpdate(bool bVal) =0;
|
||||
|
||||
//! Override the default generation of distance thresholds.
|
||||
/** For determining the LOD a patch is rendered at. If any LOD
|
||||
|
@ -137,7 +132,7 @@ namespace scene
|
|||
then apply a scale to the scene node, it is your responsibility
|
||||
to update the new distances to work best with your new terrain
|
||||
size. */
|
||||
virtual bool overrideLODDistance(s32 LOD, f64 newDistance) = 0;
|
||||
virtual bool overrideLODDistance(s32 LOD, f64 newDistance) =0;
|
||||
|
||||
//! Scales the base texture, similar to makePlanarTextureMapping.
|
||||
/** \param scale The scaling amount. Values above 1.0
|
||||
|
@ -149,7 +144,7 @@ namespace scene
|
|||
second texture coordinate set to the same values as in the
|
||||
first set. If this is another value than zero, it will scale
|
||||
the second texture coordinate set by this value. */
|
||||
virtual void scaleTexture(f32 scale = 1.0f, f32 scale2 = 0.0f) = 0;
|
||||
virtual void scaleTexture(f32 scale = 1.0f, f32 scale2=0.0f) =0;
|
||||
|
||||
//! Initializes the terrain data. Loads the vertices from the heightMapFile.
|
||||
/** The file must contain a loadable image of the heightmap. The heightmap
|
||||
|
|
|
@ -115,7 +115,7 @@ public:
|
|||
/** \param degrees Amount of degrees to rotate by, anticlockwise.
|
||||
\param center Rotation center.
|
||||
\return This vector after transformation. */
|
||||
vector2d<T>& rotateBy(f64 degrees, const vector2d<T>& center)
|
||||
vector2d<T>& rotateBy(f64 degrees, const vector2d<T>& center=vector2d<T>())
|
||||
{
|
||||
degrees *= DEGTORAD64;
|
||||
const f64 cs = cos(degrees);
|
||||
|
|
Binary file not shown.
Binary file not shown.
After Width: | Height: | Size: 39 KiB |
Binary file not shown.
After Width: | Height: | Size: 51 KiB |
|
@ -201,7 +201,7 @@ void CAnimatedMeshSceneNode::OnRegisterSceneNode()
|
|||
}
|
||||
}
|
||||
|
||||
IMesh * CAnimatedMeshSceneNode::getMeshForCurrentFrame(bool forceRecalcOfControlJoints)
|
||||
IMesh * CAnimatedMeshSceneNode::getMeshForCurrentFrame(void)
|
||||
{
|
||||
if(Mesh->getMeshType() != EAMT_SKINNED)
|
||||
{
|
||||
|
@ -210,20 +210,15 @@ IMesh * CAnimatedMeshSceneNode::getMeshForCurrentFrame(bool forceRecalcOfControl
|
|||
}
|
||||
else
|
||||
{
|
||||
// As multiple scene nodes may be sharing the same skinned mesh, we have to
|
||||
// re-animated it every frame to ensure that this node gets the mesh that it needs.
|
||||
|
||||
CSkinnedMesh* skinnedMesh = reinterpret_cast<CSkinnedMesh*>(Mesh);
|
||||
|
||||
if (JointMode == EJUOR_CONTROL && forceRecalcOfControlJoints)//write to mesh
|
||||
{
|
||||
if (JointMode == EJUOR_CONTROL)//write to mesh
|
||||
skinnedMesh->transferJointsToMesh(JointChildSceneNodes);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Return the mesh for the current frame if it hasn't changed, otherwise update it.
|
||||
if(MeshForCurrentFrame && core::equals(CurrentFrameNr, FrameWhenCurrentMeshWasGenerated))
|
||||
return MeshForCurrentFrame;
|
||||
else
|
||||
skinnedMesh->animateMesh(getFrameNr(), 1.0f);
|
||||
}
|
||||
skinnedMesh->animateMesh(getFrameNr(), 1.0f);
|
||||
|
||||
// Update the skinned mesh for the current joint transforms.
|
||||
skinnedMesh->skinMesh();
|
||||
|
@ -239,9 +234,10 @@ IMesh * CAnimatedMeshSceneNode::getMeshForCurrentFrame(bool forceRecalcOfControl
|
|||
JointChildSceneNodes[n]->updateAbsolutePositionOfAllChildren(); //temp, should be an option
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
if(JointMode == EJUOR_CONTROL)
|
||||
{
|
||||
// For EJUOR_READ meshes, this is done by calling animateMesh()
|
||||
// For meshes other than EJUOR_CONTROL, this is done by calling animateMesh()
|
||||
skinnedMesh->updateBoundingBox();
|
||||
}
|
||||
|
||||
|
@ -256,15 +252,7 @@ IMesh * CAnimatedMeshSceneNode::getMeshForCurrentFrame(bool forceRecalcOfControl
|
|||
//! OnAnimate() is called just before rendering the whole scene.
|
||||
void CAnimatedMeshSceneNode::OnAnimate(u32 timeMs)
|
||||
{
|
||||
CurrentFrameNr = buildFrameNr ( timeMs );
|
||||
|
||||
if ( Mesh )
|
||||
{
|
||||
scene::IMesh * mesh = getMeshForCurrentFrame(true);
|
||||
|
||||
if ( mesh )
|
||||
Box = mesh->getBoundingBox();
|
||||
}
|
||||
CurrentFrameNr = buildFrameNr ( timeMs );
|
||||
|
||||
IAnimatedMeshSceneNode::OnAnimate ( timeMs );
|
||||
}
|
||||
|
@ -284,9 +272,13 @@ void CAnimatedMeshSceneNode::render()
|
|||
|
||||
++PassCount;
|
||||
|
||||
scene::IMesh* m = getMeshForCurrentFrame(false);
|
||||
scene::IMesh* m = getMeshForCurrentFrame();
|
||||
|
||||
if ( 0 == m )
|
||||
if(m)
|
||||
{
|
||||
Box = m->getBoundingBox();
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
os::Printer::log("Animated Mesh returned no mesh to render.", Mesh->getDebugName(), ELL_WARNING);
|
||||
|
|
|
@ -162,10 +162,7 @@ namespace scene
|
|||
private:
|
||||
|
||||
//! Get a static mesh for the current frame of this animated mesh
|
||||
/** \param forceRecalcOfControlJoints If the mesh is a skinned mesh with controlled joints, force
|
||||
a recalculation even if the frame number hasn't changed. Otherwise return the cached mesh for the
|
||||
current frame if it exists. */
|
||||
IMesh* getMeshForCurrentFrame(bool forceRecalcOfControlJoints);
|
||||
IMesh* getMeshForCurrentFrame(void);
|
||||
|
||||
f32 buildFrameNr( u32 timeMs);
|
||||
void checkJoints();
|
||||
|
|
|
@ -2776,7 +2776,7 @@ ITexture* COpenGLDriver::addRenderTargetTexture(const core::dimension2d<s32>& si
|
|||
//! call.
|
||||
u32 COpenGLDriver::getMaximalPrimitiveCount() const
|
||||
{
|
||||
return 65535;// TODO: Fix all loaders to auto-split and then return the correct value: MaxIndices;
|
||||
return 0x7fffffff;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -667,8 +667,9 @@ ICameraSceneNode* CSceneManager::addCameraSceneNodeFPS(ISceneNode* parent,
|
|||
parent = this;
|
||||
|
||||
ICameraSceneNode* node = new CCameraSceneNode(parent, this, id);
|
||||
ISceneNodeAnimator* anm = new CSceneNodeAnimatorCameraFPS(CursorControl, rotateSpeed,
|
||||
moveSpeed, jumpSpeed, keyMapArray, keyMapSize, noVerticalMovement);
|
||||
ISceneNodeAnimator* anm = new CSceneNodeAnimatorCameraFPS(CursorControl,
|
||||
rotateSpeed, moveSpeed, jumpSpeed,
|
||||
keyMapArray, keyMapSize, noVerticalMovement);
|
||||
|
||||
// Bind the node's rotation to its target. This is consistent with 1.4.2 and below.
|
||||
node->bindTargetAndRotation(true);
|
||||
|
|
|
@ -127,18 +127,18 @@ namespace scene
|
|||
//! \return Pointer to interface to camera
|
||||
virtual ICameraSceneNode* addCameraSceneNode(ISceneNode* parent = 0,
|
||||
const core::vector3df& position = core::vector3df(0,0,0),
|
||||
const core::vector3df& lookat = core::vector3df(0,0,0), s32 id=-1);
|
||||
const core::vector3df& lookat = core::vector3df(0,0,100), s32 id=-1);
|
||||
|
||||
//! Adds a camera scene node which is able to be controlle with the mouse similar
|
||||
//! like in the 3D Software Maya by Alias Wavefront.
|
||||
//! The returned pointer must not be dropped.
|
||||
virtual ICameraSceneNode* addCameraSceneNodeMaya(ISceneNode* parent = 0,
|
||||
f32 rotateSpeed = -1500.0f, f32 zoomSpeed = 200.0f, f32 translationSpeed = 100.0f, s32 id=-1);
|
||||
f32 rotateSpeed = -1500.0f, f32 zoomSpeed = 200.0f, f32 translationSpeed = 1500.0f, s32 id=-1);
|
||||
|
||||
//! Adds a camera scene node which is able to be controled with the mouse and keys
|
||||
//! like in most first person shooters (FPS):
|
||||
virtual ICameraSceneNode* addCameraSceneNodeFPS(ISceneNode* parent = 0,
|
||||
f32 rotateSpeed = 1500.0f, f32 moveSpeed = 200.0f, s32 id=-1,
|
||||
f32 rotateSpeed = 100.0f, f32 moveSpeed = .5f, s32 id=-1,
|
||||
SKeyMap* keyMapArray=0, s32 keyMapSize=0, bool noVerticalMovement=false,
|
||||
f32 jumpSpeed = 0.f);
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ CSceneNodeAnimatorCameraFPS::CSceneNodeAnimatorCameraFPS(gui::ICursorControl* cu
|
|||
f32 rotateSpeed, f32 moveSpeed, f32 jumpSpeed,
|
||||
SKeyMap* keyMapArray, u32 keyMapSize, bool noVerticalMovement)
|
||||
: CursorControl(cursorControl), MaxVerticalAngle(88.0f),
|
||||
MoveSpeed(moveSpeed/1000.0f), RotateSpeed(rotateSpeed), JumpSpeed(jumpSpeed),
|
||||
MoveSpeed(moveSpeed), RotateSpeed(rotateSpeed), JumpSpeed(jumpSpeed),
|
||||
LastAnimationTime(0), firstUpdate(true), NoVerticalMovement(noVerticalMovement)
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
|
@ -304,7 +304,7 @@ void CSceneNodeAnimatorCameraFPS::setVerticalMovement(bool allow)
|
|||
ISceneNodeAnimator* CSceneNodeAnimatorCameraFPS::createClone(ISceneNode* node, ISceneManager* newManager)
|
||||
{
|
||||
CSceneNodeAnimatorCameraFPS * newAnimator =
|
||||
new CSceneNodeAnimatorCameraFPS(CursorControl, RotateSpeed, (MoveSpeed * 1000.0f), JumpSpeed,
|
||||
new CSceneNodeAnimatorCameraFPS(CursorControl, RotateSpeed, MoveSpeed, JumpSpeed,
|
||||
0, 0, NoVerticalMovement);
|
||||
newAnimator->setKeyMap(KeyMap);
|
||||
return newAnimator;
|
||||
|
|
|
@ -27,7 +27,7 @@ namespace scene
|
|||
|
||||
//! Constructor
|
||||
CSceneNodeAnimatorCameraFPS(gui::ICursorControl* cursorControl,
|
||||
f32 rotateSpeed = 100.0f, f32 moveSpeed = 500.0f, f32 jumpSpeed=0.f,
|
||||
f32 rotateSpeed = 100.0f, f32 moveSpeed = .5f, f32 jumpSpeed=0.f,
|
||||
SKeyMap* keyMapArray=0, u32 keyMapSize=0, bool noVerticalMovement=false);
|
||||
|
||||
//! Destructor
|
||||
|
@ -39,10 +39,10 @@ namespace scene
|
|||
//! Event receiver
|
||||
virtual bool OnEvent(const SEvent& event);
|
||||
|
||||
//! Returns the speed of movement in units per millisecond
|
||||
//! Returns the speed of movement in units per second
|
||||
virtual f32 getMoveSpeed() const;
|
||||
|
||||
//! Sets the speed of movement in units per millisecond
|
||||
//! Sets the speed of movement in units per second
|
||||
virtual void setMoveSpeed(f32 moveSpeed);
|
||||
|
||||
//! Returns the rotation speed
|
||||
|
@ -118,3 +118,4 @@ namespace scene
|
|||
} // end namespace irr
|
||||
|
||||
#endif // __C_SCENE_NODE_ANIMATOR_CAMERA_FPS_H_INCLUDED__
|
||||
|
||||
|
|
|
@ -14,11 +14,9 @@ namespace scene
|
|||
|
||||
//! constructor
|
||||
CSceneNodeAnimatorCameraMaya::CSceneNodeAnimatorCameraMaya(gui::ICursorControl* cursor, f32 rotate, f32 zoom, f32 translate)
|
||||
: CursorControl(cursor), Zooming(false), Rotating(false), Moving(false), Translating(false),
|
||||
ZoomSpeed(zoom), RotateSpeed(rotate), TranslateSpeed(translate),
|
||||
RotateStartX(0.0f), RotateStartY(0.0f), ZoomStartX(0.0f), ZoomStartY(0.0f),
|
||||
TranslateStartX(0.0f), TranslateStartY(0.0f), CurrentZoom(70.0f), RotX(0.0f), RotY(0.0f),
|
||||
OldCamera(0), MousePos(0.5f, 0.5f)
|
||||
: CursorControl(cursor), Zooming(false), Rotating(false), Moving(false),
|
||||
Translating(false), ZoomSpeed(zoom), RotateSpeed(rotate), TranslateSpeed(translate),
|
||||
CurrentZoom(70.0f), RotX(0.0f), RotY(0.0f), OldCamera(0), MousePos(0.5f, 0.5f)
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
setDebugName("CSceneNodeAnimatorCameraMaya");
|
||||
|
@ -103,9 +101,7 @@ void CSceneNodeAnimatorCameraMaya::animateNode(ISceneNode *node, u32 timeMs)
|
|||
OldCamera = camera;
|
||||
}
|
||||
|
||||
Target = camera->getTarget();
|
||||
|
||||
const SViewFrustum* va = camera->getViewFrustum();
|
||||
core::vector3df target = camera->getTarget();
|
||||
|
||||
f32 nRotX = RotX;
|
||||
f32 nRotY = RotY;
|
||||
|
@ -115,28 +111,23 @@ void CSceneNodeAnimatorCameraMaya::animateNode(ISceneNode *node, u32 timeMs)
|
|||
{
|
||||
if (!Zooming)
|
||||
{
|
||||
ZoomStartX = MousePos.X;
|
||||
ZoomStartY = MousePos.Y;
|
||||
ZoomStart = MousePos;
|
||||
Zooming = true;
|
||||
nZoom = CurrentZoom;
|
||||
}
|
||||
else
|
||||
{
|
||||
f32 old = nZoom;
|
||||
nZoom += (ZoomStartX - MousePos.X) * ZoomSpeed;
|
||||
const f32 targetMinDistance = 0.1f;
|
||||
nZoom += (ZoomStart.X - MousePos.X) * ZoomSpeed;
|
||||
|
||||
f32 targetMinDistance = 0.1f;
|
||||
if (nZoom < targetMinDistance) // jox: fixed bug: bounce back when zooming to close
|
||||
nZoom = targetMinDistance;
|
||||
|
||||
if (nZoom < 0)
|
||||
nZoom = old;
|
||||
}
|
||||
}
|
||||
else if (Zooming)
|
||||
{
|
||||
f32 old = CurrentZoom;
|
||||
CurrentZoom = CurrentZoom + (ZoomStartX - MousePos.X ) * ZoomSpeed;
|
||||
const f32 old = CurrentZoom;
|
||||
CurrentZoom = CurrentZoom + (ZoomStart.X - MousePos.X ) * ZoomSpeed;
|
||||
nZoom = CurrentZoom;
|
||||
|
||||
if (nZoom < 0)
|
||||
|
@ -146,35 +137,34 @@ void CSceneNodeAnimatorCameraMaya::animateNode(ISceneNode *node, u32 timeMs)
|
|||
|
||||
// Translation ---------------------------------
|
||||
|
||||
core::vector3df translate(OldTarget), UpVector(camera->getUpVector());
|
||||
core::vector3df translate(OldTarget), upVector(camera->getUpVector());
|
||||
|
||||
core::vector3df tvectX = Pos - Target;
|
||||
tvectX = tvectX.crossProduct(UpVector);
|
||||
core::vector3df tvectX = Pos - target;
|
||||
tvectX = tvectX.crossProduct(upVector);
|
||||
tvectX.normalize();
|
||||
|
||||
const SViewFrustum* const va = camera->getViewFrustum();
|
||||
core::vector3df tvectY = (va->getFarLeftDown() - va->getFarRightDown());
|
||||
tvectY = tvectY.crossProduct(UpVector.Y > 0 ? Pos - Target : Target - Pos);
|
||||
tvectY = tvectY.crossProduct(upVector.Y > 0 ? Pos - target : target - Pos);
|
||||
tvectY.normalize();
|
||||
|
||||
|
||||
if (isMouseKeyDown(2) && !Zooming)
|
||||
{
|
||||
if (!Translating)
|
||||
{
|
||||
TranslateStartX = MousePos.X;
|
||||
TranslateStartY = MousePos.Y;
|
||||
TranslateStart = MousePos;
|
||||
Translating = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
translate += tvectX * (TranslateStartX - MousePos.X)*TranslateSpeed +
|
||||
tvectY * (TranslateStartY - MousePos.Y)*TranslateSpeed;
|
||||
translate += tvectX * (TranslateStart.X - MousePos.X)*TranslateSpeed +
|
||||
tvectY * (TranslateStart.Y - MousePos.Y)*TranslateSpeed;
|
||||
}
|
||||
}
|
||||
else if (Translating)
|
||||
{
|
||||
translate += tvectX * (TranslateStartX - MousePos.X)*TranslateSpeed +
|
||||
tvectY * (TranslateStartY - MousePos.Y)*TranslateSpeed;
|
||||
translate += tvectX * (TranslateStart.X - MousePos.X)*TranslateSpeed +
|
||||
tvectY * (TranslateStart.Y - MousePos.Y)*TranslateSpeed;
|
||||
OldTarget = translate;
|
||||
Translating = false;
|
||||
}
|
||||
|
@ -185,22 +175,21 @@ void CSceneNodeAnimatorCameraMaya::animateNode(ISceneNode *node, u32 timeMs)
|
|||
{
|
||||
if (!Rotating)
|
||||
{
|
||||
RotateStartX = MousePos.X;
|
||||
RotateStartY = MousePos.Y;
|
||||
RotateStart = MousePos;
|
||||
Rotating = true;
|
||||
nRotX = RotX;
|
||||
nRotY = RotY;
|
||||
}
|
||||
else
|
||||
{
|
||||
nRotX += (RotateStartX - MousePos.X) * RotateSpeed;
|
||||
nRotY += (RotateStartY - MousePos.Y) * RotateSpeed;
|
||||
nRotX += (RotateStart.X - MousePos.X) * RotateSpeed;
|
||||
nRotY += (RotateStart.Y - MousePos.Y) * RotateSpeed;
|
||||
}
|
||||
}
|
||||
else if (Rotating)
|
||||
{
|
||||
RotX = RotX + (RotateStartX - MousePos.X) * RotateSpeed;
|
||||
RotY = RotY + (RotateStartY - MousePos.Y) * RotateSpeed;
|
||||
RotX += (RotateStart.X - MousePos.X) * RotateSpeed;
|
||||
RotY += (RotateStart.Y - MousePos.Y) * RotateSpeed;
|
||||
nRotX = RotX;
|
||||
nRotY = RotY;
|
||||
Rotating = false;
|
||||
|
@ -208,25 +197,25 @@ void CSceneNodeAnimatorCameraMaya::animateNode(ISceneNode *node, u32 timeMs)
|
|||
|
||||
// Set Pos ------------------------------------
|
||||
|
||||
Target = translate;
|
||||
target = translate;
|
||||
|
||||
Pos.X = nZoom + Target.X;
|
||||
Pos.Y = Target.Y;
|
||||
Pos.Z = Target.Z;
|
||||
Pos.X = nZoom + target.X;
|
||||
Pos.Y = target.Y;
|
||||
Pos.Z = target.Z;
|
||||
|
||||
Pos.rotateXYBy(nRotY, Target);
|
||||
Pos.rotateXZBy(-nRotX, Target);
|
||||
Pos.rotateXYBy(nRotY, target);
|
||||
Pos.rotateXZBy(-nRotX, target);
|
||||
|
||||
// Rotation Error ----------------------------
|
||||
|
||||
// jox: fixed bug: jitter when rotating to the top and bottom of y
|
||||
UpVector.set(0,1,0);
|
||||
UpVector.rotateXYBy(-nRotY);
|
||||
UpVector.rotateXZBy(-nRotX+180.f);
|
||||
upVector.set(0,1,0);
|
||||
upVector.rotateXYBy(-nRotY);
|
||||
upVector.rotateXZBy(-nRotX+180.f);
|
||||
|
||||
camera->setPosition(Pos);
|
||||
camera->setTarget(Target);
|
||||
camera->setUpVector(UpVector);
|
||||
camera->setTarget(target);
|
||||
camera->setUpVector(upVector);
|
||||
}
|
||||
|
||||
|
||||
|
@ -243,25 +232,6 @@ void CSceneNodeAnimatorCameraMaya::allKeysUp()
|
|||
}
|
||||
|
||||
|
||||
// function added by jox
|
||||
void CSceneNodeAnimatorCameraMaya::updateAnimationState()
|
||||
{
|
||||
core::vector3df pos(Pos - Target);
|
||||
|
||||
// X rotation
|
||||
core::vector2df vec2d(pos.X, pos.Z);
|
||||
RotX = (f32)vec2d.getAngle();
|
||||
|
||||
// Y rotation
|
||||
pos.rotateXZBy(RotX);
|
||||
vec2d.set(pos.X, pos.Y);
|
||||
RotY = -(f32)vec2d.getAngle();
|
||||
|
||||
// Zoom
|
||||
CurrentZoom = (f32)Pos.getDistanceFrom(Target);
|
||||
}
|
||||
|
||||
|
||||
//! Sets the rotation speed
|
||||
void CSceneNodeAnimatorCameraMaya::setRotateSpeed(f32 speed)
|
||||
{
|
||||
|
|
|
@ -21,8 +21,8 @@ namespace scene
|
|||
{
|
||||
|
||||
//! Special scene node animator for FPS cameras
|
||||
/** This scene node animator can be attached to a camera to make it act like a first
|
||||
person shooter
|
||||
/** This scene node animator can be attached to a camera to make it act
|
||||
like a 3d modelling tool camera
|
||||
*/
|
||||
class CSceneNodeAnimatorCameraMaya : public ISceneNodeAnimatorCameraMaya
|
||||
{
|
||||
|
@ -81,7 +81,6 @@ namespace scene
|
|||
void allKeysUp();
|
||||
void animate();
|
||||
bool isMouseKeyDown(s32 key);
|
||||
void updateAnimationState();
|
||||
|
||||
bool MouseKeys[3];
|
||||
|
||||
|
@ -94,19 +93,19 @@ namespace scene
|
|||
f32 ZoomSpeed;
|
||||
f32 RotateSpeed;
|
||||
f32 TranslateSpeed;
|
||||
f32 RotateStartX, RotateStartY;
|
||||
f32 ZoomStartX, ZoomStartY;
|
||||
f32 TranslateStartX, TranslateStartY;
|
||||
core::position2df RotateStart;
|
||||
core::position2df ZoomStart;
|
||||
core::position2df TranslateStart;
|
||||
f32 CurrentZoom;
|
||||
f32 RotX, RotY;
|
||||
core::vector3df Target;
|
||||
core::vector3df OldTarget;
|
||||
scene::ICameraSceneNode* OldCamera;
|
||||
|
||||
core::position2d<f32> MousePos;
|
||||
core::position2df MousePos;
|
||||
};
|
||||
|
||||
} // end namespace scene
|
||||
} // end namespace irr
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -69,7 +69,8 @@ namespace scene
|
|||
|
||||
|
||||
//! Initializes the terrain data. Loads the vertices from the heightMapFile
|
||||
bool CTerrainSceneNode::loadHeightMap( io::IReadFile* file, video::SColor vertexColor, s32 smoothFactor )
|
||||
bool CTerrainSceneNode::loadHeightMap(io::IReadFile* file, video::SColor vertexColor,
|
||||
s32 smoothFactor)
|
||||
{
|
||||
if( !file )
|
||||
return false;
|
||||
|
@ -425,7 +426,6 @@ namespace scene
|
|||
// We copy the data to the renderBuffer, after the normals have been calculated.
|
||||
RenderBuffer->getVertexBuffer().set_used( vertexCount );
|
||||
|
||||
|
||||
for( u32 i = 0; i < vertexCount; i++ )
|
||||
{
|
||||
RenderBuffer->getVertexBuffer()[i] = mb->getVertexBuffer()[i];
|
||||
|
@ -473,6 +473,7 @@ namespace scene
|
|||
ForceRecalculation = true;
|
||||
}
|
||||
|
||||
|
||||
//! Sets the rotation of the node. This only modifies
|
||||
//! the relative rotation of the node.
|
||||
//! \param rotation: New rotation of the node in degrees.
|
||||
|
@ -483,6 +484,7 @@ namespace scene
|
|||
ForceRecalculation = true;
|
||||
}
|
||||
|
||||
|
||||
//! Sets the pivot point for rotation of this node. This is useful for the TiledTerrainManager to
|
||||
//! rotate all terrain tiles around a global world point.
|
||||
//! NOTE: The default for the RotationPivot will be the center of the individual tile.
|
||||
|
@ -492,6 +494,7 @@ namespace scene
|
|||
TerrainData.RotationPivot = pivot;
|
||||
}
|
||||
|
||||
|
||||
//! Sets the position of the node.
|
||||
//! \param newpos: New postition of the scene node.
|
||||
void CTerrainSceneNode::setPosition(const core::vector3df& newpos)
|
||||
|
@ -501,6 +504,7 @@ namespace scene
|
|||
ForceRecalculation = true;
|
||||
}
|
||||
|
||||
|
||||
//! Apply transformation changes( scale, position, rotation )
|
||||
void CTerrainSceneNode::applyTransformation()
|
||||
{
|
||||
|
@ -526,9 +530,9 @@ namespace scene
|
|||
calculatePatchData();
|
||||
|
||||
RenderBuffer->setDirty(EBT_VERTEX);
|
||||
|
||||
}
|
||||
|
||||
|
||||
//! Updates the scene nodes indices if the camera has moved or rotated by a certain
|
||||
//! threshold, which can be changed using the SetCameraMovementDeltaThreshold and
|
||||
//! SetCameraRotationDeltaThreshold functions. This also determines if a given patch
|
||||
|
@ -545,9 +549,10 @@ namespace scene
|
|||
ForceRecalculation = false;
|
||||
}
|
||||
|
||||
|
||||
void CTerrainSceneNode::preRenderLODCalculations()
|
||||
{
|
||||
SceneManager->registerNodeForRendering( this );
|
||||
SceneManager->registerNodeForRendering(this);
|
||||
// Do Not call ISceneNode::OnRegisterSceneNode(), this node should have no children
|
||||
|
||||
// Determine the camera rotation, based on the camera direction.
|
||||
|
@ -555,7 +560,6 @@ namespace scene
|
|||
const core::vector3df cameraRotation = core::line3d<f32>(cameraPosition, SceneManager->getActiveCamera()->getTarget()).getVector().getHorizontalAngle();
|
||||
const f32 CameraFOV = SceneManager->getActiveCamera()->getFOV();
|
||||
|
||||
|
||||
// Only check on the Camera's Y Rotation
|
||||
if (!ForceRecalculation)
|
||||
{
|
||||
|
@ -619,18 +623,15 @@ namespace scene
|
|||
switch (RenderBuffer->getIndexBuffer().getType())
|
||||
{
|
||||
case video::EIT_16BIT:
|
||||
{
|
||||
preRenderIndicesCalculationsDirect<u16>((u16*)RenderBuffer->getIndexBuffer().pointer());
|
||||
break;
|
||||
}
|
||||
case video::EIT_32BIT:
|
||||
{
|
||||
preRenderIndicesCalculationsDirect<u32>((u32*)RenderBuffer->getIndexBuffer().pointer());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class INDEX_TYPE>
|
||||
void CTerrainSceneNode::preRenderIndicesCalculationsDirect(INDEX_TYPE* IndexBuffer)
|
||||
{
|
||||
|
@ -689,10 +690,6 @@ namespace scene
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//! Render the scene node
|
||||
void CTerrainSceneNode::render()
|
||||
{
|
||||
|
@ -791,18 +788,21 @@ namespace scene
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
//! Return the bounding box of the entire terrain.
|
||||
const core::aabbox3d<f32>& CTerrainSceneNode::getBoundingBox() const
|
||||
{
|
||||
return TerrainData.BoundingBox;
|
||||
}
|
||||
|
||||
|
||||
//! Return the bounding box of a patch
|
||||
const core::aabbox3d<f32>& CTerrainSceneNode::getBoundingBox( s32 patchX, s32 patchZ ) const
|
||||
{
|
||||
return TerrainData.Patches[patchX * TerrainData.PatchCount + patchZ].BoundingBox;
|
||||
}
|
||||
|
||||
|
||||
//! Gets the meshbuffer data based on a specified Level of Detail.
|
||||
//! \param mb: A reference to an SMeshBuffer object
|
||||
//! \param LOD: The Level Of Detail you want the indices from.
|
||||
|
@ -863,6 +863,7 @@ namespace scene
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
//! Gets the indices for a specified patch at a specified Level of Detail.
|
||||
//! \param mb: A reference to an array of u32 indices.
|
||||
//! \param patchX: Patch x coordinate.
|
||||
|
@ -940,6 +941,7 @@ namespace scene
|
|||
return rv;
|
||||
}
|
||||
|
||||
|
||||
//! Populates an array with the CurrentLOD of each patch.
|
||||
//! \param LODs: A reference to a core::array<s32> to hold the values
|
||||
//! \return Returns the number of elements in the array
|
||||
|
@ -980,6 +982,7 @@ namespace scene
|
|||
return true;
|
||||
}
|
||||
|
||||
|
||||
//! Creates a planar texture mapping on the terrain
|
||||
//! \param resolution: resolution of the planar mapping. This is the value
|
||||
//! specifying the relation between world space and texture coordinate space.
|
||||
|
@ -1026,6 +1029,7 @@ namespace scene
|
|||
RenderBuffer->setDirty(EBT_VERTEX);
|
||||
}
|
||||
|
||||
|
||||
//! used to get the indices when generating index data for patches at varying levels of detail.
|
||||
u32 CTerrainSceneNode::getIndex(const s32 PatchX, const s32 PatchZ,
|
||||
const s32 PatchIndex, u32 vX, u32 vZ) const
|
||||
|
@ -1082,6 +1086,7 @@ namespace scene
|
|||
(vX + ((TerrainData.CalcPatchSize) * PatchX));
|
||||
}
|
||||
|
||||
|
||||
//! smooth the terrain
|
||||
void CTerrainSceneNode::smoothTerrain(CDynamicMeshBuffer* mb, s32 smoothFactor)
|
||||
{
|
||||
|
@ -1103,6 +1108,7 @@ namespace scene
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
//! calculate smooth normals
|
||||
void CTerrainSceneNode::calculateNormals( CDynamicMeshBuffer* mb )
|
||||
{
|
||||
|
@ -1226,6 +1232,7 @@ namespace scene
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
//! create patches, stuff that needs to be done only once for patches goes here.
|
||||
void CTerrainSceneNode::createPatches()
|
||||
{
|
||||
|
@ -1237,6 +1244,7 @@ namespace scene
|
|||
TerrainData.Patches = new SPatch[TerrainData.PatchCount * TerrainData.PatchCount];
|
||||
}
|
||||
|
||||
|
||||
//! used to calculate the internal STerrainData structure both at creation and after scaling/position calls.
|
||||
void CTerrainSceneNode::calculatePatchData()
|
||||
{
|
||||
|
@ -1322,6 +1330,7 @@ namespace scene
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
void CTerrainSceneNode::setCurrentLODOfPatches(s32 lod)
|
||||
{
|
||||
const s32 count = TerrainData.PatchCount * TerrainData.PatchCount;
|
||||
|
@ -1329,6 +1338,7 @@ namespace scene
|
|||
TerrainData.Patches[i].CurrentLOD = lod;
|
||||
}
|
||||
|
||||
|
||||
void CTerrainSceneNode::setCurrentLODOfPatches(const core::array<s32>& lodarray)
|
||||
{
|
||||
const s32 count = TerrainData.PatchCount * TerrainData.PatchCount;
|
||||
|
@ -1338,7 +1348,7 @@ namespace scene
|
|||
|
||||
|
||||
//! Gets the height
|
||||
f32 CTerrainSceneNode::getHeight( f32 x, f32 z ) const
|
||||
f32 CTerrainSceneNode::getHeight(f32 x, f32 z) const
|
||||
{
|
||||
if (!Mesh.getMeshBufferCount())
|
||||
return 0;
|
||||
|
|
|
@ -141,9 +141,9 @@ namespace scene
|
|||
virtual IMeshBuffer* getRenderBuffer() { return RenderBuffer; }
|
||||
|
||||
//! Gets the meshbuffer data based on a specified Level of Detail.
|
||||
//! \param mb: A reference to an SMeshBufferLightMap object
|
||||
//! \param mb: A reference to an IDynamicMeshBuffer object
|
||||
//! \param LOD: The Level Of Detail you want the indices from.
|
||||
virtual void getMeshBufferForLOD(IDynamicMeshBuffer& mb, s32 LOD ) const;
|
||||
virtual void getMeshBufferForLOD(IDynamicMeshBuffer& mb, s32 LOD=0) const;
|
||||
|
||||
//! Gets the indices for a specified patch at a specified Level of Detail.
|
||||
//! \param indices: A reference to an array of u32 indices.
|
||||
|
@ -151,10 +151,10 @@ namespace scene
|
|||
//! \param patchZ: Patch z coordinate.
|
||||
//! \param LOD: The level of detail to get for that patch. If -1, then get
|
||||
//! the CurrentLOD. If the CurrentLOD is set to -1, meaning it's not shown,
|
||||
//! then it will retrieve the triangles at the highest LOD ( 0 ).
|
||||
//! then it will retrieve the triangles at the highest LOD (0).
|
||||
//! \return: Number of indices put into the buffer.
|
||||
virtual s32 getIndicesForPatch(core::array<u32>& indices,
|
||||
s32 patchX, s32 patchZ, s32 LOD = 0 );
|
||||
s32 patchX, s32 patchZ, s32 LOD=0);
|
||||
|
||||
//! Populates an array with the CurrentLOD of each patch.
|
||||
//! \param LODs: A reference to a core::array<s32> to hold the values
|
||||
|
@ -165,7 +165,7 @@ namespace scene
|
|||
//! \param patchX: Patch x coordinate.
|
||||
//! \param patchZ: Patch z coordinate.
|
||||
//! \param LOD: The level of detail to set the patch to.
|
||||
virtual void setLODOfPatch( s32 patchX, s32 patchZ, s32 LOD );
|
||||
virtual void setLODOfPatch(s32 patchX, s32 patchZ, s32 LOD=0);
|
||||
|
||||
//! Returns center of terrain.
|
||||
virtual const core::vector3df& getTerrainCenter() const
|
||||
|
|
|
@ -28,29 +28,29 @@ class CTerrainTriangleSelector : public ITriangleSelector
|
|||
public:
|
||||
|
||||
//! Constructs a selector based on an IGeoMipMapSceneNode
|
||||
CTerrainTriangleSelector(ITerrainSceneNode* node, s32 LOD );
|
||||
CTerrainTriangleSelector(ITerrainSceneNode* node, s32 LOD);
|
||||
|
||||
//! Destructor
|
||||
virtual ~CTerrainTriangleSelector();
|
||||
|
||||
//! Clears and sets triangle data
|
||||
virtual void setTriangleData ( ITerrainSceneNode* node, s32 LOD );
|
||||
virtual void setTriangleData (ITerrainSceneNode* node, s32 LOD);
|
||||
|
||||
//! Gets all triangles.
|
||||
void getTriangles ( core::triangle3df* triangles, s32 arraySize, s32& outTriangleCount,
|
||||
const core::matrix4* transform = 0 ) const;
|
||||
void getTriangles(core::triangle3df* triangles, s32 arraySize, s32& outTriangleCount,
|
||||
const core::matrix4* transform=0) const;
|
||||
|
||||
//! Gets all triangles which lie within a specific bounding box.
|
||||
void getTriangles ( core::triangle3df* triangles, s32 arraySize, s32& outTriangleCount,
|
||||
const core::aabbox3d<f32>& box, const core::matrix4* transform = 0 ) const;
|
||||
void getTriangles(core::triangle3df* triangles, s32 arraySize, s32& outTriangleCount,
|
||||
const core::aabbox3d<f32>& box, const core::matrix4* transform=0) const;
|
||||
|
||||
//! Gets all triangles which have or may have contact with a 3d line.
|
||||
virtual void getTriangles ( core::triangle3df* triangles, s32 arraySize,
|
||||
virtual void getTriangles(core::triangle3df* triangles, s32 arraySize,
|
||||
s32& outTriangleCount, const core::line3d<f32>& line,
|
||||
const core::matrix4* transform = 0 ) const;
|
||||
const core::matrix4* transform=0) const;
|
||||
|
||||
//! Returns amount of all available triangles in this selector
|
||||
virtual s32 getTriangleCount ( ) const;
|
||||
virtual s32 getTriangleCount() const;
|
||||
|
||||
private:
|
||||
|
||||
|
@ -65,10 +65,9 @@ private:
|
|||
|
||||
struct SGeoMipMapTrianglePatches
|
||||
{
|
||||
SGeoMipMapTrianglePatches ( )
|
||||
SGeoMipMapTrianglePatches() :
|
||||
NumPatches(0), TotalTriangles(0)
|
||||
{
|
||||
TotalTriangles = 0;
|
||||
NumPatches = 0;
|
||||
}
|
||||
|
||||
core::array<SGeoMipMapTrianglePatch> TrianglePatchArray;
|
||||
|
|
|
@ -6,17 +6,20 @@
|
|||
<Option pch_mode="0" />
|
||||
<Option compiler="gcc" />
|
||||
<Build>
|
||||
<Target title="Debug">
|
||||
<Option output="..\..\bin\Win32-gcc\Irrlicht.dll" prefix_auto="0" extension_auto="0" />
|
||||
<Option object_output="..\obj\IrrDebuggcc" />
|
||||
<Target title="Win32 - Debug - dll">
|
||||
<Option output="..\..\lib\gcc\Irrlicht" prefix_auto="1" extension_auto="1" />
|
||||
<Option object_output="..\obj\win32-gcc-debug-dll" />
|
||||
<Option type="3" />
|
||||
<Option compiler="gcc" />
|
||||
<Option createDefFile="1" />
|
||||
<Option createStaticLib="1" />
|
||||
<Compiler>
|
||||
<Add option="-W" />
|
||||
<Add option="-Wall" />
|
||||
<Add option="-g" />
|
||||
<Add option="-O0" />
|
||||
<Add option="-Wextra" />
|
||||
<Add option="-Wno-unused-parameter" />
|
||||
<Add option="-DWIN32" />
|
||||
<Add option="-D_DEBUG" />
|
||||
<Add option="-D_WINDOWS" />
|
||||
|
@ -40,10 +43,13 @@
|
|||
<Add library="opengl32" />
|
||||
<Add library="winmm" />
|
||||
</Linker>
|
||||
<ExtraCommands>
|
||||
<Add after="mv ../../lib/gcc/Irrlicht.dll ../../bin/gcc/Irrlicht.dll" />
|
||||
</ExtraCommands>
|
||||
</Target>
|
||||
<Target title="Release">
|
||||
<Option output="..\..\bin\Win32-gcc\Irrlicht.dll" prefix_auto="0" extension_auto="0" />
|
||||
<Option object_output="obj\IrrReleasegcc" />
|
||||
<Target title="Win32 - Release - accurate math - dll">
|
||||
<Option output="..\..\lib\gcc\Irrlicht" prefix_auto="1" extension_auto="1" />
|
||||
<Option object_output="..\obj\win32-gcc-release-dll" />
|
||||
<Option type="3" />
|
||||
<Option compiler="gcc" />
|
||||
<Option createDefFile="1" />
|
||||
|
@ -51,6 +57,8 @@
|
|||
<Compiler>
|
||||
<Add option="-O2" />
|
||||
<Add option="-W" />
|
||||
<Add option="-Wall" />
|
||||
<Add option="-Wno-unused-parameter" />
|
||||
<Add option="-DWIN32" />
|
||||
<Add option="-DNDEBUG" />
|
||||
<Add option="-D_WINDOWS" />
|
||||
|
@ -74,10 +82,13 @@
|
|||
<Add library="opengl32" />
|
||||
<Add library="winmm" />
|
||||
</Linker>
|
||||
<ExtraCommands>
|
||||
<Add after="mv ../../lib/gcc/Irrlicht.dll ../../bin/gcc/Irrlicht.dll" />
|
||||
</ExtraCommands>
|
||||
</Target>
|
||||
<Target title="Release - Fast FPU">
|
||||
<Option output="..\..\bin\Win32-gcc\Irrlicht.dll" prefix_auto="0" extension_auto="0" />
|
||||
<Option object_output="Release - Fast FPU" />
|
||||
<Target title="Win32 - Release - fast math - dll">
|
||||
<Option output="..\..\lib\gcc\Irrlicht" prefix_auto="1" extension_auto="1" />
|
||||
<Option object_output="..\obj\win32-gcc-release-fast-dll" />
|
||||
<Option type="3" />
|
||||
<Option compiler="gcc" />
|
||||
<Option createDefFile="1" />
|
||||
|
@ -85,6 +96,9 @@
|
|||
<Compiler>
|
||||
<Add option="-O3" />
|
||||
<Add option="-W" />
|
||||
<Add option="-Wall" />
|
||||
<Add option="-ffast-math" />
|
||||
<Add option="-Wno-unused-parameter" />
|
||||
<Add option="-DWIN32" />
|
||||
<Add option="-DNDEBUG" />
|
||||
<Add option="-D_WINDOWS" />
|
||||
|
@ -108,10 +122,88 @@
|
|||
<Add library="opengl32" />
|
||||
<Add library="winmm" />
|
||||
</Linker>
|
||||
<ExtraCommands>
|
||||
<Add after="mv ../../lib/gcc/Irrlicht.dll ../../bin/gcc/Irrlicht.dll" />
|
||||
</ExtraCommands>
|
||||
</Target>
|
||||
<Target title="Linux - Debug - shared">
|
||||
<Option output="..\..\lib\gcc\libIrrlicht" prefix_auto="0" extension_auto="1" />
|
||||
<Option object_output="..\obj\linux-gcc-debug-shared" />
|
||||
<Option type="3" />
|
||||
<Option compiler="gcc" />
|
||||
<Option createDefFile="1" />
|
||||
<Option createStaticLib="1" />
|
||||
<Compiler>
|
||||
<Add option="-W" />
|
||||
<Add option="-Wall" />
|
||||
<Add option="-g" />
|
||||
<Add option="-O0" />
|
||||
<Add option="-Wextra" />
|
||||
<Add option="-Wno-unused-parameter" />
|
||||
<Add directory="..\..\include" />
|
||||
<Add directory="zlib" />
|
||||
<Add directory="libpng" />
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add library="GLU" />
|
||||
<Add library="GL" />
|
||||
<Add library="Xxf86vm" />
|
||||
<Add directory="\usr\X11R6\lib" />
|
||||
<Add directory="\usr\local\lib" />
|
||||
</Linker>
|
||||
</Target>
|
||||
<Target title="Linux - Release - accurate math - shared">
|
||||
<Option output="..\..\lib\gcc\libIrrlicht" prefix_auto="0" extension_auto="1" />
|
||||
<Option object_output="..\obj\linux-gcc-release-shared" />
|
||||
<Option type="3" />
|
||||
<Option compiler="gcc" />
|
||||
<Option createDefFile="1" />
|
||||
<Option createStaticLib="1" />
|
||||
<Compiler>
|
||||
<Add option="-O3" />
|
||||
<Add option="-W" />
|
||||
<Add option="-Wextra" />
|
||||
<Add option="-Wno-unused-parameter" />
|
||||
<Add directory="..\..\include" />
|
||||
<Add directory="zlib" />
|
||||
<Add directory="libpng" />
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add library="GLU" />
|
||||
<Add library="GL" />
|
||||
<Add library="Xxf86vm" />
|
||||
<Add directory="\usr\X11R6\lib" />
|
||||
<Add directory="\usr\local\lib" />
|
||||
</Linker>
|
||||
</Target>
|
||||
<Target title="Linux - Release - fast math - shared">
|
||||
<Option output="..\..\lib\gcc\libIrrlicht" prefix_auto="0" extension_auto="1" />
|
||||
<Option object_output="..\obj\linux-gcc-release-fast-shared" />
|
||||
<Option type="3" />
|
||||
<Option compiler="gcc" />
|
||||
<Option createDefFile="1" />
|
||||
<Option createStaticLib="1" />
|
||||
<Compiler>
|
||||
<Add option="-O3" />
|
||||
<Add option="-W" />
|
||||
<Add option="-Wextra" />
|
||||
<Add option="-Wno-unused-parameter" />
|
||||
<Add option="-ffast-math" />
|
||||
<Add directory="..\..\include" />
|
||||
<Add directory="zlib" />
|
||||
<Add directory="libpng" />
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add library="GLU" />
|
||||
<Add library="GL" />
|
||||
<Add library="Xxf86vm" />
|
||||
<Add directory="\usr\X11R6\lib" />
|
||||
<Add directory="\usr\local\lib" />
|
||||
</Linker>
|
||||
</Target>
|
||||
</Build>
|
||||
<VirtualTargets>
|
||||
<Add alias="All" targets="Debug;Release;Release - Fast FPU;" />
|
||||
<Add alias="All" targets="Win32 - Debug - dll;Win32 - Release - accurate math - dll;Win32 - Release - fast math - dll;" />
|
||||
</VirtualTargets>
|
||||
<Compiler>
|
||||
<Add option="-D__GNUWIN32__" />
|
||||
|
@ -328,7 +420,7 @@
|
|||
<Unit filename="CFileSystem.h" />
|
||||
<Unit filename="CGUIButton.cpp" />
|
||||
<Unit filename="CGUIButton.h" />
|
||||
<Unit filename="CGUICheckbox.cpp" />
|
||||
<Unit filename="CGUICheckBox.cpp" />
|
||||
<Unit filename="CGUICheckbox.h" />
|
||||
<Unit filename="CGUIColorSelectDialog.cpp" />
|
||||
<Unit filename="CGUIColorSelectDialog.h" />
|
||||
|
@ -867,6 +959,7 @@
|
|||
<Extensions>
|
||||
<code_completion />
|
||||
<debugger />
|
||||
<envvars />
|
||||
</Extensions>
|
||||
</Project>
|
||||
</CodeBlocks_project_file>
|
|
@ -81,7 +81,10 @@ else:
|
|||
if PROFILE:
|
||||
CXXFLAGS += ['-pg'];
|
||||
|
||||
CXXFLAGS += ['-DPNG_NO_MMX_CODE', '-DPNG_NO_MNG_FEATURES', '-DIRRLICHT_EXPORTS=1'];
|
||||
CXXFLAGS += ['-DPNG_NO_MMX_CODE', '-DPNG_NO_MNG_FEATURES', '-DIRRLICHT_EXPORTS=1', '-D_IRR_STATIC_LIB_'];
|
||||
if USE_GCC:
|
||||
CXXFLAGS += ['-D__GNUWIN32__=1'];
|
||||
|
||||
env.Append(CCFLAGS = CXXFLAGS);
|
||||
|
||||
IrrlichtLibrary = env.SharedLibrary("Irrlicht.dll", LINKOBJ);
|
||||
|
|
|
@ -37,6 +37,7 @@ int main()
|
|||
|
||||
int fails = 0;
|
||||
|
||||
RUN_TEST(b3dAnimation);
|
||||
RUN_TEST(disambiguateTextures); // Run this first, since it validates the WD.
|
||||
RUN_TEST(exports);
|
||||
RUN_TEST(testVector3d);
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 21 KiB |
|
@ -14,7 +14,7 @@ static bool compareVectors(const core::vector2d<T> & compare,
|
|||
{
|
||||
if(compare != with)
|
||||
{
|
||||
logTestString("\nERROR: vector2d %.16f, %.16f != vector2d %.16f, %.16f\n",
|
||||
logTestString("\nERROR: vector2d %.16f, %.16f != vector2d %.16f, %.16f\n",
|
||||
(f64)compare.X, (f64)compare.Y, (f64)with.X, (f64)with.Y);
|
||||
assert(compare == with);
|
||||
return false;
|
||||
|
@ -38,18 +38,17 @@ static bool doTests()
|
|||
return false;
|
||||
}
|
||||
|
||||
vector2d<T> center(0, 0);
|
||||
|
||||
vec.rotateBy(45, center);
|
||||
vec.rotateBy(45); // Test implicit (0, 0) center
|
||||
COMPARE_VECTORS(vec, vector2d<T>(0, (T)7.0710678118654755));
|
||||
|
||||
vec.normalize();
|
||||
COMPARE_VECTORS(vec, vector2d<T>(0, (T)1.0000000461060017));
|
||||
|
||||
vec.set(10, 10);
|
||||
center.set(5, 5);
|
||||
vector2d<T> center(5, 5);
|
||||
vec.rotateBy(-5, center);
|
||||
// -5 means rotate clockwise slightly, so expect the X to increase
|
||||
// -5 means rotate clockwise slightly, so expect the X to increase
|
||||
// slightly and the Y to decrease slightly.
|
||||
COMPARE_VECTORS(vec, vector2d<T>((T)10.416752204197017, (T)9.5451947767204359));
|
||||
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
Test suite pass at GMT Wed Dec 03 12:54:57 2008
|
||||
Test suite pass at GMT Mon Dec 08 14:07:08 2008
|
||||
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
<Option compiler="gcc" />
|
||||
<Build>
|
||||
<Target title="Debug">
|
||||
<Option output="..\bin\Win32-gcc\tests" prefix_auto="1" extension_auto="1" />
|
||||
<Option object_output="Debug\" />
|
||||
<Option output="../bin/gcc/tests" prefix_auto="1" extension_auto="1" />
|
||||
<Option object_output="Debug/" />
|
||||
<Option type="1" />
|
||||
<Option compiler="gcc" />
|
||||
<Compiler>
|
||||
|
@ -16,12 +16,12 @@
|
|||
</Compiler>
|
||||
</Target>
|
||||
<Target title="Release">
|
||||
<Option output="..\bin\Win32-gcc\tests" prefix_auto="1" extension_auto="1" />
|
||||
<Option object_output="Release\" />
|
||||
<Option output="../bin/gcc/tests" prefix_auto="1" extension_auto="1" />
|
||||
<Option object_output="Release/" />
|
||||
<Option type="1" />
|
||||
<Option compiler="gcc" />
|
||||
<Compiler>
|
||||
<Add option="-O2" />
|
||||
<Add option="-O3" />
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add option="-s" />
|
||||
|
@ -31,12 +31,13 @@
|
|||
<Compiler>
|
||||
<Add option="-Wall" />
|
||||
<Add option="-fexceptions" />
|
||||
<Add directory="..\include" />
|
||||
<Add directory="../include" />
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add library="Irrlicht" />
|
||||
<Add directory="..\bin\Win32-gcc" />
|
||||
<Add directory="../lib/gcc" />
|
||||
</Linker>
|
||||
<Unit filename="b3dAnimation.cpp" />
|
||||
<Unit filename="disambiguateTextures.cpp" />
|
||||
<Unit filename="drawPixel.cpp" />
|
||||
<Unit filename="exports.cpp" />
|
||||
|
@ -52,6 +53,7 @@
|
|||
<Extensions>
|
||||
<code_completion />
|
||||
<debugger />
|
||||
<envvars />
|
||||
</Extensions>
|
||||
</Project>
|
||||
</CodeBlocks_project_file>
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||
<CodeBlocks_workspace_file>
|
||||
<Workspace title="tests">
|
||||
<Project filename="tests.cbp" active="1" />
|
||||
<Project filename="..\source\Irrlicht\Irrlicht-gcc.cbp" />
|
||||
</Workspace>
|
||||
</CodeBlocks_workspace_file>
|
|
@ -169,6 +169,10 @@
|
|||
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\b3dAnimation.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\disambiguateTextures.cpp"
|
||||
>
|
||||
|
|
|
@ -165,6 +165,10 @@
|
|||
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\b3dAnimation.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\disambiguateTextures.cpp"
|
||||
>
|
||||
|
|
Loading…
Reference in New Issue