patch 8235 8218 8211 added: various gameengine improvements, fixed windows project files

This commit is contained in:
Benoit Bolsee 2008-02-15 23:12:03 +00:00
parent 1597ba0770
commit 13aa413361
15 changed files with 108 additions and 48 deletions

@ -73,7 +73,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..\..\lib\windows\zlib\include;..\..\..\..\build\msvc_7\intern\bmfont\include;..\..\..\..\build\msvc_7\intern\bsp\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\intern\decimation\include;..\..\..\..\build\msvc_7\intern\elbeem\include;..\..\..\..\build\msvc_7\intern\iksolver\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_7\extern\verse\include;..\..\..\..\build\msvc_7\intern\opennl\include;..\..\..\..\build\msvc_7\extern\bullet\include"
AdditionalIncludeDirectories="..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\lib\windows\zlib\include;..\..\..\..\build\msvc_7\intern\bmfont\include;..\..\..\..\build\msvc_7\intern\bsp\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\intern\decimation\include;..\..\..\..\build\msvc_7\intern\elbeem\include;..\..\..\..\build\msvc_7\intern\iksolver\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_7\extern\verse\include;..\..\..\..\build\msvc_7\intern\opennl\include;..\..\..\..\build\msvc_7\extern\bullet\include"
PreprocessorDefinitions="_DEBUG;WIN32;_LIB;WITH_FREETYPE2;WITH_VERSE;WITH_OPENEXR;WITH_DDS;WITH_BULLET = 1"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@ -125,7 +125,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\..\..\lib\windows\zlib\include;..\..\..\..\build\msvc_7\intern\bmfont\include;..\..\..\..\build\msvc_7\intern\bsp\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\intern\decimation\include;..\..\..\..\build\msvc_7\intern\elbeem\include;..\..\..\..\build\msvc_7\intern\iksolver\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_7\extern\verse\include;..\..\..\..\build\msvc_7\intern\opennl\include;..\..\..\..\build\msvc_7\extern\bullet\include"
AdditionalIncludeDirectories="..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\lib\windows\zlib\include;..\..\..\..\build\msvc_7\intern\bmfont\include;..\..\..\..\build\msvc_7\intern\bsp\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\intern\decimation\include;..\..\..\..\build\msvc_7\intern\elbeem\include;..\..\..\..\build\msvc_7\intern\iksolver\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_7\extern\verse\include;..\..\..\..\build\msvc_7\intern\opennl\include;..\..\..\..\build\msvc_7\extern\bullet\include"
PreprocessorDefinitions="NDEBUG;WIN32;_LIB;WITH_FREETYPE2;UNWRAPPER;WITH_VERSE;WITH_OPENEXR;WITH_DDS;WITH_BULLET=1"
StringPooling="TRUE"
RuntimeLibrary="0"
@ -229,7 +229,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..\..\lib\windows\zlib\include;..\..\..\..\build\msvc_7\intern\bsp\include;..\..\..\..\build\msvc_7\intern\bmfont\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\intern\decimation\include;..\..\..\..\build\msvc_7\intern\elbeem\include;..\..\..\..\build\msvc_7\intern\iksolver\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_7\extern\verse\include;..\..\..\..\build\msvc_7\intern\opennl\include;..\..\..\..\build\msvc_7\extern\bullet\include"
AdditionalIncludeDirectories="..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\lib\windows\zlib\include;..\..\..\..\build\msvc_7\intern\bsp\include;..\..\..\..\build\msvc_7\intern\bmfont\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\intern\decimation\include;..\..\..\..\build\msvc_7\intern\elbeem\include;..\..\..\..\build\msvc_7\intern\iksolver\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_7\extern\verse\include;..\..\..\..\build\msvc_7\intern\opennl\include;..\..\..\..\build\msvc_7\extern\bullet\include"
PreprocessorDefinitions="_DEBUG,WIN32,_LIB,WITH_FREETYPE2"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@ -281,7 +281,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\..\..\lib\windows\zlib\include;..\..\..\..\build\msvc_7\intern\bmfont\include;..\..\..\..\build\msvc_7\intern\bsp\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\intern\decimation\include;..\..\..\..\build\msvc_7\intern\elbeem\include;..\..\..\..\build\msvc_7\intern\iksolver\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_7\extern\verse\include;..\..\..\..\build\msvc_7\intern\opennl\include;..\..\..\..\build\msvc_7\extern\bullet\include"
AdditionalIncludeDirectories="..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\lib\windows\zlib\include;..\..\..\..\build\msvc_7\intern\bmfont\include;..\..\..\..\build\msvc_7\intern\bsp\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\intern\decimation\include;..\..\..\..\build\msvc_7\intern\elbeem\include;..\..\..\..\build\msvc_7\intern\iksolver\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_7\extern\verse\include;..\..\..\..\build\msvc_7\intern\opennl\include;..\..\..\..\build\msvc_7\extern\bullet\include"
PreprocessorDefinitions="NDEBUG,WIN32,_LIB,WITH_FREETYPE2,UNWRAPPER"
StringPooling="TRUE"
RuntimeLibrary="0"

