Commit Graph

2580 Commits

Author SHA1 Message Date
Campbell Barton
2349370a51 fix for typo in r53145 2012-12-19 01:42:28 +00:00
Mitchell Stokes
ef0473994b BGE: Some as of yet unmerged work I did in the Swiss branch. These changes include:
* Cleaning up the conversion code to avoid a per-face material conversion. Materials are now stored in buckets and only converted if a new material is found. This replaces some of Campbell's earlier work on the subject. His work wasn't as thorough, but it was much safer for a release.
  * Shaders are only compiled for LibLoaded materials once. Before they could be compiled twice, which could really slow things down.
  * Refactoring the rasterizer code to use a strategy design pattern to handle different geometry rendering methods such as immediate mode, vertex arrays and vertex buffer objects. VBOs are added, but they will be disabled in a following commit since they are still slower than vertex arrays with display lists. However, VBOs are still useful for mobile, so it's good to keep them around.
  * Better multi-uv support. The BGE should now be able to handle more than two UV layers, which should help it better match the viewport.
2012-12-18 20:56:25 +00:00
Brecht Van Lommel
779375251c Fix #33487: game engine did not convert objects with rotation modes other than
Euler XYZ correctly, was never implemented;
2012-12-17 21:40:28 +00:00
Bastien Montagne
ab2c273b12 Added GPL header to sconscripts!
Also changed shebang to '#!/usr/bin/env python', this is more portable across unixes...
2012-12-17 08:01:43 +00:00
Erwin Coumans
1b37f8dca8 Hi there, it has been a while, just curious if my SVN account still works :)
This commit is an attempt to improve collisions between moving Bullet rigid bodies using (concave) triangle mesh bounds.
Instead of using Gimpact, this we create a btCompoundShape with child shape tetrahedra derived from the surface triangles.
For each triangle, we add a fourth vertex using the centroid, shifting inwards using the triangle normal.
If the centroid hits an internal triangle, we stop. The default depth could be exposed as 'advanced' setting in the user interface.
This solution will be a slower than the original/gimpact solution, but a bit more reliable. 
In the future, it is better to add HACD, convex decomposition to Blender, for moving concave meshes.
See http://kmamou.blogspot.com and the Bullet SDK's Demos/ConvexDecompositionDemo.
2012-12-15 01:01:35 +00:00
Campbell Barton
7c699a217a define the size of matrix args for both rows/cols. 2012-12-11 14:29:01 +00:00
Brecht Van Lommel
c6961305df Fix game player still not using fast GPU mipmap generation, user preferencs
are not actually used here.
2012-12-11 08:01:16 +00:00
Brecht Van Lommel
5bb576e8e4 Fix #33417: add back GPU Mipmap Generation option, apparently with this disabled
it takes up less memory on some cards, still unclear why.
2012-12-05 11:46:13 +00:00
Campbell Barton
2f97f929a5 fix for bug in console indent, was not copying the null terminator.
also add assert to catch this case more quickly.
2012-12-01 06:29:04 +00:00
Mitchell Stokes
5ce13d0c6c BGE: Fixing the double-click issue for mouse events too. The previous fix only fixed double-click keyboard events. 2012-11-29 05:21:24 +00:00
Brecht Van Lommel
134bbf3791 GPU: remove GPU Mipmap Generation option and just always enable it, it's an old
OpenGL 1.4 feature that is stable, there's no reason not to use it. Also fixed
GPU mipmap generation not working in the game player.
2012-11-27 22:51:28 +00:00
Mitchell Stokes
936fca57c3 BGE: Fix for [#33027] "logic.keyboard polling rate extremely low" reported by Josiah Lane (solarlune). The embedded player now treats KM_DBL_CLICK the same as KM_PRESS. 2012-11-27 17:41:39 +00:00
Campbell Barton
e3d3ffe746 fix [#33303] face selection masking for painting does not work with mesh with n-gon
caused by own change to how origindex is used, now if mpoly's CD_ORIGINDEX array is missing its assumes that its the original mpoly array.
2012-11-26 10:15:32 +00:00
Mitchell Stokes
5af5f2f21c BGE: The blenderplayer usage docs mentioned "enable all frames" was "fixedtime," but the player was actually looking for "fixed_framerate." Since fixedtime doesn't have a fixed framerate, but a fixed time step, I change the player to look for the documented flag, "fixedtime," which makes more sense. 2012-11-25 07:42:41 +00:00
Mitchell Stokes
993d5e58bd BGE: Implementing a fix for the "Problem With Clock" issues reported in #32708 and #33088. At the moment this feels like a bit of a stop gap, but it does solve the stuttering issue that #33088 mentioned. 2012-11-24 08:10:56 +00:00
Mitchell Stokes
9968778373 BGE: KX_ACT_ARMATURE_SETINFLUENCE constant for BL_ArmatureActuator.type was documented but not actually added to bge.logic. 2012-11-22 11:03:17 +00:00
Mitchell Stokes
30a292b61f BGE: KX_PhysicsObjectWrapper was not being used anywhere in the code base, but it was being maintained (style, docs, name changes, etc), so I'm removing it. 2012-11-22 07:08:02 +00:00
Mitchell Stokes
6577117c4e BGE: Removing some glIsEnabled() calls from DisableForText() in KX_BlenderGL.cpp. Use of glIsEnabled() is discouraged since it causes a potential sync with the graphics card. Also, it's faster to just always use glDisable() (even if that feature is already disabled) then to check if it's enabled first. 2012-11-22 06:11:05 +00:00
Campbell Barton
89b0b0516e bge camera axix actuator was undocumented and python had incorrect limits on this attribute. 2012-11-22 05:33:05 +00:00
Campbell Barton
796988adc9 modify the python stub to include __file__ and __name__, also correct odd indent in KX_KetsjiEngine.cpp 2012-11-22 05:20:51 +00:00
Campbell Barton
3370e3ca43 doc corrections and add bge.types.KX_ArmatureSensor 2012-11-21 08:53:04 +00:00
Campbell Barton
3fd388fb06 py api cleanup, replace use...
- PyLong_FromSsize_t --> PyLong_FromLong
- PyLong_AsSsize_t --> PyLong_AsLong

In all places except for those where python api expects PySsize_t (index lookups mainly).

- use PyBool_FromLong in a few areas of the BGE.
- fix incorrect assumption in the BGE that PySequence_Check() means PySequence_Fast_ functions can be used.
2012-11-21 02:28:36 +00:00
Mitchell Stokes
2bed09e7a6 BGE: Changing "transform_uv" -> "transformUV" in some error messages. 2012-11-18 20:38:27 +00:00
Campbell Barton
b867f9f17e style cleanup: comments & spelling 2012-11-18 01:22:31 +00:00
Campbell Barton
8b57f7502b code cleanup: gpl header update (formatting) 2012-11-18 00:30:06 +00:00
Sergey Sharybin
5c6f6301b0 Image thread safe improvements
This commit makes BKE_image_acquire_ibuf referencing result, which means once
some area requested for image buffer, it'll be guaranteed this buffer wouldn't
be freed by image signal.

To de-reference buffer BKE_image_release_ibuf should now always be used.

To make referencing working correct we can not rely on result of
image_get_ibuf_threadsafe called outside from thread lock. This is so because
we need to guarantee getting image buffer from list of loaded buffers and it's
referencing happens atomic. Without lock here it is possible that between call
of image_get_ibuf_threadsafe and referencing the buffer IMA_SIGNAL_FREE would
be called. Image signal handling too is blocking now to prevent such a
situation.

Threads are locking by spinlock, which are faster than mutexes. There were some
slowdown reports in the past about render slowdown when using OSX on Xeon CPU.
It shouldn't happen with spin locks, but more tests on different hardware would
be really welcome. So far can not see speed regressions on own computers.

This commit also removes BKE_image_get_ibuf, because it was not so intuitive
when get_ibuf and acquire_ibuf should be used.

Thanks to Ton and Brecht for discussion/review :)
2012-11-15 15:59:58 +00:00
Campbell Barton
050f09aa6c buildsystem cleanup: remove duplicate source & includes for scons,
add a check for duplicates in BlenderLib()m, if 0'd now.
2012-11-14 01:41:24 +00:00
Mitchell Stokes
590dbb87e7 BGE: Renaming KX_GameObject.group_parent and group_children to groupObject and groupMembers to be a bit more descriptive and match the rest of the BGE Py API. KX_MeshProxy.transform_uv has also been renamed to transformUV. It would be nice to switch to PEP8 names for the BGE Python API, but for now, consistency is better. 2012-11-13 04:38:34 +00:00
Bastien Montagne
5ff3017900 Replacing gettext i18n backend by boost::locale one.
This commit adds a small and simplistic C wrapper around boost's locale library as intern/locale, and heavily simplifies/reduces Blender's own i18n code (under blenfont/ dir). And it adds back UI translation on windows' official builds (with msvc)!

Note to platform maintainers: iconv and gettext (libintl) can now be removed from precompiled libs (not gettext binaries, under windows, of course ;) ).

