diff options
author | Xiao Xiangquan <xiaoxiangquan@gmail.com> | 2011-06-24 07:30:50 +0400 |
---|---|---|
committer | Xiao Xiangquan <xiaoxiangquan@gmail.com> | 2011-06-24 07:30:50 +0400 |
commit | b429af10d04d727574eb50a7186e8075ae8fb0b8 (patch) | |
tree | dae073488e49cb2a4107d3fe2d553711496bf4f9 /source/gameengine | |
parent | 9a2f36b50f818c0c1b659363a1df298f7043e207 (diff) |
merge from trunk #37722
Diffstat (limited to 'source/gameengine')
-rw-r--r-- | source/gameengine/Converter/BL_ActionActuator.cpp | 2 | ||||
-rw-r--r-- | source/gameengine/Converter/KX_ConvertActuators.cpp | 3 | ||||
-rw-r--r-- | source/gameengine/GameLogic/SCA_2DFilterActuator.cpp | 6 | ||||
-rw-r--r-- | source/gameengine/GameLogic/SCA_2DFilterActuator.h | 1 | ||||
-rw-r--r-- | source/gameengine/GamePlayer/ghost/GPG_ghost.cpp | 6 | ||||
-rw-r--r-- | source/gameengine/Ketsji/BL_Texture.cpp | 6 | ||||
-rw-r--r-- | source/gameengine/Ketsji/KX_Camera.cpp | 2 | ||||
-rw-r--r-- | source/gameengine/Ketsji/KX_CameraActuator.cpp | 9 | ||||
-rw-r--r-- | source/gameengine/Ketsji/KX_CameraActuator.h | 6 | ||||
-rw-r--r-- | source/gameengine/Physics/Bullet/CcdPhysicsController.h | 58 | ||||
-rw-r--r-- | source/gameengine/VideoTexture/CMakeLists.txt | 4 |
11 files changed, 62 insertions, 41 deletions
diff --git a/source/gameengine/Converter/BL_ActionActuator.cpp b/source/gameengine/Converter/BL_ActionActuator.cpp index c00e7ec7e29..7e353d590bb 100644 --- a/source/gameengine/Converter/BL_ActionActuator.cpp +++ b/source/gameengine/Converter/BL_ActionActuator.cpp @@ -405,7 +405,7 @@ bool BL_ActionActuator::Update(double curtime, bool frame) // 2.5x - could also do this but looks too high level, constraints use this, it works ok. // Object workob; /* evaluate using workob */ -// what_does_obaction((Scene *)obj->GetScene(), obj->GetArmatureObject(), &workob, m_pose, m_action, NULL, m_localtime); +// what_does_obaction(obj->GetArmatureObject(), &workob, m_pose, m_action, NULL, m_localtime); } // done getting the pose from the action diff --git a/source/gameengine/Converter/KX_ConvertActuators.cpp b/source/gameengine/Converter/KX_ConvertActuators.cpp index 87d6c619229..7da474241a0 100644 --- a/source/gameengine/Converter/KX_ConvertActuators.cpp +++ b/source/gameengine/Converter/KX_ConvertActuators.cpp @@ -287,7 +287,8 @@ void BL_ConvertActuators(char* maggiename, camact->height, camact->min, camact->max, - camact->axis=='x'); + camact->axis=='x', + camact->damping); baseact = tmpcamact; } break; diff --git a/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp b/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp index 0a65fc1584a..c270d9a312b 100644 --- a/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp +++ b/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp @@ -55,10 +55,10 @@ SCA_2DFilterActuator::SCA_2DFilterActuator( m_rasterizer(rasterizer), m_scene(scene) { - m_gameObj = NULL; + m_gameobj = NULL; if(gameobj){ m_propNames = gameobj->GetPropertyNames(); - m_gameObj = gameobj; + m_gameobj = gameobj; } } @@ -91,7 +91,7 @@ bool SCA_2DFilterActuator::Update() } else if(m_type < RAS_2DFilterManager::RAS_2DFILTER_NUMBER_OF_FILTERS) { - m_scene->Update2DFilter(m_propNames, m_gameObj, m_type, m_int_arg, m_shaderText); + m_scene->Update2DFilter(m_propNames, m_gameobj, m_type, m_int_arg, m_shaderText); } // once the filter is in place, no need to update it again => disable the actuator return false; diff --git a/source/gameengine/GameLogic/SCA_2DFilterActuator.h b/source/gameengine/GameLogic/SCA_2DFilterActuator.h index 87d2e8ddbcf..7f31c1713f4 100644 --- a/source/gameengine/GameLogic/SCA_2DFilterActuator.h +++ b/source/gameengine/GameLogic/SCA_2DFilterActuator.h @@ -42,7 +42,6 @@ class SCA_2DFilterActuator : public SCA_IActuator private: vector<STR_String> m_propNames; - void * m_gameObj; RAS_2DFilterManager::RAS_2DFILTER_MODE m_type; short m_disableMotionBlur; float m_float_arg; diff --git a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp index 1436f18ae6c..0e3cfc58e09 100644 --- a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp +++ b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp @@ -416,6 +416,7 @@ int main(int argc, char** argv) // We load our own G.main, so free the one that initglobals() gives us free_main(G.main); + G.main = NULL; IMB_init(); @@ -455,6 +456,9 @@ int main(int argc, char** argv) U.audioformat = 0x24; U.audiochannels = 2; + // XXX this one too + U.anisotropic_filter = 2; + sound_init_once(); /* if running blenderplayer the last argument can't be parsed since it has to be the filename. */ @@ -710,6 +714,8 @@ int main(int argc, char** argv) { GPU_set_mipmap(0); } + + GPU_set_anisotropic(U.anisotropic_filter); // Create the system if (GHOST_ISystem::createSystem() == GHOST_kSuccess) diff --git a/source/gameengine/Ketsji/BL_Texture.cpp b/source/gameengine/Ketsji/BL_Texture.cpp index d2438a66367..a306e059442 100644 --- a/source/gameengine/Ketsji/BL_Texture.cpp +++ b/source/gameengine/Ketsji/BL_Texture.cpp @@ -28,6 +28,7 @@ #define spit(x) std::cout << x << std::endl; #include "MEM_guardedalloc.h" +#include "GPU_draw.h" extern "C" { // envmaps @@ -175,6 +176,8 @@ void BL_Texture::InitGLTex(unsigned int *pix,int x,int y,bool mipmap) glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA, x, y, 0, GL_RGBA, GL_UNSIGNED_BYTE, pix ); } + if (GLEW_EXT_texture_filter_anisotropic) + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, GPU_get_anisotropic()); glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); } @@ -199,6 +202,9 @@ void BL_Texture::InitNonPow2Tex(unsigned int *pix,int x,int y,bool mipmap) glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA, nx, ny, 0, GL_RGBA, GL_UNSIGNED_BYTE, newPixels ); } + + if (GLEW_EXT_texture_filter_anisotropic) + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, GPU_get_anisotropic()); glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); free(newPixels); } diff --git a/source/gameengine/Ketsji/KX_Camera.cpp b/source/gameengine/Ketsji/KX_Camera.cpp index 98ea25c135a..473ebbd74bf 100644 --- a/source/gameengine/Ketsji/KX_Camera.cpp +++ b/source/gameengine/Ketsji/KX_Camera.cpp @@ -923,6 +923,8 @@ KX_PYMETHODDEF_DOC_O(KX_Camera, getScreenPosition, if (!PyVecTo(value, vect)) { + PyErr_Clear(); + if(ConvertPythonToGameObject(value, &obj, true, "")) { PyErr_Clear(); diff --git a/source/gameengine/Ketsji/KX_CameraActuator.cpp b/source/gameengine/Ketsji/KX_CameraActuator.cpp index d68cb453fe8..ebb291b2284 100644 --- a/source/gameengine/Ketsji/KX_CameraActuator.cpp +++ b/source/gameengine/Ketsji/KX_CameraActuator.cpp @@ -54,14 +54,16 @@ KX_CameraActuator::KX_CameraActuator( float hght, float minhght, float maxhght, - bool xytog + bool xytog, + float damping ): SCA_IActuator(gameobj, KX_ACT_CAMERA), m_ob (obj), m_height (hght), m_minHeight (minhght), m_maxHeight (maxhght), - m_x (xytog) + m_x (xytog), + m_damping (damping) { if (m_ob) m_ob->RegisterActuator(this); @@ -283,7 +285,7 @@ bool KX_CameraActuator::Update(double curtime, bool frame) } inp= fp1[0]*fp2[0] + fp1[1]*fp2[1] + fp1[2]*fp2[2]; - fac= (-1.0 + inp)/32.0; + fac= (-1.0 + inp) * m_damping; from[0]+= fac*fp1[0]; from[1]+= fac*fp1[1]; @@ -390,6 +392,7 @@ PyAttributeDef KX_CameraActuator::Attributes[] = { KX_PYATTRIBUTE_FLOAT_RW("height",-FLT_MAX,FLT_MAX,KX_CameraActuator,m_height), KX_PYATTRIBUTE_BOOL_RW("useXY",KX_CameraActuator,m_x), KX_PYATTRIBUTE_RW_FUNCTION("object", KX_CameraActuator, pyattr_get_object, pyattr_set_object), + KX_PYATTRIBUTE_FLOAT_RW("damping",0.f,10.f,KX_CameraActuator,m_damping), {NULL} }; diff --git a/source/gameengine/Ketsji/KX_CameraActuator.h b/source/gameengine/Ketsji/KX_CameraActuator.h index d59fcff9370..f844f6418b8 100644 --- a/source/gameengine/Ketsji/KX_CameraActuator.h +++ b/source/gameengine/Ketsji/KX_CameraActuator.h @@ -73,6 +73,9 @@ private : /** xy toggle (pick one): true == x, false == y */ bool m_x; + + /** damping (float), */ + float m_damping; /* get the KX_IGameObject with this name */ CValue *findObject(char *obName); @@ -95,7 +98,8 @@ private : float hght, float minhght, float maxhght, - bool xytog + bool xytog, + float damping ); diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.h b/source/gameengine/Physics/Bullet/CcdPhysicsController.h index 97dc65c5850..08445654916 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsController.h +++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.h @@ -226,18 +226,43 @@ struct CcdConstructionInfo CcdConstructionInfo() - : m_localInertiaTensor(1.f, 1.f, 1.f), + :m_localInertiaTensor(1.f, 1.f, 1.f), m_gravity(0,0,0), m_scaling(1.f,1.f,1.f), m_mass(0.f), - m_clamp_vel_min(-1.f), - m_clamp_vel_max(-1.f), + m_clamp_vel_min(-1.f), + m_clamp_vel_max(-1.f), m_restitution(0.1f), m_friction(0.5f), m_linearDamping(0.1f), m_angularDamping(0.1f), m_margin(0.06f), m_gamesoftFlag(0), + m_soft_linStiff(1.f), + m_soft_angStiff(1.f), + m_soft_volume(1.f), + m_soft_viterations(0), + m_soft_piterations(1), + m_soft_diterations(0), + m_soft_citerations(4), + m_soft_kSRHR_CL(0.1f), + m_soft_kSKHR_CL(1.f), + m_soft_kSSHR_CL(0.5f), + m_soft_kSR_SPLT_CL(0.5f), + m_soft_kSK_SPLT_CL(0.5f), + m_soft_kSS_SPLT_CL(0.5f), + m_soft_kVCF(1.f), + m_soft_kDP(0.f), + m_soft_kDG(0.f), + m_soft_kLF(0.f), + m_soft_kPR(0.f), + m_soft_kVC(0.f), + m_soft_kDF(0.2f), + m_soft_kMT(0), + m_soft_kCHR(1.0f), + m_soft_kKHR(0.1f), + m_soft_kSHR(1.0f), + m_soft_kAHR(0.7f), m_collisionFlags(0), m_bRigid(false), m_bSoft(false), @@ -252,38 +277,13 @@ struct CcdConstructionInfo m_inertiaFactor(1.f), m_do_anisotropic(false), m_anisotropicFriction(1.f,1.f,1.f), - m_contactProcessingThreshold(1e10f), - m_soft_linStiff(1.f), - m_soft_angStiff(1.f), - m_soft_volume(1.f), - m_soft_viterations(0), - m_soft_piterations(1), - m_soft_diterations(0), - m_soft_citerations(4), m_do_fh(false), m_do_rot_fh(false), m_fh_spring(0.f), m_fh_damping(0.f), m_fh_distance(1.f), m_fh_normal(false), - m_soft_kVCF(1.f), - m_soft_kDG(0.f), - m_soft_kLF(0.f), - m_soft_kDP(0.f), - m_soft_kPR(0.f), - m_soft_kVC(0.f), - m_soft_kDF(0.2f), - m_soft_kMT(0), - m_soft_kCHR(1.0f), - m_soft_kKHR(0.1f), - m_soft_kSHR(1.0f), - m_soft_kAHR(0.7f), - m_soft_kSRHR_CL(0.1f), - m_soft_kSKHR_CL(1.f), - m_soft_kSSHR_CL(0.5f), - m_soft_kSR_SPLT_CL(0.5f), - m_soft_kSK_SPLT_CL(0.5f), - m_soft_kSS_SPLT_CL(0.5f) + m_contactProcessingThreshold(1e10f) { } diff --git a/source/gameengine/VideoTexture/CMakeLists.txt b/source/gameengine/VideoTexture/CMakeLists.txt index 201714be74a..c412363dc3b 100644 --- a/source/gameengine/VideoTexture/CMakeLists.txt +++ b/source/gameengine/VideoTexture/CMakeLists.txt @@ -91,8 +91,8 @@ set(SRC if(WITH_CODEC_FFMPEG) list(APPEND INC_SYS - ${FFMPEG_INC} - ${PTHREADS_INC} + ${FFMPEG_INCLUDE_DIRS} + ${PTHREADS_INCLUDE_DIRS} ) add_definitions(-DWITH_FFMPEG) add_definitions(-D__STDC_CONSTANT_MACROS) |