Commit Graph

2435 Commits

Author SHA1 Message Date
Mitchell Stokes
52d2bae2bf Fix for [#32129] "2D filter texture width off by one?" reported by Alex Fraser (z0r).
The GetWidth() and GetHeight() functions of the canvas' display area seem to give values that are both off by one for what OpenGL wants. Adding 1 to both values seems to fix the problem.
2012-07-18 05:51:44 +00:00
Campbell Barton
32cf7fcdb1 code cleanup: spelling 2012-07-16 23:23:33 +00:00
Mitchell Stokes
4f6cc9a9aa BGE: The Action Actuator now returns correct values to work with the Actuator Sensor. 2012-07-16 03:43:57 +00:00
Mitchell Stokes
ac8c56c6fc BGE: Better fix for the textures not working with custom shaders regression. Now custom shaders work, and textures aren't uploaded twice for GLSL materials (my earlier fix had some bad logic). 2012-07-14 04:43:32 +00:00
Mitchell Stokes
831ae18622 Scaling non-power-of-two (NPOT) textures to powers of two is really time consuming and not necessary on graphics cards that can support NPOT textures. So, if the graphics card has NPOT texture support, don't bother scaling. If this patch causes issues, it can always be reverted and applied to Swiss instead. 2012-07-10 19:23:57 +00:00
Mitchell Stokes
1f9adff26f Fix for a crash caused by ReplaceMesh changing an objects physics shape. CcdShapeConstructionInfo::UpdateMesh() would change the CcdShapeConstructionInfo's m_meshObject, but didn't change m_meshShapeMap, which means the CcdShapeConstructionInfo object's destructor would not find it's m_meshObject in the m_meshShapeMap. This leaves some nasty dangling pointers laying around which caused issues if the scene was re-run, or the scene was changed to one that also had the mesh.
Note: This fix could cause other issues with shared physics meshes. In general, we may want to re-evaluate how we handle updating potentially shared physics meshes.
2012-07-10 02:05:06 +00:00
Mitchell Stokes
a40c367a35 BGE: Fixing up the error message received when trying to add an object from an active layer. 2012-07-09 18:55:50 +00:00
Mitchell Stokes
9d73cbf2c4 As a response to issue [#28483] "Enable/Disable Rigid Body actuator do nothing" reported by Jean-Francois Gallant (pyroevil), I'm adding preliminary support to enable and disable rigid body physics on dynamic objects. This is can be done via the Edit Object Actuator or through KX_GameObject.enableRigidBody() and KX_GameObject.disableRigidBody(). Thanks to Sergej Reich for his help with the patch. 2012-07-09 04:57:21 +00:00
Mitchell Stokes
4ff0efd5a2 Fixing a memory leak when using Bullet's btGImpactMeshShape for triangle meshes (e.g., rigid bodies). The physic controller's free was only handling the case where regular triangle meshes were used. 2012-07-08 23:15:26 +00:00
Mitchell Stokes
9af3e3bb9b Fixing a memory leak introduced by the Character Physics type patch: a new btGhostPairCallback was being created, but never freed. 2012-07-08 20:05:40 +00:00
Mitchell Stokes
8ce864784c Fix for [#31701] "radar causes collision" reported by Markus Rietz (afeature).
The problem was that the physics shapes for the near and radar sensor were getting turned into characters because CcdConstructionInfo::m_bCharacter was defaulting to true. Now it defaults to false and is explicitly set to true for only Character physics types.
2012-07-08 05:00:16 +00:00
Campbell Barton
3a0593cc3d code cleanup: dont use function calls like dot_v3v3, pow and sqrt within macros which results in calling the function multiple times needlessly.
also added some comments.
2012-07-06 22:48:28 +00:00
Mitchell Stokes
b41561a406 Fix for [#31978] "Horizon colour drawn on two edges of screen when a 2D filter is active" reported by Alex Fraser.
The glViewport used for 2D Filters wasn't quite matching the 3d view. It seems the height and width were both off by one. There may be a deeper bug with the canvas rectangle having slightly wrong dimensions, but this at least fixes the 2D Filters.
2012-07-05 21:03:29 +00:00
Mitchell Stokes
9f7db7f3ea Fix for [#31122] "Properties cant have Spaces in names when using interval as a evaluation. Or else it'll fail to activate actuator." reported by Auuman Anubis.
I cleaned up the INTERVAL check to do a much cleaner (and saner) range check that doesn't get messed up by spaces.
2012-07-05 20:34:42 +00:00
Campbell Barton
21bf13989f code cleanup: remove Python.h include from blenkernel. 2012-07-04 20:13:39 +00:00
Bastien Montagne
558721ab59 More spell checking. 2012-07-04 15:04:38 +00:00
Bastien Montagne
468ef74ed7 More spell and typo fixes (mostly visualise->visualize, grey->gray, normalise->normalize). 2012-07-03 19:09:07 +00:00
Campbell Barton
1597ad9377 style cleanup 2012-07-01 09:54:44 +00:00
Campbell Barton
8b865c01cd style cleanup: comments 2012-06-30 22:49:33 +00:00
Mitchell Stokes
436f02ab9c Finally committing support for compressed textures on the GPU (DDS+DXT). This patch started out as a patch by me, then cleaned up by Kupoman during his work on Cucumber.
One important thing to keep in mind when using this feature is that you'll need to flip your textures vertically (both the GIMP and Photoshop DDS tools I've seen have support for this on export). This is a quirk in using a texture format originally made for DirectX/DirectDraw, and flipping the compressed data is a real headache. Another quick fix for this issue is to change the Y value for the Size in the Mapping panel in the Texture properties to -1 (default is 1).
2012-06-30 04:34:34 +00:00
Campbell Barton
aeee798143 code cleanup: bge builds with clang without warnings / errors. 2012-06-29 09:16:59 +00:00
Mitchell Stokes
a9a92ae323 Fix for [#23375] "texture2D in custom 2D filters can get texture outside of game, resulting in ugliness" reported by Jacob F.
The 2D Filter system now only copies the game viewport instead of the whole window. This prevents 2D Filters from grabbing data outside of the game viewport. The textures for 2D filters are now also not forced to be powers of two (if NPOT textures are supported), which can save a little bit of VRAM.
2012-06-28 09:37:30 +00:00
Mitchell Stokes
ecc15e53bd Removing channel manipulation from the Action Actuator Python API since this has been broken since the animation changes from Pepper. BL_ArmatureObject.channels should be used instead. For more information see bug #28843 for more info:
http://projects.blender.org/tracker/index.php?func=detail&aid=28843&group_id=9&atid=306
2012-06-28 06:22:47 +00:00
Dalai Felinto
7016538974 bge.logic.keyboard.getClipboard() and .setClipboard methods
the idea of using methods instead of attributes is to avoid users abusing of the system calls.

Thanks Campbell Barton for reviewing and small corrections
2012-06-27 21:57:33 +00:00
Campbell Barton
9beef7442c style cleanup: also some spelling correction. 2012-06-27 05:59:41 +00:00
Campbell Barton
3c8a4c458b more guardedalloc use in C++, also make compositorMutex a static var, was allocated and never freed. 2012-06-25 10:35:24 +00:00
Campbell Barton
cc0784c1b9 optionally use guarded alloc for tiles compositor, also replace allocation functions with a macro. 2012-06-25 09:14:37 +00:00
Mitchell Stokes
79fb3311a3 Fix for [#29412] "Priority 0 cause problems with pulse mode" reported by Guillaume Côté.
Right now this is being fixed by not allowing the exact same action (action, start/end frames, speed, etc) to be played if it's already playing. Hopefully this will not cause more issues than it solves.
2012-06-23 03:39:03 +00:00
Mitchell Stokes
d8e2c475a0 Fix for [#31396] "bge.logic.LibLoad fails to import text blocks" reported by Leonard Ritter.
Blender's import function check's the Text datablocks in main for additional modules for importing. However, libloaded scenes were 1) not loading Text datablocks and 2) not letting bpy know about them. Text datablocks are now loaded if a Scene is loaded and bpy can now looking through extra Mains to find additional modules.
2012-06-21 05:41:06 +00:00
Campbell Barton
a744fed46c style cleanup 2012-06-20 16:43:48 +00:00
Sergey Sharybin
0d64e050ea Reduce amount of deprecated symbols used from FFmpeg
This switches some areas of Blender which are related on FFmpeg stuff
from deprecated symbols to currently supported one.

Pretty straightforward changes based on documentation of FFmpeg's
API which symbols should be now used.

This should make Blender compatible with recent FFmpeg 0.11.

Should be no functional changes.
2012-06-18 10:29:11 +00:00
Campbell Barton
f5f25b81e8 style cleanup:
also fix for building ghost test and fix double free in one of the tests
2012-06-17 09:58:26 +00:00
Mitchell Stokes
245c94a75e Fix for [#31848] "BGE: Commit r47628 breaks custom GLSL material shaders" reported by Alex Fraser.
Custom shaders is a case where the BGE can be using GLSL materials and still need to upload textures without bf_gpu. I tweaked some logic to handle this special case and added more comments.
2012-06-17 07:59:22 +00:00
Campbell Barton
b5b8306685 code cleanup: includes, also correct some py example typos 2012-06-16 20:20:07 +00:00
Sergey Sharybin
a164b7ed25 Comment numberoffilters in constructor too.
Otherwise it'll for sure give compilation error.
2012-06-14 11:26:46 +00:00
Campbell Barton
a57c8a37a1 comment unused vars 2012-06-14 11:05:15 +00:00
Mitchell Stokes
c07c572373 Fix for [#31813] "bge.types.KX_RadarSensor incorrect attributes" reported by Monster.
KX_RadarSensor.angle was returning the angle that was used to construct Bullet's physics shape, which is calculated from the logic brick gui. KX_RadarSensor.angle now recalculates the original value from the gui. However, m_coneradius isn't actually used by KX_RadarSensor that I can see, so it might be better to just assign the original angle to m_coneradius instead of the calculated value. I've also made KX_RadarSensor.angle read-only, since setting m_coneradius does not appear to have any affect, which means writing to KX_RadarSensor.angle never worked properly.
2012-06-14 08:01:20 +00:00
Mitchell Stokes
298feff390 Committing patch [#31704] "Patch to fix keyboard sensor from blocking quit game key binding" by Jay Parker. This patch fixes [#31671] "Keyboard Sensor blocks Quit Game Key Binding" 2012-06-10 19:32:57 +00:00
Campbell Barton
5534701e5d style cleanup: use capital camel case names for typedef's 2012-06-10 15:20:10 +00:00
Mitchell Stokes
8a4f16739a Fixing a BGE bug where textures could get loaded into VRAM twice. 2012-06-08 19:57:28 +00:00
Mitchell Stokes
ebb2dc84fc Some slight refactoring of the BGE's LibLoad code to make things a bit cleaner (no functional changes). 2012-06-07 01:46:28 +00:00
Campbell Barton
d5032657ed style cleanup 2012-06-06 22:38:39 +00:00
Campbell Barton
cb0b3558af style cleanup 2012-06-05 22:12:17 +00:00
Campbell Barton
5189356d58 style cleanup 2012-06-04 20:11:09 +00:00
Campbell Barton
1aa27e240c code cleanup: replace some non utf8 chars 2012-06-03 11:16:13 +00:00
Mitchell Stokes
0e73b64d62 Fix for [#27472] "preserve volume for armature modifier does not work" based on code provided by Sergey Kurdakov. Now more deformation flags are being passed to armature_deform_verts(). Note: this fix is only for the Blender vertex deformer, not the BGE deformer. 2012-06-01 02:17:35 +00:00
Benoit Bolsee
58bc424b3c BGE #30734: add support for physics linear and angular thresholds and deactivation time from python and GUI.
========================
The linear and angular thresholds set the speed limit (in m/s) and rotation limit (in rad/s)
under which a rigid body will go to sleep (stop moving) if it stays below the limits for a 
time equal or longer than the deactivation time (sleeping is disabled is deactivation time is 
set to 0).
These settings help reducing the processing spent on Physics during the game.

Previously they were only accessible from python but not working because of a bug. 
Now the python functions are working and the settings are available in the Physics panel
of the World settings when using the Blender Game render engine.

Python API:
  import PhysicsConstraints
  PhysicsConstraints.setDeactivationLinearTreshold(float)
  PhysicsConstraints.setDeactivationAngularTreshold(float)
2012-05-29 20:30:33 +00:00
Benoit Bolsee
dfc19a1ff7 BGE patch #28476: Character object physics type
===============================================
This patch adds a new "Character" BGE physics type which uses Bullet's btKinematicCharacter for simulation instead of full-blown dynamics. It is appropiate for (player-controlled) characters, for which the other physics types often result unexpected results (bouncing off walls, sliding etc.) and for which simple kinematics offers much more precision.

"Character" can be chosen like any other physics type in the "Physics" section of the properties window. Current settings for tweaking are "Step Height" (to make the object automatically climb small steps if it collides with them), "Fall Speed" (the maximum speed that the object can have when falling) and "Jump Speed", which is currently not used.

See http://projects.blender.org/tracker/?func=detail&atid=127&aid=28476&group_id=9
for sample blends and a discussion on the patch: how to use it and what influences the behavior of the character object.

Known problem: there is a crash if the "compound" option is set in the physics panel of the Character object.
2012-05-28 21:36:29 +00:00
Campbell Barton
1e45042396 code cleanup: remove mode comments, these were applied very un-evenly across a few files. 2012-05-27 13:22:43 +00:00
Campbell Barton
ba5e13912d fix for own error in applying patch 2012-05-26 13:08:42 +00:00