Note to MinGW32/64 users: boost_locale lib has not yet been uploaded for those build env, please disable WITH_INTERNATIONAL for now (hopefully will be fixed very soon, have contacted psy-fy).
2012-11-11 16:54:26 +00:00
Campbell Barton
47068e88fb BGE: fix for 2 uses of uninitialized memory - property-sensor and object-color for materials. 2012-11-11 10:03:25 +00:00
Campbell Barton
83de5cb308 bge mesh conversion speedup, avoid calling ConvertMaterial() on every face.
now do per material bucket.
2012-11-11 01:54:30 +00:00
Campbell Barton
dfc55421df game engine material conversion: don't use the material to convert vertex colors, then extract back out (pre face). 2012-11-11 00:39:08 +00:00
Campbell Barton
f8af8100d2 code cleanup: bge - rename 'type' to 'use_mcol' in material conversion. 2012-11-10 23:57:13 +00:00
Campbell Barton
67b74f96da - property sensor was converting floating point values to text then back to float - for floating point properties.
- IntValue's GetNumber() was convert int -> float -> double.
- BL_Shader was using STR_String rather then char*, where most callers had a char*, use a char* to avoid STR_String conversion-and-alloc on shader access.
2012-11-10 22:32:15 +00:00
Campbell Barton
250109f5ac add argument so recent bge function mesh.transform_uv() so you can optionally transform between UV1 / UV2 2012-11-10 10:26:39 +00:00
Campbell Barton
fecc3b9d68 add 2 new utility functions to the BGE mesh py api.
mesh.transform(matid, matrix)
  mesh.transform_uv(matid, matrix, uv_index=-1))