@ -19,7 +19,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..\..\lib\windows\zlib\include;..\..\..\..\build\msvc_7\intern\bsp\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\intern\decimation\include;..\..\..\..\build\msvc_7\intern\elbeem\include;..\..\..\..\build\msvc_7\intern\iksolver\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_7\extern\verse\include"
AdditionalIncludeDirectories="..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\lib\windows\zlib\include;..\..\..\..\build\msvc_7\intern\bsp\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\intern\decimation\include;..\..\..\..\build\msvc_7\intern\elbeem\include;..\..\..\..\build\msvc_7\intern\iksolver\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_7\extern\verse\include"
PreprocessorDefinitions="_DEBUG;WIN32;_LIB;WITH_FREETYPE2"
MinimalRebuild="FALSE"
BasicRuntimeChecks="3"
@ -66,7 +66,7 @@
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="..\..\..\..\lib\windows\zlib\include;..\..\..\..\build\msvc_7\intern\bsp\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\intern\decimation\include;..\..\..\..\build\msvc_7\intern\elbeem\include;..\..\..\..\build\msvc_7\intern\iksolver\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_7\extern\verse\include"
AdditionalIncludeDirectories="..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\lib\windows\zlib\include;..\..\..\..\build\msvc_7\intern\bsp\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\intern\decimation\include;..\..\..\..\build\msvc_7\intern\elbeem\include;..\..\..\..\build\msvc_7\intern\iksolver\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_7\extern\verse\include"
PreprocessorDefinitions="_DEBUG;WIN32;_LIB;WITH_FREETYPE2"
BasicRuntimeChecks="0"
RuntimeLibrary="0"
@ -113,7 +113,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..\..\lib\windows\zlib\include;..\..\..\..\build\msvc_7\intern\bsp\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\intern\decimation\include;..\..\..\..\build\msvc_7\intern\elbeem\include;..\..\..\..\build\msvc_7\intern\iksolver\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_7\extern\verse\include"
AdditionalIncludeDirectories="..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\lib\windows\zlib\include;..\..\..\..\build\msvc_7\intern\bsp\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\intern\decimation\include;..\..\..\..\build\msvc_7\intern\elbeem\include;..\..\..\..\build\msvc_7\intern\iksolver\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_7\extern\verse\include"
PreprocessorDefinitions="_DEBUG;WIN32;_LIB;WITH_FREETYPE2;WITH_OPENEXR"
MinimalRebuild="FALSE"
BasicRuntimeChecks="3"
@ -160,7 +160,7 @@
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="..\..\..\..\lib\windows\zlib\include;..\..\..\..\build\msvc_7\intern\bsp\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\intern\decimation\include;..\..\..\..\build\msvc_7\intern\elbeem\include;..\..\..\..\build\msvc_7\intern\iksolver\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_7\extern\verse\include"
AdditionalIncludeDirectories="..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\lib\windows\zlib\include;..\..\..\..\build\msvc_7\intern\bsp\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\intern\decimation\include;..\..\..\..\build\msvc_7\intern\elbeem\include;..\..\..\..\build\msvc_7\intern\iksolver\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_7\extern\verse\include"
PreprocessorDefinitions="_DEBUG;WIN32;_LIB;WITH_FREETYPE2, WITH_OPENEXR"
BasicRuntimeChecks="0"
RuntimeLibrary="0"
@ -375,6 +375,9 @@
<File
RelativePath="..\..\..\source\blender\nodes\intern\SHD_nodes\SHD_curves.c">
</File>
<File
RelativePath="..\..\..\source\blender\nodes\intern\SHD_nodes\SHD_dynamic.c">
</File>
<File
RelativePath="..\..\..\source\blender\nodes\intern\SHD_nodes\SHD_geom.c">
</File>

