Commit Graph

2638 Commits

Author SHA1 Message Date
Mitchell Stokes
d05cb9bca5 BGE: (partial?) fix for #34330 "Action Actuator "caching" the previous ran actions" reported by Dalai. The test file now works if all of the actions are using the same layer, but multiple layers can still cause problems. However, I am unsure as to what the "correct" behavior should be with multiple layers. They should probably blend somehow... 2013-02-22 23:55:06 +00:00
Mitchell Stokes
b3c0896967 BGE: Fix for bug #34219 "Webcam support under Linux in Standalone broken" reported by Thomas Achtner (offtools).
No one bothered to update the player for ffmpeg changes made in August 2012. This meant the player was no longer calling avdevice_register_all(), and  ffmpeg would fail to open web cam streams.
2013-02-22 20:37:14 +00:00
Dalai Felinto
0945c3b43b fixing typo in include (report and patch by Jochen Schmitt) 2013-02-22 17:45:04 +00:00
Alexander Kuznetsov
2c2a42a4e8 Fix for building without python. 2013-02-22 15:54:10 +00:00
Sergej Reich
c586159438 game engine: Revert to using regular gimpact for mesh shapes
This reverts part of r53019.
While the compound shape trick works well in some cases, overall it's
much slower and even causes crashes under certain conditions.

We could make this and option and fix the crashes, but it's better to
implement convex decomposition anyway so just reverting for now.

Fixes [#34353] Ray cast on Triangle mesh bounded Rigid Body Object causes blender crash to desktop without error.
2013-02-22 14:47:11 +00:00
Mitchell Stokes
6bac47f854 BGE: Fix for bug #34349 "Character walkDirection ADD mode -#INF error" reported by Angus Hollands (agoose77). If the walk directions canceled each other out, the actuator would try to normalize a zero vector, which caused the error. 2013-02-22 02:31:46 +00:00
Dalai Felinto
2ecf27f56f BGE projection code fix: old patch #28893 (to fix #28753) committed in rev.41131 changed the clipping for ortho camera from -far +far to +near +far. But also introduced this -far +far when using 3dviewport camera (which shouldn't). 2013-02-22 01:48:53 +00:00
Jens Verwiebe
074565330d Fix scons compile 2013-02-21 19:23:41 +00:00
Mitchell Stokes
815e00917d BGE cleanup: Removing the PHY__Vector classes and replacing them with MT_Vectors. The PHY__Vectors didn't offer anything (not even any real abstraction) and they required annoying MT_Vector <-> PHY_Vector conversions all over the place. No functional changes. 2013-02-21 18:30:11 +00:00
Mitchell Stokes
8c9906eb91 BGE: Fix for issue #34242 "It does not render in "P" mode for Game engine if you UV mapa a face of a cube" reported by joaclint.
Material caching can now be disabled for Multitexture and GLSL Materials.
2013-02-16 04:38:53 +00:00
Mitchell Stokes
8997e5ae06 BGE: Fix for issue #32606 "Raycasts are locked to the scene of calling object" reported by Josiah Lane (solarlune). The raycasting functions were using the active scene instead of the object's scene. 2013-02-11 18:29:19 +00:00
Campbell Barton
2005f7c6c0 style cleanup: also some typos 2013-02-11 00:49:00 +00:00
Mitchell Stokes
f75ca60a1c BGE: Make sure we are writting to the depth buffer when rendering alpha polygons for shadows. Otherwise alpha shadows won't work\! 2013-02-10 08:28:47 +00:00
Ton Roosendaal
00212f2b1f Bug fix #34157
Tss tss! :)
This bug (since Jan 26) made Material options get cleared on using GE once.
2013-02-09 12:30:42 +00:00
Mitchell Stokes
8eabdad3aa BGE: Fix to make KX_CharacterWrapper.jumpCount work a bit smoother. Previously jumpCount was only getting reset to 0 if the character was on the ground while jump() was being called. This works alright internally for double jumping, but it made things awkward if a user wanted to check jumpCount before calling jump() (i.e., before jumpCount was updated). 2013-02-09 06:32:17 +00:00
Brecht Van Lommel
faaee15407 Fix part of #34083: crash trying to play surround .wav file in the game engine
on Windows, it still doesn't play but it doesn't crash at least.
2013-02-07 21:29:31 +00:00
Bastien Montagne
dd83387e0b And one more "G.main" compile fix, this time for BGE ;) 2013-02-05 13:31:59 +00:00
Campbell Barton
69993c5d40 style cleanup: spaces -> tabs 2013-02-04 00:18:09 +00:00
Campbell Barton
9d4be17de4 style cleanup 2013-02-04 00:05:15 +00:00
Campbell Barton
9da4cab9fd style cleanup: comment format 2013-02-02 04:48:21 +00:00
Mitchell Stokes
9191b783bb BGE: Some various changes to make moving the character physics type easier:
* Undoing the previous applyMovement() changes for characters. This was causing bugs for the Motion Actuator.
  * Creating a Character Motion type for the Motion Actuator with specific controls for characters. This includes moving, rotating and jumping.
  * Adding a KX_CharacterWrapper.walkDirection to set the character's direction and speed.