much more efficient then looping over verts in python to transform them.
2012-11-10 09:45:43 +00:00
Campbell Barton
936f0388e8 code cleanup: some warnings and formatting for PyMethodDef's in the BGE. 2012-11-10 05:42:50 +00:00
Mitchell Stokes
f6a110d6ea BGE: Committing patch [#32697] "New BGE gravity API" by HG1.
This patch adds a gravity attribute to KX_Scene.
2012-11-10 03:11:18 +00:00
Campbell Barton
5a29885007 code cleanup: bge static functions & use C++ guarded alloc for the character class. 2012-11-09 23:47:06 +00:00
Campbell Barton
d25b13d13f code cleanup: double promotion warnings, also allow cmake to build SDL without audaspace. 2012-11-09 16:15:00 +00:00
Campbell Barton
617a73c573 code cleanup: unused defines & some formatting. 2012-11-08 06:46:10 +00:00
Antony Riakiotakis
8d0b2bc17f Compile fixes for recent boost changes 2012-11-05 15:23:09 +00:00
Mitchell Stokes
b2f837896d Fix for [#33090] "Segfault/Crash with Empty and Motion Actuator, Keyboard Sensor" reported by Martin Felke (scorpion81).
Apparently, not all objects have physics controllers, so now we do a NULL check in KX_ObjectActuator.
2012-11-05 15:13:54 +00:00
Joerg Mueller
5a8d5f77af Audaspace:
Replacing AUD_Reference with boost::shared_ptr.
2012-11-05 14:24:35 +00:00
Mitchell Stokes
f840bd4a9f BGE: This patch adds a character wrapper (similar to the already implemented vehicle wrapper) to control character physics options. Currently supported options are:
* jump() -- causes the character to jump
  * onGround -- specifies whether or not the character is on the ground
  * gravity -- controls the "gravity" that the character physics uses for the character

More options could be added (such as jump speed, step height, make fall speed, max slope, etc).
2012-11-04 20:56:02 +00:00
Campbell Barton
ff014a3077 code cleanup: cmake - add missing headers, remove directories from source listing.
also remove logImageLib.c - empty file.
2012-11-03 15:49:38 +00:00
Campbell Barton
25591e958d style cleanup: tabs & whitespace 2012-11-03 15:35:03 +00:00
Mitchell Stokes
b6596467d9 BGE: Fix for bug #33025 "Character physics object won't stop moving with simple motion actuator" reported by Jared Smith (jsmithketchup). Characters no longer use a simple translation change for ApplyMovement(), they instead delegate to the character controller's setWalkDirection(). The motion actuator now sets this to (0, 0, 0) on a negative pulse. 2012-11-01 03:11:39 +00:00
Mitchell Stokes
028d5a64fc BGE: Committing patch #32291 "Updated profiling layout for BGE" from Angus Hollands (agoose77). This patch adds a headers for the profiling information and for the debug properties so they are no longer jumbled together. It also modifies how debug properties are displayed; changes "swap" to "Frametime"; and changes the display from seconds to ms, which is much more useful.
In addition to this patch, I've also modified the precision of the numbers displayed in the profiling information to make things a little cleaner.
2012-10-30 22:45:08 +00:00
Campbell Barton
76ba8f017e code cleanup: remove unused transform snapping code (only use the BVH accelerated version now).
and quiet narrowing conversion warning between signed/unsigned int.
2012-10-30 19:27:15 +00:00