Cycles: svn merge -r37957:39132 https://svn.blender.org/svnroot/bf-blender/trunk/blender
This commit is contained in:
@@ -1,33 +1,33 @@
|
||||
|
||||
set(INC
|
||||
.
|
||||
../../../intern/string
|
||||
../Converter
|
||||
../Expressions
|
||||
../GameLogic
|
||||
../Ketsji
|
||||
../Network
|
||||
../Network/LoopBackNetwork
|
||||
../Physics/Bullet
|
||||
../Physics/common
|
||||
../Rasterizer
|
||||
../Rasterizer/RAS_OpenGLRasterizer
|
||||
../SceneGraph
|
||||
../../blender
|
||||
../../blender/blenfont
|
||||
../../blender/blenkernel
|
||||
../../blender/blenlib
|
||||
../../blender/blenloader
|
||||
../../blender/editors/include
|
||||
../../blender/gpu
|
||||
../../blender/imbuf
|
||||
../../blender/makesdna
|
||||
../../blender/makesrna
|
||||
../../blender/windowmanager
|
||||
../../../extern/bullet2/src
|
||||
../../../intern/container
|
||||
../../../intern/guardedalloc
|
||||
../../../source/gameengine/Rasterizer/RAS_OpenGLRasterizer
|
||||
../../../source/gameengine/Converter
|
||||
../../../source/blender/imbuf
|
||||
../../../intern/moto/include
|
||||
../../../source/gameengine/Ketsji
|
||||
../../../source/blender/blenlib
|
||||
../../../source/blender/blenkernel
|
||||
../../../source/blender/blenfont
|
||||
../../../source/blender/editors/include
|
||||
../../../source/blender/windowmanager
|
||||
../../../source/blender
|
||||
../../../source/blender/makesdna
|
||||
../../../source/blender/makesrna
|
||||
../../../source/gameengine/Rasterizer
|
||||
../../../source/gameengine/GameLogic
|
||||
../../../source/gameengine/Expressions
|
||||
../../../source/gameengine/Network
|
||||
../../../source/gameengine/SceneGraph
|
||||
../../../source/gameengine/Physics/common
|
||||
../../../source/gameengine/Physics/Bullet
|
||||
../../../source/gameengine/Network/LoopBackNetwork
|
||||
../../../source/blender/blenloader
|
||||
../../../source/blender/gpu
|
||||
../../../extern/bullet2/src
|
||||
../../../intern/string
|
||||
${GLEW_INCLUDE_PATH}
|
||||
)
|
||||
|
||||
|
||||
@@ -1976,8 +1976,8 @@ void BL_ConvertBlenderObjects(struct Main* maggie,
|
||||
frame_type = RAS_FrameSettings::e_frame_scale;
|
||||
}
|
||||
|
||||
aspect_width = blenderscene->gm.xsch;
|
||||
aspect_height = blenderscene->gm.ysch;
|
||||
aspect_width = blenderscene->r.xsch*blenderscene->r.xasp;
|
||||
aspect_height = blenderscene->r.ysch*blenderscene->r.yasp;
|
||||
}
|
||||
|
||||
RAS_FrameSettings frame_settings(
|
||||
|
||||
@@ -26,36 +26,35 @@
|
||||
|
||||
set(INC
|
||||
.
|
||||
../../../intern/string
|
||||
../../../intern/guardedalloc
|
||||
../../../intern/container
|
||||
../../../source/gameengine/Rasterizer/RAS_OpenGLRasterizer
|
||||
../../../source/gameengine/Converter
|
||||
../../../source/gameengine/BlenderRoutines
|
||||
../../../source/blender/imbuf
|
||||
../../../intern/moto/include
|
||||
../../../source/gameengine/Ketsji
|
||||
../../../source/gameengine/Ketsji/KXNetwork
|
||||
../../../source/blender/blenlib
|
||||
../../../source/blender/blenkernel
|
||||
../../../source/blender/windowmanager
|
||||
../../../source/blender
|
||||
../../../source/blender/makesdna
|
||||
../../../source/blender/makesrna
|
||||
../../../source/gameengine/Rasterizer
|
||||
../../../source/gameengine/Rasterizer/RAS_OpenGLRasterizer
|
||||
../../../source/gameengine/GameLogic
|
||||
../../../source/gameengine/Expressions
|
||||
../../../source/gameengine/Network
|
||||
../../../source/gameengine/SceneGraph
|
||||
../../../source/gameengine/Physics/common
|
||||
../../../source/gameengine/Physics/Bullet
|
||||
../../../source/gameengine/Physics/Dummy
|
||||
../../../source/gameengine/Network/LoopBackNetwork
|
||||
../../../source/blender/blenloader
|
||||
../../../source/blender/gpu
|
||||
../../../source/blender/ikplugin
|
||||
../BlenderRoutines
|
||||
../Expressions
|
||||
../GameLogic
|
||||
../Ketsji
|
||||
../Ketsji/KXNetwork
|
||||
../Network
|
||||
../Network/LoopBackNetwork
|
||||
../Physics/Bullet
|
||||
../Physics/Dummy
|
||||
../Physics/common
|
||||
../Rasterizer
|
||||
../Rasterizer/RAS_OpenGLRasterizer
|
||||
../Rasterizer/RAS_OpenGLRasterizer
|
||||
../SceneGraph
|
||||
../../blender
|
||||
../../blender/blenkernel
|
||||
../../blender/blenlib
|
||||
../../blender/blenloader
|
||||
../../blender/gpu
|
||||
../../blender/ikplugin
|
||||
../../blender/imbuf
|
||||
../../blender/makesdna
|
||||
../../blender/makesrna
|
||||
../../blender/windowmanager
|
||||
../../../extern/bullet2/src
|
||||
../../../intern/container
|
||||
../../../intern/guardedalloc
|
||||
../../../intern/moto/include
|
||||
../../../intern/string
|
||||
)
|
||||
|
||||
set(INC_SYS
|
||||
|
||||
@@ -950,7 +950,6 @@ bool KX_BlenderSceneConverter::LinkBlendFilePath(const char *path, char *group,
|
||||
|
||||
bool KX_BlenderSceneConverter::LinkBlendFile(BlendHandle *bpy_openlib, const char *path, char *group, KX_Scene *scene_merge, char **err_str, short options)
|
||||
{
|
||||
bContext *C;
|
||||
Main *main_newlib; /* stored as a dynamic 'main' until we free it */
|
||||
Main *main_tmp= NULL; /* created only for linking, then freed */
|
||||
LinkNode *names = NULL;
|
||||
@@ -981,12 +980,10 @@ bool KX_BlenderSceneConverter::LinkBlendFile(BlendHandle *bpy_openlib, const cha
|
||||
}
|
||||
|
||||
main_newlib= (Main *)MEM_callocN( sizeof(Main), "BgeMain");
|
||||
C= CTX_create();
|
||||
CTX_data_main_set(C, main_newlib);
|
||||
BKE_reports_init(&reports, RPT_STORE);
|
||||
|
||||
/* here appending/linking starts */
|
||||
main_tmp = BLO_library_append_begin(C, &bpy_openlib, (char *)path);
|
||||
main_tmp = BLO_library_append_begin(main_newlib, &bpy_openlib, (char *)path);
|
||||
|
||||
int totnames_dummy;
|
||||
names = BLO_blendhandle_get_datablock_names( bpy_openlib, idcode, &totnames_dummy);
|
||||
@@ -1000,11 +997,11 @@ bool KX_BlenderSceneConverter::LinkBlendFile(BlendHandle *bpy_openlib, const cha
|
||||
}
|
||||
BLI_linklist_free(names, free); /* free linklist *and* each node's data */
|
||||
|
||||
BLO_library_append_end(C, main_tmp, &bpy_openlib, idcode, flag);
|
||||
BLO_library_append_end(NULL, main_tmp, &bpy_openlib, idcode, flag);
|
||||
|
||||
/* now do another round of linking for Scenes so all actions are properly loaded */
|
||||
if (idcode==ID_SCE && options & LIB_LOAD_LOAD_ACTIONS) {
|
||||
main_tmp = BLO_library_append_begin(C, &bpy_openlib, (char *)path);
|
||||
main_tmp = BLO_library_append_begin(main_newlib, &bpy_openlib, (char *)path);
|
||||
|
||||
int totnames_dummy;
|
||||
names = BLO_blendhandle_get_datablock_names( bpy_openlib, ID_AC, &totnames_dummy);
|
||||
@@ -1018,12 +1015,11 @@ bool KX_BlenderSceneConverter::LinkBlendFile(BlendHandle *bpy_openlib, const cha
|
||||
}
|
||||
BLI_linklist_free(names, free); /* free linklist *and* each node's data */
|
||||
|
||||
BLO_library_append_end(C, main_tmp, &bpy_openlib, ID_AC, flag);
|
||||
BLO_library_append_end(NULL, main_tmp, &bpy_openlib, ID_AC, flag);
|
||||
}
|
||||
|
||||
BLO_blendhandle_close(bpy_openlib);
|
||||
|
||||
CTX_free(C);
|
||||
|
||||
BKE_reports_clear(&reports);
|
||||
/* done linking */
|
||||
|
||||
|
||||
@@ -26,11 +26,11 @@
|
||||
|
||||
set(INC
|
||||
.
|
||||
../../../intern/string
|
||||
../SceneGraph
|
||||
../../blender/blenloader
|
||||
../../../intern/guardedalloc
|
||||
../../../intern/moto/include
|
||||
../../../source/gameengine/SceneGraph
|
||||
../../../source/blender/blenloader
|
||||
../../../intern/string
|
||||
)
|
||||
|
||||
set(INC_SYS
|
||||
|
||||
@@ -1147,7 +1147,7 @@ PyObject *PyObjectPlus::NewProxyPlus_Ext(PyObjectPlus *self, PyTypeObject *tp, v
|
||||
BGE_PROXY_REF(proxy) = NULL;
|
||||
BGE_PROXY_PTR(proxy) = ptr;
|
||||
#ifdef USE_WEAKREFS
|
||||
BGE_PROXY_WKREF(self->m_proxy) = NULL;
|
||||
BGE_PROXY_WKREF(proxy) = NULL;
|
||||
#endif
|
||||
return proxy;
|
||||
}
|
||||
@@ -1184,46 +1184,10 @@ void PyObjectPlus::SetDeprecationWarnings(bool ignoreDeprecationWarnings)
|
||||
m_ignore_deprecation_warnings = ignoreDeprecationWarnings;
|
||||
}
|
||||
|
||||
void PyDebugLine()
|
||||
{
|
||||
// import sys; print '\t%s:%d' % (sys._getframe(0).f_code.co_filename, sys._getframe(0).f_lineno)
|
||||
|
||||
PyObject *getframe, *frame;
|
||||
PyObject *f_lineno, *f_code, *co_filename;
|
||||
|
||||
getframe = PySys_GetObject((char *)"_getframe"); // borrowed
|
||||
if (getframe) {
|
||||
frame = PyObject_CallObject(getframe, NULL);
|
||||
if (frame) {
|
||||
f_lineno= PyObject_GetAttrString(frame, "f_lineno");
|
||||
f_code= PyObject_GetAttrString(frame, "f_code");
|
||||
if (f_lineno && f_code) {
|
||||
co_filename= ((PyCodeObject *)f_code)->co_filename; /* borrow */
|
||||
if (co_filename) {
|
||||
|
||||
printf("\t%s:%d\n", _PyUnicode_AsString(co_filename), (int)PyLong_AsSsize_t(f_lineno));
|
||||
|
||||
Py_DECREF(f_lineno);
|
||||
Py_DECREF(f_code);
|
||||
Py_DECREF(frame);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Py_XDECREF(f_lineno);
|
||||
Py_XDECREF(f_code);
|
||||
Py_DECREF(frame);
|
||||
}
|
||||
|
||||
}
|
||||
PyErr_Clear();
|
||||
printf("\tERROR - Could not access sys._getframe(0).f_lineno or sys._getframe().f_code.co_filename\n");
|
||||
}
|
||||
|
||||
void PyObjectPlus::ShowDeprecationWarning_func(const char* old_way,const char* new_way)
|
||||
{
|
||||
printf("Method %s is deprecated, please use %s instead.\n", old_way, new_way);
|
||||
PyDebugLine();
|
||||
PyC_LineSpit();
|
||||
}
|
||||
|
||||
void PyObjectPlus::ClearDeprecationWarning()
|
||||
|
||||
@@ -54,7 +54,8 @@
|
||||
#ifdef WITH_PYTHON
|
||||
#ifdef USE_MATHUTILS
|
||||
extern "C" {
|
||||
#include "../../blender/python/generic/mathutils.h" /* so we can have mathutils callbacks */
|
||||
#include "../../blender/python/mathutils/mathutils.h" /* so we can have mathutils callbacks */
|
||||
#include "../../blender/python/generic/py_capi_utils.h" /* for PyC_LineSpit only */
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -25,13 +25,13 @@
|
||||
# ***** END GPL LICENSE BLOCK *****
|
||||
|
||||
set(INC
|
||||
.
|
||||
../../../intern/string
|
||||
.
|
||||
../Expressions
|
||||
../Rasterizer
|
||||
../SceneGraph
|
||||
../../../intern/container
|
||||
../../../source/gameengine/Expressions
|
||||
../../../source/gameengine/SceneGraph
|
||||
../../../intern/moto/include
|
||||
../../../source/gameengine/Rasterizer
|
||||
../../../intern/string
|
||||
)
|
||||
|
||||
set(INC_SYS
|
||||
@@ -39,8 +39,6 @@ set(INC_SYS
|
||||
)
|
||||
|
||||
set(SRC
|
||||
Joystick/SCA_Joystick.cpp
|
||||
Joystick/SCA_JoystickEvents.cpp
|
||||
SCA_2DFilterActuator.cpp
|
||||
SCA_ANDController.cpp
|
||||
SCA_ActuatorEventManager.cpp
|
||||
@@ -81,10 +79,9 @@ set(SRC
|
||||
SCA_TimeEventManager.cpp
|
||||
SCA_XNORController.cpp
|
||||
SCA_XORController.cpp
|
||||
Joystick/SCA_Joystick.cpp
|
||||
Joystick/SCA_JoystickEvents.cpp
|
||||
|
||||
Joystick/SCA_Joystick.h
|
||||
Joystick/SCA_JoystickDefines.h
|
||||
Joystick/SCA_JoystickPrivate.h
|
||||
SCA_2DFilterActuator.h
|
||||
SCA_ANDController.h
|
||||
SCA_ActuatorEventManager.h
|
||||
@@ -125,10 +122,15 @@ set(SRC
|
||||
SCA_TimeEventManager.h
|
||||
SCA_XNORController.h
|
||||
SCA_XORController.h
|
||||
Joystick/SCA_Joystick.h
|
||||
Joystick/SCA_JoystickDefines.h
|
||||
Joystick/SCA_JoystickPrivate.h
|
||||
)
|
||||
|
||||
if(WITH_SDL)
|
||||
list(APPEND INC_SYS ${SDL_INCLUDE_DIR})
|
||||
list(APPEND INC_SYS
|
||||
${SDL_INCLUDE_DIR}
|
||||
)
|
||||
else()
|
||||
add_definitions(-DDISABLE_SDL)
|
||||
endif()
|
||||
|
||||
@@ -89,7 +89,7 @@ SCA_Joystick *SCA_Joystick::GetInstance( short int joyindex )
|
||||
{
|
||||
int i;
|
||||
// do this once only
|
||||
if(SDL_InitSubSystem(SDL_INIT_JOYSTICK) == -1 ){
|
||||
if(SDL_InitSubSystem(SDL_INIT_JOYSTICK | SDL_INIT_VIDEO) == -1 ){
|
||||
echo("Error-Initializing-SDL: " << SDL_GetError());
|
||||
return NULL;
|
||||
}
|
||||
@@ -124,7 +124,7 @@ void SCA_Joystick::ReleaseInstance()
|
||||
m_instance[i]= NULL;
|
||||
}
|
||||
|
||||
SDL_QuitSubSystem(SDL_INIT_JOYSTICK);
|
||||
SDL_QuitSubSystem(SDL_INIT_JOYSTICK | SDL_INIT_VIDEO);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,31 +26,31 @@
|
||||
|
||||
set(INC
|
||||
.
|
||||
../../../../intern/string
|
||||
../ghost
|
||||
../../BlenderRoutines
|
||||
../../Converter
|
||||
../../Expressions
|
||||
../../GameLogic
|
||||
../../Ketsji
|
||||
../../Network
|
||||
../../Network/LoopBackNetwork
|
||||
../../Physics/common
|
||||
../../Rasterizer
|
||||
../../Rasterizer/RAS_OpenGLRasterizer
|
||||
../../SceneGraph
|
||||
../../../blender
|
||||
../../../blender/blenfont
|
||||
../../../blender/blenkernel
|
||||
../../../blender/blenlib
|
||||
../../../blender/blenloader
|
||||
../../../blender/gpu
|
||||
../../../blender/imbuf
|
||||
../../../blender/makesdna
|
||||
../../../../intern/container
|
||||
../../../../intern/ghost
|
||||
../../../../intern/guardedalloc
|
||||
../../../../intern/container
|
||||
../../../../intern/moto/include
|
||||
../../../../source/gameengine/Rasterizer/RAS_OpenGLRasterizer
|
||||
../../../../source/gameengine/Converter
|
||||
../../../../source/gameengine/BlenderRoutines
|
||||
../../../../source/blender/imbuf
|
||||
../../../../source/gameengine/Ketsji
|
||||
../../../../source/blender/blenlib
|
||||
../../../../source/blender/blenfont
|
||||
../../../../source/blender/blenkernel
|
||||
../../../../source/blender
|
||||
../../../../source/blender/makesdna
|
||||
../../../../source/gameengine/Rasterizer
|
||||
../../../../source/gameengine/GameLogic
|
||||
../../../../source/gameengine/Expressions
|
||||
../../../../source/gameengine/Network
|
||||
../../../../source/gameengine/SceneGraph
|
||||
../../../../source/gameengine/Physics/common
|
||||
../../../../source/gameengine/Network/LoopBackNetwork
|
||||
../../../../source/gameengine/GamePlayer/ghost
|
||||
../../../../source/blender/blenloader
|
||||
../../../../source/blender/gpu
|
||||
../../../../intern/string
|
||||
)
|
||||
|
||||
set(INC_SYS
|
||||
@@ -61,7 +61,6 @@ set(INC_SYS
|
||||
)
|
||||
|
||||
set(SRC
|
||||
bmfont.cpp
|
||||
GPC_Canvas.cpp
|
||||
GPC_Engine.cpp
|
||||
GPC_KeyboardDevice.cpp
|
||||
@@ -71,6 +70,7 @@ set(SRC
|
||||
GPC_RawLogoArrays.cpp
|
||||
GPC_RenderTools.cpp
|
||||
GPC_System.cpp
|
||||
bmfont.cpp
|
||||
|
||||
GPC_Canvas.h
|
||||
GPC_Engine.h
|
||||
|
||||
@@ -26,32 +26,32 @@
|
||||
|
||||
set(INC
|
||||
.
|
||||
../../../../intern/string
|
||||
../common
|
||||
../../BlenderRoutines
|
||||
../../Converter
|
||||
../../Expressions
|
||||
../../GameLogic
|
||||
../../Ketsji
|
||||
../../Network
|
||||
../../Network/LoopBackNetwork
|
||||
../../Physics/common
|
||||
../../Rasterizer
|
||||
../../Rasterizer/RAS_OpenGLRasterizer
|
||||
../../SceneGraph
|
||||
../../../blender
|
||||
../../../blender/blenfont
|
||||
../../../blender/blenkernel
|
||||
../../../blender/blenlib
|
||||
../../../blender/blenloader
|
||||
../../../blender/gpu
|
||||
../../../blender/imbuf
|
||||
../../../blender/makesdna
|
||||
../../../blender/makesrna
|
||||
../../../../intern/container
|
||||
../../../../intern/ghost
|
||||
../../../../intern/guardedalloc
|
||||
../../../../intern/container
|
||||
../../../../intern/moto/include
|
||||
../../../../source/gameengine/Rasterizer/RAS_OpenGLRasterizer
|
||||
../../../../source/gameengine/BlenderRoutines
|
||||
../../../../source/gameengine/Converter
|
||||
../../../../source/blender/imbuf
|
||||
../../../../source/gameengine/Ketsji
|
||||
../../../../source/blender/blenfont
|
||||
../../../../source/blender/blenlib
|
||||
../../../../source/blender/blenkernel
|
||||
../../../../source/blender
|
||||
../../../../source/blender/makesdna
|
||||
../../../../source/blender/makesrna
|
||||
../../../../source/gameengine/Rasterizer
|
||||
../../../../source/gameengine/GameLogic
|
||||
../../../../source/gameengine/Expressions
|
||||
../../../../source/gameengine/Network
|
||||
../../../../source/gameengine/SceneGraph
|
||||
../../../../source/gameengine/Physics/common
|
||||
../../../../source/gameengine/Network/LoopBackNetwork
|
||||
../../../../source/gameengine/GamePlayer/common
|
||||
../../../../source/blender/blenloader
|
||||
../../../../source/blender/gpu
|
||||
../../../../intern/string
|
||||
)
|
||||
|
||||
set(INC_SYS
|
||||
@@ -62,9 +62,9 @@ set(INC_SYS
|
||||
set(SRC
|
||||
GPG_Application.cpp
|
||||
GPG_Canvas.cpp
|
||||
GPG_ghost.cpp
|
||||
GPG_KeyboardDevice.cpp
|
||||
GPG_System.cpp
|
||||
GPG_ghost.cpp
|
||||
|
||||
GPG_Application.h
|
||||
GPG_Canvas.h
|
||||
|
||||
@@ -64,6 +64,7 @@ extern "C"
|
||||
#include "BKE_node.h"
|
||||
#include "BKE_report.h"
|
||||
#include "BKE_library.h"
|
||||
#include "BLI_threads.h"
|
||||
#include "BLI_blenlib.h"
|
||||
#include "DNA_scene_types.h"
|
||||
#include "DNA_userdef_types.h"
|
||||
@@ -399,7 +400,11 @@ int main(int argc, char** argv)
|
||||
::DisposeNibReference(nibRef);
|
||||
*/
|
||||
#endif // __APPLE__
|
||||
|
||||
|
||||
// We don't use threads directly in the BGE, but we need to call this so things like
|
||||
// freeing up GPU_Textures works correctly.
|
||||
BLI_threadapi_init();
|
||||
|
||||
RNA_init();
|
||||
|
||||
init_nodesystem();
|
||||
|
||||
@@ -40,6 +40,8 @@ incs = ['.',
|
||||
'#source/blender/gpu',
|
||||
'#extern/glew/include']
|
||||
|
||||
incs.append(env['BF_PTHREADS_INC'])
|
||||
|
||||
defs = [ 'GLEW_STATIC' ]
|
||||
|
||||
if env['WITH_BF_PYTHON']:
|
||||
|
||||
@@ -26,32 +26,32 @@
|
||||
|
||||
set(INC
|
||||
.
|
||||
../../../intern/string
|
||||
../../../intern/guardedalloc
|
||||
KXNetwork
|
||||
../BlenderRoutines
|
||||
../Converter
|
||||
../Expressions
|
||||
../GameLogic
|
||||
../Network
|
||||
../Network/LoopBackNetwork
|
||||
../Physics/common
|
||||
../Rasterizer
|
||||
../Rasterizer/RAS_OpenGLRasterizer
|
||||
../SceneGraph
|
||||
../../blender
|
||||
../../blender/blenfont
|
||||
../../blender/blenkernel
|
||||
../../blender/blenlib
|
||||
../../blender/blenloader
|
||||
../../blender/gpu
|
||||
../../blender/imbuf
|
||||
../../blender/makesdna
|
||||
../../blender/python
|
||||
../../blender/python/generic
|
||||
../../blender/python/mathutils
|
||||
../../../intern/container
|
||||
../../../source/gameengine/Rasterizer/RAS_OpenGLRasterizer
|
||||
../../../source/gameengine/Converter
|
||||
../../../source/gameengine/BlenderRoutines
|
||||
../../../source/blender/imbuf
|
||||
../../../intern/guardedalloc
|
||||
../../../intern/moto/include
|
||||
../../../source/gameengine/Ketsji
|
||||
../../../source/blender/blenlib
|
||||
../../../source/blender/blenfont
|
||||
../../../source/blender/blenkernel
|
||||
../../../source/blender/python
|
||||
../../../source/blender/python/generic
|
||||
../../../source/blender
|
||||
../../../source/blender/makesdna
|
||||
../../../source/gameengine/Rasterizer
|
||||
../../../source/gameengine/GameLogic
|
||||
../../../source/gameengine/Expressions
|
||||
../../../source/gameengine/Ketsji/KXNetwork
|
||||
../../../source/gameengine/Network
|
||||
../../../source/gameengine/SceneGraph
|
||||
../../../source/gameengine/Physics/common
|
||||
../../../source/gameengine/Network/LoopBackNetwork
|
||||
../../../source/blender/blenloader
|
||||
../../../source/blender/gpu
|
||||
../../../intern/string
|
||||
)
|
||||
|
||||
set(INC_SYS
|
||||
@@ -128,6 +128,10 @@ set(SRC
|
||||
KX_WorldInfo.cpp
|
||||
KX_WorldIpoController.cpp
|
||||
|
||||
BL_BlenderShader.h
|
||||
BL_Material.h
|
||||
BL_Shader.h
|
||||
BL_Texture.h
|
||||
KX_ArmatureSensor.h
|
||||
KX_BlenderMaterial.h
|
||||
KX_BulletPhysicsController.h
|
||||
@@ -200,16 +204,14 @@ set(SRC
|
||||
KX_VisibilityActuator.h
|
||||
KX_WorldInfo.h
|
||||
KX_WorldIpoController.h
|
||||
BL_BlenderShader.h
|
||||
BL_Material.h
|
||||
BL_Shader.h
|
||||
BL_Texture.h
|
||||
)
|
||||
|
||||
add_definitions(-DGLEW_STATIC)
|
||||
|
||||
if(WITH_SDL)
|
||||
list(APPEND INC_SYS ${SDL_INCLUDE_DIR})
|
||||
list(APPEND INC_SYS
|
||||
${SDL_INCLUDE_DIR}
|
||||
)
|
||||
else()
|
||||
add_definitions(-DDISABLE_SDL)
|
||||
endif()
|
||||
@@ -228,7 +230,7 @@ endif()
|
||||
if(WITH_BULLET)
|
||||
list(APPEND INC
|
||||
../../../extern/bullet2/src
|
||||
../../../source/gameengine/Physics/Bullet
|
||||
../Physics/Bullet
|
||||
)
|
||||
add_definitions(-DUSE_BULLET)
|
||||
endif()
|
||||
|
||||
@@ -26,14 +26,14 @@
|
||||
|
||||
set(INC
|
||||
.
|
||||
../../../../intern/string
|
||||
..
|
||||
../../Expressions
|
||||
../../GameLogic
|
||||
../../Network
|
||||
../../SceneGraph
|
||||
../../../../intern/container
|
||||
../../../../intern/moto/include
|
||||
../../../../source/gameengine/Ketsji
|
||||
../../../../source/gameengine/GameLogic
|
||||
../../../../source/gameengine/Expressions
|
||||
../../../../source/gameengine/SceneGraph
|
||||
../../../../source/gameengine/Network
|
||||
../../../../intern/string
|
||||
)
|
||||
|
||||
set(INC_SYS
|
||||
|
||||
@@ -1022,10 +1022,8 @@ KX_PYMETHODDEF_DOC_VARARGS(KX_Camera, getScreenRay,
|
||||
return NULL;
|
||||
|
||||
PyObject* argValue = PyTuple_New(2);
|
||||
if (argValue) {
|
||||
PyTuple_SET_ITEM(argValue, 0, PyFloat_FromDouble(x));
|
||||
PyTuple_SET_ITEM(argValue, 1, PyFloat_FromDouble(y));
|
||||
}
|
||||
PyTuple_SET_ITEM(argValue, 0, PyFloat_FromDouble(x));
|
||||
PyTuple_SET_ITEM(argValue, 1, PyFloat_FromDouble(y));
|
||||
|
||||
if(!PyVecTo(PygetScreenVect(argValue), vect))
|
||||
{
|
||||
|
||||
@@ -327,7 +327,7 @@ void KX_GameObject::RemoveParent(KX_Scene *scene)
|
||||
rootobj->m_pPhysicsController1->RemoveCompoundChild(m_pPhysicsController1);
|
||||
}
|
||||
m_pPhysicsController1->RestoreDynamics();
|
||||
if (m_pPhysicsController1->IsDyna() && rootobj->m_pPhysicsController1)
|
||||
if (m_pPhysicsController1->IsDyna() && (rootobj != NULL && rootobj->m_pPhysicsController1))
|
||||
{
|
||||
// dynamic object should remember the velocity they had while being parented
|
||||
MT_Point3 childPoint = GetSGNode()->GetWorldPosition();
|
||||
|
||||
@@ -1220,7 +1220,7 @@ void KX_KetsjiEngine::RenderFrame(KX_Scene* scene, KX_Camera* cam)
|
||||
projmat.setValue(m_overrideCamProjMat.getPointer());
|
||||
cam->SetProjectionMatrix(projmat);
|
||||
}
|
||||
} else if (cam->hasValidProjectionMatrix() && !cam->GetViewport() )
|
||||
} else if (cam->hasValidProjectionMatrix())
|
||||
{
|
||||
m_rasterizer->SetProjectionMatrix(cam->GetProjectionMatrix());
|
||||
} else
|
||||
|
||||
@@ -38,12 +38,20 @@
|
||||
#include "KX_PhysicsObjectWrapper.h"
|
||||
#include "PHY_IPhysicsController.h"
|
||||
#include "PHY_IVehicle.h"
|
||||
#include "PHY_DynamicTypes.h"
|
||||
#include "MT_Matrix3x3.h"
|
||||
|
||||
#include "PyObjectPlus.h"
|
||||
|
||||
#ifdef USE_BULLET
|
||||
# include "LinearMath/btIDebugDraw.h"
|
||||
#endif
|
||||
|
||||
#ifdef WITH_PYTHON
|
||||
|
||||
// macro copied from KX_PythonInit.cpp
|
||||
#define KX_MACRO_addTypesToDict(dict, name, name2) PyDict_SetItemString(dict, #name, item=PyLong_FromSsize_t(name2)); Py_DECREF(item)
|
||||
|
||||
// nasty glob variable to connect scripting language
|
||||
// if there is a better way (without global), please do so!
|
||||
static PHY_IPhysicsEnvironment* g_CurrentActivePhysicsEnvironment = NULL;
|
||||
@@ -84,8 +92,8 @@ static char gPyGetAppliedImpulse__doc__[] = "getAppliedImpulse(int constraintId)
|
||||
|
||||
|
||||
static PyObject* gPySetGravity(PyObject* self,
|
||||
PyObject* args,
|
||||
PyObject* kwds)
|
||||
PyObject* args,
|
||||
PyObject* kwds)
|
||||
{
|
||||
float x,y,z;
|
||||
if (PyArg_ParseTuple(args,"fff",&x,&y,&z))
|
||||
@@ -101,8 +109,8 @@ static PyObject* gPySetGravity(PyObject* self,
|
||||
}
|
||||
|
||||
static PyObject* gPySetDebugMode(PyObject* self,
|
||||
PyObject* args,
|
||||
PyObject* kwds)
|
||||
PyObject* args,
|
||||
PyObject* kwds)
|
||||
{
|
||||
int mode;
|
||||
if (PyArg_ParseTuple(args,"i",&mode))
|
||||
@@ -124,8 +132,8 @@ static PyObject* gPySetDebugMode(PyObject* self,
|
||||
|
||||
|
||||
static PyObject* gPySetNumTimeSubSteps(PyObject* self,
|
||||
PyObject* args,
|
||||
PyObject* kwds)
|
||||
PyObject* args,
|
||||
PyObject* kwds)
|
||||
{
|
||||
int substep;
|
||||
if (PyArg_ParseTuple(args,"i",&substep))
|
||||
@@ -143,8 +151,8 @@ static PyObject* gPySetNumTimeSubSteps(PyObject* self,
|
||||
|
||||
|
||||
static PyObject* gPySetNumIterations(PyObject* self,
|
||||
PyObject* args,
|
||||
PyObject* kwds)
|
||||
PyObject* args,
|
||||
PyObject* kwds)
|
||||
{
|
||||
int iter;
|
||||
if (PyArg_ParseTuple(args,"i",&iter))
|
||||
@@ -161,10 +169,9 @@ static PyObject* gPySetNumIterations(PyObject* self,
|
||||
}
|
||||
|
||||
|
||||
|
||||
static PyObject* gPySetDeactivationTime(PyObject* self,
|
||||
PyObject* args,
|
||||
PyObject* kwds)
|
||||
PyObject* args,
|
||||
PyObject* kwds)
|
||||
{
|
||||
float deactive_time;
|
||||
if (PyArg_ParseTuple(args,"f",&deactive_time))
|
||||
@@ -182,8 +189,8 @@ static PyObject* gPySetDeactivationTime(PyObject* self,
|
||||
|
||||
|
||||
static PyObject* gPySetDeactivationLinearTreshold(PyObject* self,
|
||||
PyObject* args,
|
||||
PyObject* kwds)
|
||||
PyObject* args,
|
||||
PyObject* kwds)
|
||||
{
|
||||
float linearDeactivationTreshold;
|
||||
if (PyArg_ParseTuple(args,"f",&linearDeactivationTreshold))
|
||||
@@ -201,8 +208,8 @@ static PyObject* gPySetDeactivationLinearTreshold(PyObject* self,
|
||||
|
||||
|
||||
static PyObject* gPySetDeactivationAngularTreshold(PyObject* self,
|
||||
PyObject* args,
|
||||
PyObject* kwds)
|
||||
PyObject* args,
|
||||
PyObject* kwds)
|
||||
{
|
||||
float angularDeactivationTreshold;
|
||||
if (PyArg_ParseTuple(args,"f",&angularDeactivationTreshold))
|
||||
@@ -219,8 +226,8 @@ static PyObject* gPySetDeactivationAngularTreshold(PyObject* self,
|
||||
}
|
||||
|
||||
static PyObject* gPySetContactBreakingTreshold(PyObject* self,
|
||||
PyObject* args,
|
||||
PyObject* kwds)
|
||||
PyObject* args,
|
||||
PyObject* kwds)
|
||||
{
|
||||
float contactBreakingTreshold;
|
||||
if (PyArg_ParseTuple(args,"f",&contactBreakingTreshold))
|
||||
@@ -238,8 +245,8 @@ static PyObject* gPySetContactBreakingTreshold(PyObject* self,
|
||||
|
||||
|
||||
static PyObject* gPySetCcdMode(PyObject* self,
|
||||
PyObject* args,
|
||||
PyObject* kwds)
|
||||
PyObject* args,
|
||||
PyObject* kwds)
|
||||
{
|
||||
float ccdMode;
|
||||
if (PyArg_ParseTuple(args,"f",&ccdMode))
|
||||
@@ -256,8 +263,8 @@ static PyObject* gPySetCcdMode(PyObject* self,
|
||||
}
|
||||
|
||||
static PyObject* gPySetSorConstant(PyObject* self,
|
||||
PyObject* args,
|
||||
PyObject* kwds)
|
||||
PyObject* args,
|
||||
PyObject* kwds)
|
||||
{
|
||||
float sor;
|
||||
if (PyArg_ParseTuple(args,"f",&sor))
|
||||
@@ -274,8 +281,8 @@ static PyObject* gPySetSorConstant(PyObject* self,
|
||||
}
|
||||
|
||||
static PyObject* gPySetSolverTau(PyObject* self,
|
||||
PyObject* args,
|
||||
PyObject* kwds)
|
||||
PyObject* args,
|
||||
PyObject* kwds)
|
||||
{
|
||||
float tau;
|
||||
if (PyArg_ParseTuple(args,"f",&tau))
|
||||
@@ -293,8 +300,8 @@ static PyObject* gPySetSolverTau(PyObject* self,
|
||||
|
||||
|
||||
static PyObject* gPySetSolverDamping(PyObject* self,
|
||||
PyObject* args,
|
||||
PyObject* kwds)
|
||||
PyObject* args,
|
||||
PyObject* kwds)
|
||||
{
|
||||
float damping;
|
||||
if (PyArg_ParseTuple(args,"f",&damping))
|
||||
@@ -311,8 +318,8 @@ static PyObject* gPySetSolverDamping(PyObject* self,
|
||||
}
|
||||
|
||||
static PyObject* gPySetLinearAirDamping(PyObject* self,
|
||||
PyObject* args,
|
||||
PyObject* kwds)
|
||||
PyObject* args,
|
||||
PyObject* kwds)
|
||||
{
|
||||
float damping;
|
||||
if (PyArg_ParseTuple(args,"f",&damping))
|
||||
@@ -330,8 +337,8 @@ static PyObject* gPySetLinearAirDamping(PyObject* self,
|
||||
|
||||
|
||||
static PyObject* gPySetUseEpa(PyObject* self,
|
||||
PyObject* args,
|
||||
PyObject* kwds)
|
||||
PyObject* args,
|
||||
PyObject* kwds)
|
||||
{
|
||||
int epa;
|
||||
if (PyArg_ParseTuple(args,"i",&epa))
|
||||
@@ -347,8 +354,8 @@ static PyObject* gPySetUseEpa(PyObject* self,
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
static PyObject* gPySetSolverType(PyObject* self,
|
||||
PyObject* args,
|
||||
PyObject* kwds)
|
||||
PyObject* args,
|
||||
PyObject* kwds)
|
||||
{
|
||||
int solverType;
|
||||
if (PyArg_ParseTuple(args,"i",&solverType))
|
||||
@@ -367,8 +374,8 @@ static PyObject* gPySetSolverType(PyObject* self,
|
||||
|
||||
|
||||
static PyObject* gPyGetVehicleConstraint(PyObject* self,
|
||||
PyObject* args,
|
||||
PyObject* kwds)
|
||||
PyObject* args,
|
||||
PyObject* kwds)
|
||||
{
|
||||
#if defined(_WIN64)
|
||||
__int64 constraintid;
|
||||
@@ -398,9 +405,6 @@ static PyObject* gPyGetVehicleConstraint(PyObject* self,
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
static PyObject* gPyCreateConstraint(PyObject* self,
|
||||
PyObject* args,
|
||||
PyObject* kwds)
|
||||
@@ -425,39 +429,39 @@ static PyObject* gPyCreateConstraint(PyObject* self,
|
||||
success = PyArg_ParseTuple(args,"lli",&physicsid,&physicsid2,&constrainttype);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
if (len ==6)
|
||||
else if (len == 6)
|
||||
{
|
||||
#if defined(_WIN64)
|
||||
success = PyArg_ParseTuple(args,"LLifff",&physicsid,&physicsid2,&constrainttype,
|
||||
&pivotX,&pivotY,&pivotZ);
|
||||
&pivotX,&pivotY,&pivotZ);
|
||||
#else
|
||||
success = PyArg_ParseTuple(args,"llifff",&physicsid,&physicsid2,&constrainttype,
|
||||
&pivotX,&pivotY,&pivotZ);
|
||||
&pivotX,&pivotY,&pivotZ);
|
||||
#endif
|
||||
}
|
||||
else if (len == 9)
|
||||
{
|
||||
#if defined(_WIN64)
|
||||
success = PyArg_ParseTuple(args,"LLiffffff",&physicsid,&physicsid2,&constrainttype,
|
||||
&pivotX,&pivotY,&pivotZ,&axisX,&axisY,&axisZ);
|
||||
&pivotX,&pivotY,&pivotZ,&axisX,&axisY,&axisZ);
|
||||
#else
|
||||
success = PyArg_ParseTuple(args,"lliffffff",&physicsid,&physicsid2,&constrainttype,
|
||||
&pivotX,&pivotY,&pivotZ,&axisX,&axisY,&axisZ);
|
||||
&pivotX,&pivotY,&pivotZ,&axisX,&axisY,&axisZ);
|
||||
#endif
|
||||
|
||||
}
|
||||
else if (len == 10)
|
||||
{
|
||||
#if defined(_WIN64)
|
||||
success = PyArg_ParseTuple(args,"LLiffffffi",&physicsid,&physicsid2,&constrainttype,
|
||||
&pivotX,&pivotY,&pivotZ,&axisX,&axisY,&axisZ,&flag);
|
||||
&pivotX,&pivotY,&pivotZ,&axisX,&axisY,&axisZ,&flag);
|
||||
#else
|
||||
success = PyArg_ParseTuple(args,"lliffffffi",&physicsid,&physicsid2,&constrainttype,
|
||||
&pivotX,&pivotY,&pivotZ,&axisX,&axisY,&axisZ,&flag);
|
||||
&pivotX,&pivotY,&pivotZ,&axisX,&axisY,&axisZ,&flag);
|
||||
#endif
|
||||
}
|
||||
else if (len==4)
|
||||
|
||||
/* XXX extrainfo seems to be nothing implemented. right now it works as a pivot with [X,0,0] */
|
||||
else if (len == 4)
|
||||
{
|
||||
#if defined(_WIN64)
|
||||
success = PyArg_ParseTuple(args,"LLii",&physicsid,&physicsid2,&constrainttype,&extrainfo);
|
||||
@@ -466,7 +470,7 @@ static PyObject* gPyCreateConstraint(PyObject* self,
|
||||
#endif
|
||||
pivotX=extrainfo;
|
||||
}
|
||||
|
||||
|
||||
if (success)
|
||||
{
|
||||
if (PHY_GetActiveEnvironment())
|
||||
@@ -490,20 +494,18 @@ static PyObject* gPyCreateConstraint(PyObject* self,
|
||||
MT_Vector3 axis0 = localCFrame.getColumn(0);
|
||||
MT_Vector3 axis1 = localCFrame.getColumn(1);
|
||||
MT_Vector3 axis2 = localCFrame.getColumn(2);
|
||||
|
||||
constraintid = PHY_GetActiveEnvironment()->createConstraint(physctrl,physctrl2,(enum PHY_ConstraintType)constrainttype,
|
||||
pivotX,pivotY,pivotZ,
|
||||
(float)axis0.x(),(float)axis0.y(),(float)axis0.z(),
|
||||
(float)axis1.x(),(float)axis1.y(),(float)axis1.z(),
|
||||
(float)axis2.x(),(float)axis2.y(),(float)axis2.z(),flag);
|
||||
|
||||
} else
|
||||
{
|
||||
constraintid = PHY_GetActiveEnvironment()->createConstraint(physctrl,physctrl2,(enum PHY_ConstraintType)constrainttype,
|
||||
pivotX,pivotY,pivotZ,
|
||||
(float)axis0.x(),(float)axis0.y(),(float)axis0.z(),
|
||||
(float)axis1.x(),(float)axis1.y(),(float)axis1.z(),
|
||||
(float)axis2.x(),(float)axis2.y(),(float)axis2.z(),flag);
|
||||
}
|
||||
else {
|
||||
constraintid = PHY_GetActiveEnvironment()->createConstraint(physctrl,physctrl2,(enum PHY_ConstraintType)constrainttype,pivotX,pivotY,pivotZ,axisX,axisY,axisZ,0);
|
||||
}
|
||||
|
||||
KX_ConstraintWrapper* wrap = new KX_ConstraintWrapper((enum PHY_ConstraintType)constrainttype,constraintid,PHY_GetActiveEnvironment());
|
||||
|
||||
|
||||
return wrap->NewProxy(true);
|
||||
}
|
||||
@@ -522,8 +524,8 @@ static PyObject* gPyCreateConstraint(PyObject* self,
|
||||
|
||||
|
||||
static PyObject* gPyGetAppliedImpulse(PyObject* self,
|
||||
PyObject* args,
|
||||
PyObject* kwds)
|
||||
PyObject* args,
|
||||
PyObject* kwds)
|
||||
{
|
||||
float appliedImpulse = 0.f;
|
||||
|
||||
@@ -549,8 +551,8 @@ static PyObject* gPyGetAppliedImpulse(PyObject* self,
|
||||
|
||||
|
||||
static PyObject* gPyRemoveConstraint(PyObject* self,
|
||||
PyObject* args,
|
||||
PyObject* kwds)
|
||||
PyObject* args,
|
||||
PyObject* kwds)
|
||||
{
|
||||
#if defined(_WIN64)
|
||||
__int64 constraintid;
|
||||
@@ -577,7 +579,7 @@ static PyObject* gPyExportBulletFile(PyObject*, PyObject* args)
|
||||
char* filename;
|
||||
if (!PyArg_ParseTuple(args,"s:exportBulletFile",&filename))
|
||||
return NULL;
|
||||
|
||||
|
||||
if (PHY_GetActiveEnvironment())
|
||||
{
|
||||
PHY_GetActiveEnvironment()->exportFile(filename);
|
||||
@@ -586,62 +588,61 @@ static PyObject* gPyExportBulletFile(PyObject*, PyObject* args)
|
||||
}
|
||||
|
||||
static struct PyMethodDef physicsconstraints_methods[] = {
|
||||
{"setGravity",(PyCFunction) gPySetGravity,
|
||||
METH_VARARGS, (const char *)gPySetGravity__doc__},
|
||||
{"setDebugMode",(PyCFunction) gPySetDebugMode,
|
||||
METH_VARARGS, (const char *)gPySetDebugMode__doc__},
|
||||
{"setGravity",(PyCFunction) gPySetGravity,
|
||||
METH_VARARGS, (const char*)gPySetGravity__doc__},
|
||||
{"setDebugMode",(PyCFunction) gPySetDebugMode,
|
||||
METH_VARARGS, (const char *)gPySetDebugMode__doc__},
|
||||
|
||||
/// settings that influence quality of the rigidbody dynamics
|
||||
{"setNumIterations",(PyCFunction) gPySetNumIterations,
|
||||
METH_VARARGS, (const char *)gPySetNumIterations__doc__},
|
||||
/// settings that influence quality of the rigidbody dynamics
|
||||
{"setNumIterations",(PyCFunction) gPySetNumIterations,
|
||||
METH_VARARGS, (const char *)gPySetNumIterations__doc__},
|
||||
|
||||
{"setNumTimeSubSteps",(PyCFunction) gPySetNumTimeSubSteps,
|
||||
METH_VARARGS, (const char *)gPySetNumTimeSubSteps__doc__},
|
||||
{"setNumTimeSubSteps",(PyCFunction) gPySetNumTimeSubSteps,
|
||||
METH_VARARGS, (const char *)gPySetNumTimeSubSteps__doc__},
|
||||
|
||||
{"setDeactivationTime",(PyCFunction) gPySetDeactivationTime,
|
||||
METH_VARARGS, (const char *)gPySetDeactivationTime__doc__},
|
||||
{"setDeactivationTime",(PyCFunction) gPySetDeactivationTime,
|
||||
METH_VARARGS, (const char *)gPySetDeactivationTime__doc__},
|
||||
|
||||
{"setDeactivationLinearTreshold",(PyCFunction) gPySetDeactivationLinearTreshold,
|
||||
METH_VARARGS, (const char *)gPySetDeactivationLinearTreshold__doc__},
|
||||
{"setDeactivationAngularTreshold",(PyCFunction) gPySetDeactivationAngularTreshold,
|
||||
METH_VARARGS, (const char *)gPySetDeactivationAngularTreshold__doc__},
|
||||
{"setDeactivationLinearTreshold",(PyCFunction) gPySetDeactivationLinearTreshold,
|
||||
METH_VARARGS, (const char *)gPySetDeactivationLinearTreshold__doc__},
|
||||
{"setDeactivationAngularTreshold",(PyCFunction) gPySetDeactivationAngularTreshold,
|
||||
METH_VARARGS, (const char *)gPySetDeactivationAngularTreshold__doc__},
|
||||
|
||||
{"setContactBreakingTreshold",(PyCFunction) gPySetContactBreakingTreshold,
|
||||
METH_VARARGS, (const char *)gPySetContactBreakingTreshold__doc__},
|
||||
{"setCcdMode",(PyCFunction) gPySetCcdMode,
|
||||
METH_VARARGS, (const char *)gPySetCcdMode__doc__},
|
||||
{"setSorConstant",(PyCFunction) gPySetSorConstant,
|
||||
METH_VARARGS, (const char *)gPySetSorConstant__doc__},
|
||||
{"setSolverTau",(PyCFunction) gPySetSolverTau,
|
||||
METH_VARARGS, (const char *)gPySetSolverTau__doc__},
|
||||
{"setSolverDamping",(PyCFunction) gPySetSolverDamping,
|
||||
METH_VARARGS, (const char *)gPySetSolverDamping__doc__},
|
||||
{"setContactBreakingTreshold",(PyCFunction) gPySetContactBreakingTreshold,
|
||||
METH_VARARGS, (const char *)gPySetContactBreakingTreshold__doc__},
|
||||
{"setCcdMode",(PyCFunction) gPySetCcdMode,
|
||||
METH_VARARGS, (const char *)gPySetCcdMode__doc__},
|
||||
{"setSorConstant",(PyCFunction) gPySetSorConstant,
|
||||
METH_VARARGS, (const char *)gPySetSorConstant__doc__},
|
||||
{"setSolverTau",(PyCFunction) gPySetSolverTau,
|
||||
METH_VARARGS, (const char *)gPySetSolverTau__doc__},
|
||||
{"setSolverDamping",(PyCFunction) gPySetSolverDamping,
|
||||
METH_VARARGS, (const char *)gPySetSolverDamping__doc__},
|
||||
|
||||
{"setLinearAirDamping",(PyCFunction) gPySetLinearAirDamping,
|
||||
METH_VARARGS, (const char *)gPySetLinearAirDamping__doc__},
|
||||
{"setLinearAirDamping",(PyCFunction) gPySetLinearAirDamping,
|
||||
METH_VARARGS, (const char *)gPySetLinearAirDamping__doc__},
|
||||
|
||||
{"setUseEpa",(PyCFunction) gPySetUseEpa,
|
||||
METH_VARARGS, (const char *)gPySetUseEpa__doc__},
|
||||
{"setUseEpa",(PyCFunction) gPySetUseEpa,
|
||||
METH_VARARGS, (const char *)gPySetUseEpa__doc__},
|
||||
{"setSolverType",(PyCFunction) gPySetSolverType,
|
||||
METH_VARARGS, (const char *)gPySetSolverType__doc__},
|
||||
METH_VARARGS, (const char *)gPySetSolverType__doc__},
|
||||
|
||||
|
||||
{"createConstraint",(PyCFunction) gPyCreateConstraint,
|
||||
METH_VARARGS, (const char *)gPyCreateConstraint__doc__},
|
||||
{"getVehicleConstraint",(PyCFunction) gPyGetVehicleConstraint,
|
||||
METH_VARARGS, (const char *)gPyGetVehicleConstraint__doc__},
|
||||
{"createConstraint",(PyCFunction) gPyCreateConstraint,
|
||||
METH_VARARGS, (const char *)gPyCreateConstraint__doc__},
|
||||
{"getVehicleConstraint",(PyCFunction) gPyGetVehicleConstraint,
|
||||
METH_VARARGS, (const char *)gPyGetVehicleConstraint__doc__},
|
||||
|
||||
{"removeConstraint",(PyCFunction) gPyRemoveConstraint,
|
||||
METH_VARARGS, (const char *)gPyRemoveConstraint__doc__},
|
||||
{"removeConstraint",(PyCFunction) gPyRemoveConstraint,
|
||||
METH_VARARGS, (const char *)gPyRemoveConstraint__doc__},
|
||||
{"getAppliedImpulse",(PyCFunction) gPyGetAppliedImpulse,
|
||||
METH_VARARGS, (const char *)gPyGetAppliedImpulse__doc__},
|
||||
METH_VARARGS, (const char *)gPyGetAppliedImpulse__doc__},
|
||||
|
||||
{"exportBulletFile",(PyCFunction)gPyExportBulletFile,
|
||||
METH_VARARGS, "export a .bullet file"},
|
||||
{"exportBulletFile",(PyCFunction)gPyExportBulletFile,
|
||||
METH_VARARGS, "export a .bullet file"},
|
||||
|
||||
|
||||
//sentinel
|
||||
{ NULL, (PyCFunction) NULL, 0, NULL }
|
||||
//sentinel
|
||||
{ NULL, (PyCFunction) NULL, 0, NULL }
|
||||
};
|
||||
|
||||
static struct PyModuleDef PhysicsConstraints_module_def = {
|
||||
@@ -656,12 +657,13 @@ static struct PyModuleDef PhysicsConstraints_module_def = {
|
||||
0, /* m_free */
|
||||
};
|
||||
|
||||
PyObject* initPythonConstraintBinding()
|
||||
PyObject* initPythonConstraintBinding()
|
||||
{
|
||||
|
||||
PyObject* ErrorObject;
|
||||
PyObject* m;
|
||||
PyObject* d;
|
||||
PyObject* ErrorObject;
|
||||
PyObject* m;
|
||||
PyObject* d;
|
||||
PyObject* item;
|
||||
|
||||
/* Use existing module where possible
|
||||
* be careful not to init any runtime vars after this */
|
||||
@@ -677,21 +679,43 @@ PyObject* initPythonConstraintBinding()
|
||||
PyDict_SetItemString(PySys_GetObject("modules"), PhysicsConstraints_module_def.m_name, m);
|
||||
}
|
||||
|
||||
// Add some symbolic constants to the module
|
||||
d = PyModule_GetDict(m);
|
||||
ErrorObject = PyUnicode_FromString("PhysicsConstraints.error");
|
||||
PyDict_SetItemString(d, "error", ErrorObject);
|
||||
Py_DECREF(ErrorObject);
|
||||
// Add some symbolic constants to the module
|
||||
d = PyModule_GetDict(m);
|
||||
ErrorObject = PyUnicode_FromString("PhysicsConstraints.error");
|
||||
PyDict_SetItemString(d, "error", ErrorObject);
|
||||
Py_DECREF(ErrorObject);
|
||||
|
||||
// XXXX Add constants here
|
||||
#ifdef USE_BULLET
|
||||
//Debug Modes constants to be used with setDebugMode() python function
|
||||
KX_MACRO_addTypesToDict(d, DBG_NODEBUG, btIDebugDraw::DBG_NoDebug);
|
||||
KX_MACRO_addTypesToDict(d, DBG_DRAWWIREFRAME, btIDebugDraw::DBG_DrawWireframe);
|
||||
KX_MACRO_addTypesToDict(d, DBG_DRAWAABB, btIDebugDraw::DBG_DrawAabb);
|
||||
KX_MACRO_addTypesToDict(d, DBG_DRAWFREATURESTEXT, btIDebugDraw::DBG_DrawFeaturesText);
|
||||
KX_MACRO_addTypesToDict(d, DBG_DRAWCONTACTPOINTS, btIDebugDraw::DBG_DrawContactPoints);
|
||||
KX_MACRO_addTypesToDict(d, DBG_NOHELPTEXT, btIDebugDraw::DBG_NoHelpText);
|
||||
KX_MACRO_addTypesToDict(d, DBG_DRAWTEXT, btIDebugDraw::DBG_DrawText);
|
||||
KX_MACRO_addTypesToDict(d, DBG_PROFILETIMINGS, btIDebugDraw::DBG_ProfileTimings);
|
||||
KX_MACRO_addTypesToDict(d, DBG_ENABLESATCOMPARISION, btIDebugDraw::DBG_EnableSatComparison);
|
||||
KX_MACRO_addTypesToDict(d, DBG_DISABLEBULLETLCP, btIDebugDraw::DBG_DisableBulletLCP);
|
||||
KX_MACRO_addTypesToDict(d, DBG_ENABLECDD, btIDebugDraw::DBG_EnableCCD);
|
||||
KX_MACRO_addTypesToDict(d, DBG_DRAWCONSTRAINTS, btIDebugDraw::DBG_DrawConstraints);
|
||||
KX_MACRO_addTypesToDict(d, DBG_DRAWCONSTRAINTLIMITS, btIDebugDraw::DBG_DrawConstraintLimits);
|
||||
KX_MACRO_addTypesToDict(d, DBG_FASTWIREFRAME, btIDebugDraw::DBG_FastWireframe);
|
||||
#endif // USE_BULLET
|
||||
|
||||
// Check for errors
|
||||
if (PyErr_Occurred())
|
||||
{
|
||||
Py_FatalError("can't initialize module PhysicsConstraints");
|
||||
}
|
||||
//Constraint types to be used with createConstraint() python function
|
||||
KX_MACRO_addTypesToDict(d, POINTTOPOINT_CONSTRAINT, PHY_POINT2POINT_CONSTRAINT);
|
||||
KX_MACRO_addTypesToDict(d, LINEHINGE_CONSTRAINT, PHY_LINEHINGE_CONSTRAINT);
|
||||
KX_MACRO_addTypesToDict(d, ANGULAR_CONSTRAINT, PHY_ANGULAR_CONSTRAINT);
|
||||
KX_MACRO_addTypesToDict(d, CONETWIST_CONSTRAINT, PHY_CONE_TWIST_CONSTRAINT);
|
||||
KX_MACRO_addTypesToDict(d, VEHICLE_CONSTRAINT, PHY_VEHICLE_CONSTRAINT);
|
||||
|
||||
return d;
|
||||
// Check for errors
|
||||
if (PyErr_Occurred()) {
|
||||
Py_FatalError("can't initialize module PhysicsConstraints");
|
||||
}
|
||||
|
||||
return d;
|
||||
}
|
||||
|
||||
|
||||
@@ -709,7 +733,4 @@ PHY_IPhysicsEnvironment* PHY_GetActiveEnvironment()
|
||||
return g_CurrentActivePhysicsEnvironment;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endif // WITH_PYTHON
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
#ifdef WITH_PYTHON
|
||||
#ifdef USE_MATHUTILS
|
||||
extern "C" {
|
||||
#include "../../blender/python/generic/mathutils.h" /* so we can have mathutils callbacks */
|
||||
#include "../../blender/python/mathutils/mathutils.h" /* so we can have mathutils callbacks */
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
extern "C" {
|
||||
#include "bpy_internal_import.h" /* from the blender python api, but we want to import text too! */
|
||||
#include "py_capi_utils.h"
|
||||
#include "mathutils.h" // Blender.Mathutils module copied here so the blenderlayer can use.
|
||||
#include "mathutils.h" // 'mathutils' module copied here so the blenderlayer can use.
|
||||
#include "bgl.h"
|
||||
#include "blf_py_api.h"
|
||||
|
||||
@@ -327,7 +327,7 @@ static PyObject* gPyLoadGlobalDict(PyObject*)
|
||||
{
|
||||
char marshal_path[512];
|
||||
char *marshal_buffer = NULL;
|
||||
unsigned int marshal_length;
|
||||
size_t marshal_length;
|
||||
FILE *fp = NULL;
|
||||
int result;
|
||||
|
||||
@@ -338,7 +338,7 @@ static PyObject* gPyLoadGlobalDict(PyObject*)
|
||||
if (fp) {
|
||||
// obtain file size:
|
||||
fseek (fp, 0, SEEK_END);
|
||||
marshal_length = ftell(fp);
|
||||
marshal_length = (size_t)ftell(fp);
|
||||
rewind(fp);
|
||||
|
||||
marshal_buffer = (char*)malloc (sizeof(char)*marshal_length);
|
||||
@@ -1749,7 +1749,7 @@ static void restorePySysObjects(void)
|
||||
|
||||
// Copied from bpy_interface.c
|
||||
static struct _inittab bge_internal_modules[]= {
|
||||
{(char *)"mathutils", BPyInit_mathutils},
|
||||
{(char *)"mathutils", PyInit_mathutils},
|
||||
{(char *)"bgl", BPyInit_bgl},
|
||||
{(char *)"blf", BPyInit_blf},
|
||||
{(char *)"aud", AUD_initPython},
|
||||
|
||||
@@ -6,7 +6,8 @@ Import ('env')
|
||||
sources = env.Glob('*.cpp')
|
||||
defs = [ 'GLEW_STATIC' ]
|
||||
|
||||
incs = '. #source/blender/python/generic' # Only for Mathutils! and bpy_internal_import.h, be very careful
|
||||
incs = '. #source/blender/python/generic' # Only for bpy_internal_import.h, be very careful
|
||||
incs += ' #source/blender/python/mathutils' # Only for mathutils, be very careful
|
||||
|
||||
incs += ' #intern/string #intern/guardedalloc #intern/container'
|
||||
incs += ' #source/gameengine/Rasterizer/RAS_OpenGLRasterizer'
|
||||
|
||||
@@ -26,9 +26,9 @@
|
||||
|
||||
set(INC
|
||||
.
|
||||
../../../intern/string
|
||||
../../../intern/container
|
||||
../../../intern/moto/include
|
||||
../../../intern/string
|
||||
)
|
||||
|
||||
set(INC_SYS
|
||||
|
||||
@@ -26,9 +26,9 @@
|
||||
|
||||
set(INC
|
||||
.
|
||||
../../../../intern/string
|
||||
..
|
||||
../../../../intern/container
|
||||
../../../../source/gameengine/Network
|
||||
../../../../intern/string
|
||||
)
|
||||
|
||||
set(INC_SYS
|
||||
|
||||
@@ -30,19 +30,19 @@ remove_strict_flags()
|
||||
set(INC
|
||||
.
|
||||
../common
|
||||
../../../../extern/bullet2/src
|
||||
../../../../intern/moto/include
|
||||
../../../../intern/guardedalloc
|
||||
../../../../intern/container
|
||||
../../../../intern/string
|
||||
../../Rasterizer
|
||||
../../Ketsji
|
||||
../../Expressions
|
||||
../../GameLogic
|
||||
../../Ketsji
|
||||
../../Rasterizer
|
||||
../../SceneGraph
|
||||
../../../../source/blender/makesdna
|
||||
../../../../source/blender/blenlib
|
||||
../../../../source/blender/blenkernel
|
||||
../../../blender/blenkernel
|
||||
../../../blender/blenlib
|
||||
../../../blender/makesdna
|
||||
../../../../extern/bullet2/src
|
||||
../../../../intern/container
|
||||
../../../../intern/guardedalloc
|
||||
../../../../intern/moto/include
|
||||
../../../../intern/string
|
||||
)
|
||||
|
||||
set(INC_SYS
|
||||
|
||||
@@ -26,14 +26,14 @@
|
||||
|
||||
set(INC
|
||||
.
|
||||
../../../source/blender/makesdna
|
||||
../../../source/gameengine/SceneGraph
|
||||
../../../source/gameengine/Ketsji
|
||||
../../../intern/string
|
||||
../../../intern/container
|
||||
../../../intern/moto/include
|
||||
../../../intern/guardedalloc
|
||||
../Expressions
|
||||
../Ketsji
|
||||
../SceneGraph
|
||||
../../blender/makesdna
|
||||
../../../intern/container
|
||||
../../../intern/guardedalloc
|
||||
../../../intern/moto/include
|
||||
../../../intern/string
|
||||
)
|
||||
|
||||
set(INC_SYS
|
||||
|
||||
@@ -25,18 +25,18 @@
|
||||
# ***** END GPL LICENSE BLOCK *****
|
||||
|
||||
set(INC
|
||||
../../../../intern/string
|
||||
..
|
||||
../../BlenderRoutines
|
||||
../../Ketsji
|
||||
../../SceneGraph
|
||||
../../../blender/blenkernel
|
||||
../../../blender/blenlib
|
||||
../../../blender/blenloader
|
||||
../../../blender/gpu
|
||||
../../../blender/makesdna
|
||||
../../../../intern/container
|
||||
../../../../intern/moto/include
|
||||
../../../../source/gameengine/Rasterizer
|
||||
../../../../source/gameengine/Ketsji
|
||||
../../../../source/gameengine/SceneGraph
|
||||
../../../../source/gameengine/BlenderRoutines
|
||||
../../../../source/blender/gpu
|
||||
../../../../source/blender/makesdna
|
||||
../../../../source/blender/blenkernel
|
||||
../../../../source/blender/blenlib
|
||||
../../../../source/blender/blenloader
|
||||
../../../../intern/string
|
||||
)
|
||||
|
||||
set(INC_SYS
|
||||
|
||||
@@ -26,26 +26,26 @@
|
||||
|
||||
set(INC
|
||||
.
|
||||
../../../source/gameengine/Ketsji
|
||||
../../../source/gameengine/Expressions
|
||||
../../../source/gameengine/GameLogic
|
||||
../../../source/gameengine/SceneGraph
|
||||
../../../source/gameengine/Rasterizer
|
||||
../../../source/gameengine/Rasterizer/RAS_OpenGLRasterizer
|
||||
../../../source/gameengine/BlenderRoutines
|
||||
../../../source/blender/blenlib
|
||||
../../../source/blender/blenkernel
|
||||
../../../source/blender/makesdna
|
||||
../../../source/blender/editors/include
|
||||
../../../source/blender/imbuf
|
||||
../../../source/blender/python
|
||||
../../../source/blender/python/generic
|
||||
../../../source/blender/gpu
|
||||
../BlenderRoutines
|
||||
../Expressions
|
||||
../GameLogic
|
||||
../Ketsji
|
||||
../Rasterizer
|
||||
../Rasterizer/RAS_OpenGLRasterizer
|
||||
../SceneGraph
|
||||
../../blender/blenkernel
|
||||
../../blender/blenlib
|
||||
../../blender/editors/include
|
||||
../../blender/gpu
|
||||
../../blender/imbuf
|
||||
../../blender/makesdna
|
||||
../../blender/python
|
||||
../../blender/python/generic
|
||||
../../../intern/container
|
||||
../../../intern/string
|
||||
../../../intern/moto/include
|
||||
../../../intern/guardedalloc
|
||||
../../../intern/ffmpeg
|
||||
../../../intern/guardedalloc
|
||||
../../../intern/moto/include
|
||||
../../../intern/string
|
||||
)
|
||||
|
||||
set(INC_SYS
|
||||
|
||||
Reference in New Issue
Block a user