@ -40,7 +40,7 @@
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386
"
AdditionalDependencies="libguardedalloc.lib libstring.lib libghost.lib odelib.lib fmodvc.lib libbmfont.lib ws2_32.lib vfw32.lib odbc32.lib odbccp32.lib opengl32.lib glu32.lib openal_static.lib libjpeg.lib dxguid.lib libblenkey.lib libeay32.lib libpng.lib libz.lib libmoto.lib libSoundSystem.lib qtmlClient.lib libDummySoundSystem.lib libOpenALSoundSystem.lib SDL.lib solid.lib freetype2ST.lib Bullet.lib libdecimation.lib python25_d.lib pthreadVSE2.lib pthreadVC2.lib verse.lib libopennl.lib"
AdditionalDependencies="libguardedalloc.lib libstring.lib libghost.lib odelib.lib fmodvc.lib libbmfont.lib ws2_32.lib vfw32.lib odbc32.lib odbccp32.lib opengl32.lib glu32.lib openal_static.lib libjpeg.lib dxguid.lib libeay32.lib libpng.lib libz.lib libmoto.lib libSoundSystem.lib qtmlClient.lib libDummySoundSystem.lib libOpenALSoundSystem.lib SDL.lib solid.lib freetype2ST.lib Bullet.lib libdecimation.lib python25_d.lib pthreadVSE2.lib pthreadVC2.lib verse.lib libopennl.lib"
ShowProgress="0"
OutputFile="..\..\..\..\bin\debug\blenderplayer.exe"
LinkIncremental="2"

@ -386,8 +386,9 @@ void BL_ConvertSensors(struct Object* blenderobject,
bool bFindMaterial = false;
PHY_IPhysicsController* physCtrl = kxscene->GetPhysicsEnvironment()->CreateSphereController(radius,pos);
if (isInActiveLayer)
kxscene->GetPhysicsEnvironment()->addSensor(physCtrl);
//will be done in KX_TouchEventManager::RegisterSensor()
//if (isInActiveLayer)
// kxscene->GetPhysicsEnvironment()->addSensor(physCtrl);

@ -343,6 +343,4 @@ PyObject* SCA_ISensor::PyEvaluate(PyObject* self, PyObject* args, PyObject* kwds
{
return BoolToPyArg(Evaluate(NULL));
}
/* eof */

@ -142,7 +142,11 @@ bool KX_NetworkMessageSensor::Evaluate(CValue* event)
result = (WasUp != m_IsUp);
// Return true if the message received state has changed.
// Return always true if a message was received otherwise we can loose messages
if (m_IsUp)
return true;
// Is it usefull to return also true when the first frame without a message??
// This will cause a fast on/off cycle that seems useless!
return result;
}

@ -32,7 +32,8 @@
*/
#include "KX_Camera.h"
#include "KX_Scene.h"
#include "KX_PythonInit.h"
#include "KX_Python.h"
#include "KX_PyMath.h"
#ifdef HAVE_CONFIG_H
@ -391,6 +392,7 @@ PyMethodDef KX_Camera::Methods[] = {
KX_PYMETHODTABLE(KX_Camera, setProjectionMatrix),
KX_PYMETHODTABLE(KX_Camera, enableViewport),
KX_PYMETHODTABLE(KX_Camera, setViewport),
KX_PYMETHODTABLE(KX_Camera, setOnTop),
{NULL,NULL} //Sentinel
};
@ -759,3 +761,15 @@ KX_PYMETHODDEF_DOC(KX_Camera, setViewport,
}
Py_Return;
}
KX_PYMETHODDEF_DOC(KX_Camera, setOnTop,
"setOnTop()\n"
"Sets this camera's viewport on top\n")
{
class KX_Scene* scene;
scene = PHY_GetActiveScene();
MT_assert(scene);
scene->SetCameraOnTop(this);
Py_Return;
}

@ -251,6 +251,7 @@ public:
KX_PYMETHOD_DOC(KX_Camera, enableViewport);
KX_PYMETHOD_DOC(KX_Camera, setViewport);
KX_PYMETHOD_DOC(KX_Camera, setOnTop);
virtual PyObject* _getattr(const STR_String& attr); /* lens, near, far, projection_matrix */
virtual int _setattr(const STR_String& attr, PyObject *pyvalue);

