mirror of
https://github.com/minetest/irrlicht.git
synced 2025-06-29 23:00:34 +02:00
Merging r6426 through r6466 from trunk to ogl-es branch
Note: Updated IShaderConstantSetCallBack not yet supported by ogl-es drivers git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/branches/ogl-es@6467 dfc29bdd-3216-0410-991c-e03cc46cb475
This commit is contained in:
234
examples/07.Collision/Collision_vc17.vcxproj
Normal file
234
examples/07.Collision/Collision_vc17.vcxproj
Normal file
@ -0,0 +1,234 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectName>07.Collision</ProjectName>
|
||||
<ProjectGuid>{3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}</ProjectGuid>
|
||||
<RootNamespace>Collision</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\bin\Win32-VisualStudio\</OutDir>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\..\bin\Win64-VisualStudio\</OutDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\bin\Win32-VisualStudio\</OutDir>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\bin\Win64-VisualStudio\</OutDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Midl>
|
||||
<TypeLibraryName>.\Debug/Collision.tlb</TypeLibraryName>
|
||||
<HeaderFileName>
|
||||
</HeaderFileName>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Culture>0x0c07</Culture>
|
||||
</ResourceCompile>
|
||||
<Link>
|
||||
<OutputFile>..\..\bin\Win32-VisualStudio\07.Collision.exe</OutputFile>
|
||||
<AdditionalLibraryDirectories>..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Midl>
|
||||
<TypeLibraryName>.\Debug/Collision.tlb</TypeLibraryName>
|
||||
<HeaderFileName>
|
||||
</HeaderFileName>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Culture>0x0c07</Culture>
|
||||
</ResourceCompile>
|
||||
<Link>
|
||||
<OutputFile>..\..\bin\Win64-VisualStudio\07.Collision.exe</OutputFile>
|
||||
<AdditionalLibraryDirectories>..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Midl>
|
||||
<TypeLibraryName>.\Release/Collision.tlb</TypeLibraryName>
|
||||
<HeaderFileName>
|
||||
</HeaderFileName>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
||||
<AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<StringPooling>true</StringPooling>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Culture>0x0c07</Culture>
|
||||
</ResourceCompile>
|
||||
<Link>
|
||||
<OutputFile>..\..\bin\Win32-VisualStudio\07.Collision.exe</OutputFile>
|
||||
<AdditionalLibraryDirectories>..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Midl>
|
||||
<TypeLibraryName>.\Release/Collision.tlb</TypeLibraryName>
|
||||
<HeaderFileName>
|
||||
</HeaderFileName>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
||||
<AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<StringPooling>true</StringPooling>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Culture>0x0c07</Culture>
|
||||
</ResourceCompile>
|
||||
<Link>
|
||||
<OutputFile>..\..\bin\Win64-VisualStudio\07.Collision.exe</OutputFile>
|
||||
<AdditionalLibraryDirectories>..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="main.cpp">
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
|
||||
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">EnableFastChecks</BasicRuntimeChecks>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MaxSpeed</Optimization>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
@ -52,8 +52,8 @@ int main()
|
||||
return 1; // could not create selected driver.
|
||||
|
||||
/*
|
||||
If we want to receive information about the material of a hit triangle we have to get
|
||||
collisions per meshbuffer. The only disadvantage of this is that getting them per
|
||||
If we want to receive information about the material of a hit triangle we have to get
|
||||
collisions per meshbuffer. The only disadvantage of this is that getting them per
|
||||
meshbuffer can be a little bit slower than per mesh, but usually that's not noticeable.
|
||||
If you set this to false you will no longer get material names in the title bar.
|
||||
*/
|
||||
@ -96,7 +96,7 @@ int main()
|
||||
|
||||
/*
|
||||
There is currently no way to split an octree by material.
|
||||
So if we need material infos we have to create one octree per
|
||||
So if we need material infos we have to create one octree per
|
||||
meshbuffer and put them together in a MetaTriangleSelector.
|
||||
*/
|
||||
if ( separateMeshBuffers && q3node->getMesh()->getMeshBufferCount() > 1)
|
||||
@ -117,7 +117,7 @@ int main()
|
||||
}
|
||||
else
|
||||
{
|
||||
// If you don't need material infos just create one octree for the
|
||||
// If you don't need material infos just create one octree for the
|
||||
// whole mesh.
|
||||
selector = smgr->createOctreeTriangleSelector(
|
||||
q3node->getMesh(), q3node, 128);
|
||||
@ -152,13 +152,13 @@ int main()
|
||||
the radius of an ellipsoid. Try it out and change the radius to smaller
|
||||
values, the camera will be able to move closer to walls after this. The
|
||||
next parameter is the direction and speed of gravity. We'll set it to
|
||||
(0, -1000, 0), which approximates realistic gravity (depends on the units
|
||||
which are used in the scene model). You could set it to (0,0,0) to disable
|
||||
gravity. And the last value is just an offset: Without it the ellipsoid with
|
||||
which collision detection is done would be around the camera and the camera
|
||||
would be in the middle of the ellipsoid. But as human beings, we are used to
|
||||
have our eyes on top of the body, not in the middle of it. So we place the
|
||||
scene node 50 units over the center of the ellipsoid with this parameter.
|
||||
(0, -1000, 0), which approximates realistic gravity (depends on the units
|
||||
which are used in the scene model). You could set it to (0,0,0) to disable
|
||||
gravity. And the last value is just an offset: Without it the ellipsoid with
|
||||
which collision detection is done would be around the camera and the camera
|
||||
would be in the middle of the ellipsoid. But as human beings, we are used to
|
||||
have our eyes on top of the body, not in the middle of it. So we place the
|
||||
scene node 50 units over the center of the ellipsoid with this parameter.
|
||||
And that's it, collision detection works now.
|
||||
*/
|
||||
|
||||
@ -200,19 +200,20 @@ int main()
|
||||
selection is being performed. */
|
||||
scene::IAnimatedMeshSceneNode* node = 0;
|
||||
|
||||
video::SMaterial material;
|
||||
|
||||
// Add an MD2 node, which uses vertex-based animation.
|
||||
node = smgr->addAnimatedMeshSceneNode(smgr->getMesh(mediaPath + "faerie.md2"),
|
||||
0, IDFlag_IsPickable | IDFlag_IsHighlightable);
|
||||
node->setPosition(core::vector3df(-90,-15,-140)); // Put its feet on the floor.
|
||||
node->setScale(core::vector3df(1.6f)); // Make it appear realistically scaled
|
||||
node->setMD2Animation(scene::EMAT_POINT);
|
||||
node->setAnimationSpeed(20.f);
|
||||
material.setTexture(0, driver->getTexture(mediaPath + "faerie2.bmp"));
|
||||
material.Lighting = true;
|
||||
material.NormalizeNormals = true;
|
||||
node->getMaterial(0) = material;
|
||||
if ( node )
|
||||
{
|
||||
node->setPosition(core::vector3df(-90,-15,-140)); // Put its feet on the floor.
|
||||
node->setScale(core::vector3df(1.6f)); // Make it appear realistically scaled
|
||||
node->setMD2Animation(scene::EMAT_POINT);
|
||||
node->setAnimationSpeed(20.f);
|
||||
video::SMaterial& material = node->getMaterial(0);
|
||||
material.setTexture(0, driver->getTexture(mediaPath + "faerie2.bmp"));
|
||||
material.Lighting = true;
|
||||
material.NormalizeNormals = true;
|
||||
}
|
||||
|
||||
// Now create a triangle selector for it. The selector will know that it
|
||||
// is associated with an animated node, and will update itself as necessary.
|
||||
@ -223,43 +224,49 @@ int main()
|
||||
// And this B3D file uses skinned skeletal animation.
|
||||
node = smgr->addAnimatedMeshSceneNode(smgr->getMesh(mediaPath + "ninja.b3d"),
|
||||
0, IDFlag_IsPickable | IDFlag_IsHighlightable);
|
||||
node->setScale(core::vector3df(10));
|
||||
node->setPosition(core::vector3df(-75,-66,-80));
|
||||
node->setRotation(core::vector3df(0,90,0));
|
||||
node->setAnimationSpeed(8.f);
|
||||
node->getMaterial(0).NormalizeNormals = true;
|
||||
node->getMaterial(0).Lighting = true;
|
||||
// Just do the same as we did above.
|
||||
selector = smgr->createTriangleSelector(node, separateMeshBuffers);
|
||||
node->setTriangleSelector(selector);
|
||||
selector->drop();
|
||||
if ( node )
|
||||
{
|
||||
node->setScale(core::vector3df(10));
|
||||
node->setPosition(core::vector3df(-75,-66,-80));
|
||||
node->setRotation(core::vector3df(0,90,0));
|
||||
node->setAnimationSpeed(8.f);
|
||||
node->getMaterial(0).NormalizeNormals = true;
|
||||
node->getMaterial(0).Lighting = true;
|
||||
// Just do the same as we did above.
|
||||
selector = smgr->createTriangleSelector(node, separateMeshBuffers);
|
||||
node->setTriangleSelector(selector);
|
||||
selector->drop();
|
||||
}
|
||||
|
||||
// This X files uses skeletal animation, but without skinning.
|
||||
node = smgr->addAnimatedMeshSceneNode(smgr->getMesh(mediaPath + "dwarf.x"),
|
||||
0, IDFlag_IsPickable | IDFlag_IsHighlightable);
|
||||
node->setPosition(core::vector3df(-70,-66,-30)); // Put its feet on the floor.
|
||||
node->setRotation(core::vector3df(0,-90,0)); // And turn it towards the camera.
|
||||
node->setAnimationSpeed(20.f);
|
||||
node->getMaterial(0).Lighting = true;
|
||||
selector = smgr->createTriangleSelector(node, separateMeshBuffers);
|
||||
node->setTriangleSelector(selector);
|
||||
selector->drop();
|
||||
if ( node )
|
||||
{
|
||||
node->setPosition(core::vector3df(-70,-66,-30)); // Put its feet on the floor.
|
||||
node->setRotation(core::vector3df(0,-90,0)); // And turn it towards the camera.
|
||||
node->setAnimationSpeed(20.f);
|
||||
node->getMaterial(0).Lighting = true;
|
||||
selector = smgr->createTriangleSelector(node, separateMeshBuffers);
|
||||
node->setTriangleSelector(selector);
|
||||
selector->drop();
|
||||
}
|
||||
|
||||
// And this mdl file uses skinned skeletal animation.
|
||||
node = smgr->addAnimatedMeshSceneNode(smgr->getMesh(mediaPath + "yodan.mdl"),
|
||||
0, IDFlag_IsPickable | IDFlag_IsHighlightable);
|
||||
node->setPosition(core::vector3df(-90,-25,20));
|
||||
node->setScale(core::vector3df(0.8f));
|
||||
node->getMaterial(0).Lighting = true;
|
||||
node->setAnimationSpeed(20.f);
|
||||
if ( node )
|
||||
{
|
||||
node->setPosition(core::vector3df(-90,-25,20));
|
||||
node->setScale(core::vector3df(0.8f));
|
||||
node->getMaterial(0).Lighting = true;
|
||||
node->setAnimationSpeed(20.f);
|
||||
|
||||
// Just do the same as we did above.
|
||||
selector = smgr->createTriangleSelector(node, separateMeshBuffers);
|
||||
node->setTriangleSelector(selector);
|
||||
selector->drop();
|
||||
|
||||
material.setTexture(0, 0);
|
||||
material.Lighting = false;
|
||||
// Just do the same as we did above.
|
||||
selector = smgr->createTriangleSelector(node, separateMeshBuffers);
|
||||
node->setTriangleSelector(selector);
|
||||
selector->drop();
|
||||
}
|
||||
|
||||
// Add a light, so that the unselected nodes aren't completely dark.
|
||||
scene::ILightSceneNode * light = smgr->addLightSceneNode(0, core::vector3df(-60,100,400),
|
||||
@ -271,7 +278,9 @@ int main()
|
||||
scene::ISceneCollisionManager* collMan = smgr->getSceneCollisionManager();
|
||||
|
||||
// draw the selection triangle only as wireframe
|
||||
material.Wireframe=true;
|
||||
irr::video::SMaterial materialWireframe;
|
||||
materialWireframe.Lighting = false;
|
||||
materialWireframe.Wireframe=true;
|
||||
|
||||
while(device->run())
|
||||
if (device->isWindowActive())
|
||||
@ -320,7 +329,7 @@ int main()
|
||||
|
||||
// We need to reset the transform before doing our own rendering.
|
||||
driver->setTransform(video::ETS_WORLD, core::matrix4());
|
||||
driver->setMaterial(material);
|
||||
driver->setMaterial(materialWireframe);
|
||||
driver->draw3DTriangle(hitResult.Triangle, video::SColor(0,255,0,0)); // Show which triangle has been hit
|
||||
|
||||
// We can check the flags for the scene node that was hit to see if it should be
|
||||
|
Reference in New Issue
Block a user