Note, this also resolves the following bugs:
[#33585] "Setting dLoc of motion actuator [0,0,0] via python won't stop object" reported by Manuel Bellersen (urfoex)
[#33503] "Character physics type won´t accept more than one motion anymore" reported by Mr Larodos
2013-01-30 05:55:17 +00:00
Dalai Felinto
3a1ee13278 BGE Profile : visual feedback bars and improvements
You can see a screenshot of the funcionality here:
http://wiki.blender.org/index.php/Doc:2.6/manual/Game_Engine/Performance/Display/Framerate_and_Profile

This patch creates a bar-like graph to quickly allow the game dev to see the performance changes.
Also it changes the font to monospace (too allow ' ' padding) and reduced shadow border to
match the blenderplayer one.

Patch finalized and commited at Global Game Jam Vancouver (last one, time to sleep forever now)
2013-01-28 01:26:36 +00:00
Dalai Felinto
4d8104917d BGE bugfix: Material initial object color working in the game
The object color option in the materials always worked, however the initial color of the object
was never passed to the game.

We are now passing it only, only when the object's mesh has a material that has ((shade_flags & OB_COLOR)).
There reason to not always set the object color is probably due to performance (the m_bUseObjectColor
flag in KX_GameObject). This patch still respect that.

Bug report from Mike Pan, as part of our book nitty-gritties review work.
Bugfix during Vancouver Global Game Jam :)
2013-01-26 23:52:55 +00:00
Campbell Barton
69ddc5eb99 make bullet optional again 2013-01-23 07:26:39 +00:00
Campbell Barton
761ac89877 style cleanup 2013-01-15 23:45:41 +00:00
Campbell Barton
06dd4fa40c bge track-to actuator: reverse the order of the cross product rather then negating. 2013-01-13 03:48:48 +00:00
Mitchell Stokes
1e5ea3e5c4 BGE: Fix from HG1 for bug [#32831] "TrackTo aktuator +X direction not working correct" reported by HG1.
Looks like a vector needed to be inverted for the +X calculation.
2013-01-12 23:48:40 +00:00
Mitchell Stokes
4bd3477e29 BGE: Adding preliminary alpha shadow support for Simple shadow maps. They do not work in the viewport nor do they work for Variance shadow maps. 2013-01-12 20:01:58 +00:00
Campbell Barton
9c003a36d6 patch from Harley Acheson to remove multiple inline defines. 2013-01-12 17:12:48 +00:00
Campbell Barton
47ee5f56b6 minor cleanup to debug drawing code in the BGE, dont convert strings to STR_String, only to get them back as regular strings. 2013-01-12 16:49:37 +00:00
Campbell Barton
68d83f4140 quiet compiler warning with string formatting in CParser::Term 2013-01-12 15:32:05 +00:00
Sergey Sharybin
aab01c86cf Patch #33837: ffmpeg1.1 and libav9.1 compatibility update
Patch makes it possible to compile blender with recent ffmpeg
and libav libraries, mainly by getting rid of deprecated API.

Original patch by Campbell Barton with own modifications to
support compilation with older ffmpeg versions.

This patch could break compatibility of FFV1 videos playing
back in older players, mainly because of alpha support changes.
Preserving compatibility with such players became a headache
and think it's high time to get rid of workarounds here.
2013-01-12 12:51:10 +00:00
Mitchell Stokes
03df7e9a56 BGE: Fix for [#33839] "a logic.joysticks Crashes BGE" reported by Josiah Lane (solarlune).
On a scene change the SCA_JoystickManager gets destroyed which in turn means all of it's joystick instances are released. Since SCA_PythonJoystick was just using a borrowed reference, this allowed the joystick to be freed. Now the joystick's refcount is incremented so that the SCA_PythonJoystick's joystick reference will survive across scene changes.
2013-01-12 05:44:08 +00:00
Campbell Barton
4d7583b66f code cleanup: warnings, also add check in crash handler that a wmWindowManager is present. 2013-01-11 03:21:24 +00:00
Mitchell Stokes
6a7a144f50 BGE: Fix for [#33053] "2.6x Joystick Sensor Event: Axis fails to fire at full tilt" reported by Auuman Anubis (auuman_anubis).
The problem was that SCA_Joystick::pAxisTest() was using shorts, and tried to store abs(MIN_SHRT) in a short. However, on most systems MIN_SHRT == -32768 and MAX_SHRT == 32767. This means that abs(MIN_SHRT) > MAX_SHRT, and thus the short would overflow.
2013-01-06 23:11:12 +00:00
Sergey Sharybin
cf0e646432 Remove usage of deprecated TEX_USEALPHA from GE code 2013-01-05 13:51:07 +00:00
Mitchell Stokes
9106b3b107 BGE: Fix for [#33769] "Material friction settings are ignored" reported by Alex Fraser (z0r).
As of r53332, give_current_material() won't accept a 0 index and return NULL. CreateMaterialFromBlenderObject() was using index 0 to just grab the first material. Since this now returned NULL, it would use default settings. We'll just ask for index 1 now instead.
2013-01-05 08:53:39 +00:00
Mitchell Stokes
d9001335ff BGE: The Blenderplayer wasn't calling PyEval_InitThreads, which caused async lib loading to crash. 2013-01-05 03:30:56 +00:00
Campbell Barton
c7b7cba238 code cleanup: warnings 2013-01-04 02:13:29 +00:00
Campbell Barton
c2839bfe76 add option WITH_SYSTEM_BULLET to link against the bullet installation found on the system.
Note: this doesn't work yet for everything with latest stable bullet (2.81), need to look into why and likely apply some patches upstream.
However I managed to link blender by disabling some features, likely it can be made to work without too much trouble.
2013-01-03 00:23:52 +00:00
Mitchell Stokes
d0981c279b BGE: Fixing a crash that occurred when LibLoading a scene with a 2D Filter Actuator. The actuator was still referencing the old scene. 2012-12-31 21:32:46 +00:00
Mitchell Stokes
18f134304c BGE: Adding a jumpCount to KX_CharacterWrapper. This can be used to have different logic for a single jump versus a double jump. For example, a different animation for the second jump. 2012-12-29 10:22:19 +00:00
Mitchell Stokes
0cb07bcabc BGE: An off-by-one error when setting up the viewport for 2D filters caused a blurring effect when using 2D filters. This is now fixed. 2012-12-29 08:36:41 +00:00
Mitchell Stokes
7d68b37032 BGE: Fix for [#33685] "2D Filters Partially Offset" reported by Josiah Lane (solarlune). This bug was caused by me in a recent change to clean up the 2D filters a bit. I forgot that canvas->SetViewPort already handles some viewport calculations, and thus I ended up doubling up on calculations, which caused the offset. 2012-12-29 04:03:25 +00:00
Campbell Barton
4a427d8e0d style cleanup 2012-12-29 01:54:58 +00:00
Mitchell Stokes
4e604642de BGE: Don't set the character controller's gravity when creating the controller. The default from Bullet works much better than what we were using. 2012-12-26 01:50:01 +00:00
Mitchell Stokes
13f49f3101 BGE: Adding a maxJumps to the character controller to adjust how many jumps a character can perform before having to touch the ground. By default this is set to 1, which means a character can only jump once before having to touch the ground again. Setting this to 2 allows for double jumping. 2012-12-26 01:25:53 +00:00
Mitchell Stokes
f1270153e1 BGE: Some various tweaks to try and get async lib loading to be a bit more stable on more complex scenes. 2012-12-25 08:11:21 +00:00
Mitchell Stokes
62b6303735 BGE: Fixing an assert with the canvas' GetViewPort(). bf_gpu was changing the viewport when handling shadow buffers. KX_LightObject::BindShadowBuffer() now updates the canvas with the new viewport information from bf_gpu. 2012-12-25 06:20:50 +00:00
Mitchell Stokes
a1c9241797 BGE: "Fix" for issue [#33663] "Objects Share Materials / Textures When Grouped In SingleTexture / MultiTexture Mode" reported by Josiah Lane (solarlune).
This commit adds a UI option in the Render properties to enable the new material caching in the converter. This caching can cause problems with Singletexture and Multitexture materials when texface is being used to handle materials. By default this option is enabled and users with broken games have two options:

  1) Fix up their materials so they are properly using textures
  2) Disable the material caching and take a speed hit during conversion time

Regardless of the setting, caching is always enabled for GLSL materials.
2012-12-24 03:13:53 +00:00