@ -211,12 +211,6 @@ bool KX_IpoActuator::Update(double curtime, bool frame)
(*i)->Release();
}
m_events.clear();
if (m_type != KX_ACT_IPO_PLAY)
{
if (bNegativeEvent)
RemoveAllEvents();
}
}
double start_smaller_then_end = ( m_startframe < m_endframe ? 1.0 : -1.0);
@ -226,6 +220,7 @@ bool KX_IpoActuator::Update(double curtime, bool frame)
{
if (m_starttime < -2.0*start_smaller_then_end*(m_endframe - m_startframe))
{
// start for all Ipo, initial start for LOOP_STOP
m_starttime = curtime - KX_KetsjiEngine::GetSuspendedDelta();
m_bIpoPlaying = true;
}
@ -238,17 +233,10 @@ bool KX_IpoActuator::Update(double curtime, bool frame)
{
// Check if playing forwards. result = ! finished
if (!bNegativeEvent)
{
if (start_smaller_then_end > 0.0)
result = (m_localtime < m_endframe && !(m_localtime == m_startframe && bNegativeEvent));
else
result = (m_localtime > m_endframe && !(m_localtime == m_startframe && bNegativeEvent));
}
if (start_smaller_then_end > 0.0)
result = (m_localtime < m_endframe && m_bIpoPlaying);
else
{
result = (m_bIpoPlaying && (m_localtime < m_endframe));
}
result = (m_localtime > m_endframe && m_bIpoPlaying);
if (result)
{
@ -267,7 +255,6 @@ bool KX_IpoActuator::Update(double curtime, bool frame)
} else
{
m_localtime=m_startframe;
SetStartTime(curtime);
m_direction=1;
}
break;
@ -275,7 +262,7 @@ bool KX_IpoActuator::Update(double curtime, bool frame)
case KX_ACT_IPO_PINGPONG:
{
result = true;
if (bNegativeEvent && ((m_localtime == m_startframe )|| (m_localtime == m_endframe)))
if (bNegativeEvent && !m_bIpoPlaying)
result = false;
else
SetLocalTime(curtime);
@ -297,14 +284,18 @@ bool KX_IpoActuator::Update(double curtime, bool frame)
}
case KX_ACT_IPO_FLIPPER:
{
result = !(bNegativeEvent && (m_localtime == m_startframe));
if (bNegativeEvent && !m_bIpoPlaying)
result = false;
if (numevents)
{
float oldDirection = m_direction;
if (bNegativeEvent)
m_direction = -1;
else
m_direction = 1;
SetStartTime(curtime);
if (m_direction != oldDirection)
// changing direction, reset start time
SetStartTime(curtime);
}
SetLocalTime(curtime);
@ -332,18 +323,26 @@ bool KX_IpoActuator::Update(double curtime, bool frame)
m_bNegativeEvent = false;
numevents = 0;
}
SetStartTime(curtime);
if (!m_bIpoPlaying)
{
// Ipo was stopped, make sure we will restart from where it stopped
SetStartTime(curtime);
if (!bNegativeEvent)
// positive signal will restart the Ipo
m_bIpoPlaying = true;
}
} // fall through to loopend, and quit the ipo animation immediatly
}
case KX_ACT_IPO_LOOPEND:
{
if (numevents){
if (bNegativeEvent){
if (bNegativeEvent && m_bIpoPlaying){
m_bNegativeEvent = true;
}
}
if (bNegativeEvent && m_localtime == m_startframe){
if (bNegativeEvent && !m_bIpoPlaying){
result = false;
}
else
@ -414,8 +413,12 @@ bool KX_IpoActuator::Update(double curtime, bool frame)
result = false;
}
if (!result && m_type != KX_ACT_IPO_LOOPSTOP)
m_starttime = -2.0*start_smaller_then_end*(m_endframe - m_startframe) - 1.0;
if (!result)
{
if (m_type != KX_ACT_IPO_LOOPSTOP)
m_starttime = -2.0*start_smaller_then_end*(m_endframe - m_startframe) - 1.0;
m_bIpoPlaying = false;
}
return result;
}

@ -631,10 +631,10 @@ void KX_KetsjiEngine::Render()
RenderFrame(scene, cam);
}
set<class KX_Camera*>* cameras = scene->GetCameras();
list<class KX_Camera*>* cameras = scene->GetCameras();
// Draw the scene once for each camera with an enabled viewport
set<KX_Camera*>::iterator it = cameras->begin();
list<KX_Camera*>::iterator it = cameras->begin();
while(it != cameras->end())
{
if((*it)->GetViewport())

@ -1159,3 +1159,8 @@ void PHY_SetActiveScene(class KX_Scene* scene)
{
gp_KetsjiScene = scene;
}
class KX_Scene* PHY_GetActiveScene()
{
return gp_KetsjiScene;
}

@ -53,6 +53,7 @@ void exitGamePythonScripting();
void dictionaryClearByHand(PyObject *dict);
void PHY_SetActiveScene(class KX_Scene* scene);
class KX_Scene* PHY_GetActiveScene();
#include "MT_Vector3.h"
void KX_RasterizerDrawDebugLine(const MT_Vector3& from,const MT_Vector3& to,const MT_Vector3& color);

@ -77,6 +77,14 @@ bool KX_RayCast::RayTest(KX_IPhysicsController* ignore_controller, PHY_IPhysicsE
if (callback.RayHit(info, result_point, result_normal))
return true;
// There is a bug in the code below: the delta is computed with the wrong
// sign on the face opposite to the center, resulting in infinite looping.
// In Blender 2.45 this code was never executed because callback.RayHit() always
// returned true, causing the ray sensor to stop on the first object.
// To avoid changing the behaviour will simply return false here.
// It should be discussed if we want the ray sensor to "see" through objects
// that don't have the required property/material (condition to get here)
return false;
// skip past the object and keep tracing
/* We add 0.01 of fudge, so that if the margin && radius == 0., we don't endless loop. */

@ -263,7 +263,7 @@ SCA_TimeEventManager* KX_Scene::GetTimeEventManager()
set<class KX_Camera*>* KX_Scene::GetCameras()
list<class KX_Camera*>* KX_Scene::GetCameras()
{
return &m_cameras;
}
@ -847,7 +847,7 @@ MT_CmMatrix4x4& KX_Scene::GetProjectionMatrix()
KX_Camera* KX_Scene::FindCamera(KX_Camera* cam)
{
set<KX_Camera*>::iterator it = m_cameras.begin();
list<KX_Camera*>::iterator it = m_cameras.begin();
while ( (it != m_cameras.end())
&& ((*it) != cam) ) {
@ -860,7 +860,7 @@ KX_Camera* KX_Scene::FindCamera(KX_Camera* cam)
KX_Camera* KX_Scene::FindCamera(STR_String& name)
{
set<KX_Camera*>::iterator it = m_cameras.begin();
list<KX_Camera*>::iterator it = m_cameras.begin();
while ( (it != m_cameras.end())
&& ((*it)->GetName() != name) ) {
@ -872,7 +872,8 @@ KX_Camera* KX_Scene::FindCamera(STR_String& name)
void KX_Scene::AddCamera(KX_Camera* cam)
{
m_cameras.insert(cam);
if (!FindCamera(cam))
m_cameras.push_back(cam);
}
KX_Camera* KX_Scene::GetActiveCamera()
@ -893,6 +894,17 @@ void KX_Scene::SetActiveCamera(KX_Camera* cam)
m_active_camera = cam;
}
void KX_Scene::SetCameraOnTop(KX_Camera* cam)
{
if (!FindCamera(cam)){
// adding is always done at the back, so that's all that needs to be done
AddCamera(cam);
if (cam) std::cout << "Added cam " << cam->GetName() << std::endl;
} else {
m_cameras.remove(cam);
m_cameras.push_back(cam);
}
}
void KX_Scene::UpdateMeshTransformations()

@ -39,6 +39,7 @@
#include <vector>
#include <set>
#include <list>
#include "GEN_Map.h"
#include "GEN_HashedPtr.h"
@ -119,7 +120,7 @@ protected:
/**
* The set of cameras for this scene
*/
set<class KX_Camera*> m_cameras;
list<class KX_Camera*> m_cameras;
/**
* Various SCA managers used by the scene
@ -330,7 +331,7 @@ public:
GetTimeEventManager(
);
set<class KX_Camera*>*
list<class KX_Camera*>*
GetCameras(
);
@ -368,6 +369,15 @@ public:
class KX_Camera*
);
/**
* Move this camera to the end of the list so that it is rendered last.
* If the camera is not on the list, it will be added
*/
void
SetCameraOnTop(
class KX_Camera*
);
/** Return the viewmatrix as used by the last frame. */
MT_CmMatrix4x4&
GetViewMatrix(