Commit Graph

334 Commits

Author SHA1 Message Date
Campbell Barton
69ddc5eb99 make bullet optional again 2013-01-23 07:26:39 +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
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
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
Mitchell Stokes
84966c3d0a BGE: Committing async LibLoad from Swiss. This does the lib loading in a separate thread to keep the BGE from freezing. Here is an example from the docs:
# Print a message when an async LibLoad is done
      import bge

      def finished_cb(status):
          print("Library (%s) loaded in %.2fms." % (status.libraryName, status.timeTaken))

      bge.logic.LibLoad('myblend.blend', 'Scene', async=True).onFinish = finished_cb

LibLoad() now returns a KX_LibLoadStatus object for information on the library loading. LibNew() and LibFree() are unaffected by this commit. In other words, the async option only works for LibLoad(). Furthermore it only works for Scenes, not Actions or Meshes.
2012-12-22 05:38:32 +00:00
Campbell Barton
0ddc77f913 code cleanup: warnings 2012-12-19 01:48:54 +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
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
Mitchell Stokes
3bf9bb3b13 BGE: Adding support for Bullet's collision masks. Each object now has a collision mask and a collision group. Object A and object B collide if object A's groups is in object B's mask and object B's group is in object A's mask. In other words, the group defines what the object is (collision wise) and the group defines what the object can collide with.
The majority of this patch was provided by Kupoman with some edits from me and heavy testing by z0r.
2012-10-30 15:44:16 +00:00
Campbell Barton
ddc2dbc2a4 style cleanup 2012-10-22 08:15:51 +00:00
Campbell Barton
d599b643b7 style cleanup: bge, switch statements mostly.
also left bmesh decimator on in previous commit.
2012-10-21 07:58:38 +00:00
Campbell Barton
4d4664d98f code cleanup: check for msvc directly when using warning pragma's. 2012-10-15 02:15:07 +00:00
Campbell Barton
690d5192f0 code cleanup: remove vertex/weight paint's VP_COLINDEX, this feature worked in the code but wasnt accessible from the UI this wasn't even accessible from the UI in 2.4x.
This would only paint onto faces from the active material. however we're better off using selection here IMHO (adding support for material selection in paint mask mode).

also quiet some warnings.
2012-09-18 04:55:52 +00:00
Campbell Barton
2fb8292005 style cleanup 2012-09-16 04:58:18 +00:00
Campbell Barton
beac985ab7 code cleanup: make local game engine functions static 2012-09-16 00:22:55 +00:00
Campbell Barton
d0e892a728 quiet double promotion warnings for the game engine. 2012-07-18 23:03:27 +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
Campbell Barton
d5032657ed style cleanup 2012-06-06 22:38:39 +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
305d341ec2 code cleanup: use vector math function minmax_v3v3_v3() and other minor vector function edits. 2012-05-13 11:05:52 +00:00
Campbell Barton
1dccd4c98a code cleanup: naming - pose/armature/image
also use ..._find_name(..., name) rather then ..._find_named(..., name) --- both were used.
2012-05-05 16:03:57 +00:00
Campbell Barton
299ff91ea1 code cleanup: BKE_scene api naming.
also stop numpy from being found in /usr/include with cmake.
2012-05-05 14:33:36 +00:00
Campbell Barton
e701f9b670 style cleanup: whitespace / commas 2012-04-29 15:47:02 +00:00
Campbell Barton
b9a2741f68 code cleanup: remove unused defines 2012-04-23 08:05:02 +00:00
Brecht Van Lommel
6b006059ec Fix #31016: rigid body joint constraint in game engine did not respect constraint
enable/disable option.
2012-04-19 15:14:28 +00:00
Campbell Barton
5061f2eb62 fix [#30839] Blender crashes while open/close a scene and deletes .blend-file 2012-04-10 13:10:44 +00:00
Jason Wilkins
dabcdc1532 Warning Fixes - const correctness in unicode encoding, unused variables in blenlib, and some type conversions
This is from a patch that is in the tracker, but it leaves out a fix of BLI_gzopen which needs more work.
2012-04-09 01:16:19 +00:00
Mitchell Stokes
f22f60e7c4 BGE: This fixes a problem where lamps in inactive layers were rendering shadows buffers that never got used, which was a huge performance sink. 2012-03-29 01:56:08 +00:00
Campbell Barton
07065b27b8 style cleanup 2012-03-28 05:03:24 +00:00
Campbell Barton
b8a71efeba style cleanup: follow style guide for/with/if spacing 2012-03-24 07:52:14 +00:00
Campbell Barton
4f19c1a995 spelling cleanup 2012-03-18 07:38:51 +00:00
Campbell Barton
89a963fb7f style cleanup: comment blocks 2012-03-09 18:28:30 +00:00
Campbell Barton
a2c182e923 style cleanup - use aligned * prefixed blocks for descriptive comments (was already used a lot and part of proposed style guide). 2012-03-03 16:31:46 +00:00
Campbell Barton
3fc2fbc333 style cleanup, use { on newline after function definition.
spelling 'impliment' -> 'implement'
2012-02-25 16:49:59 +00:00
Campbell Barton
6cfb67b549 fix for meshes not showing up in the game engine. 2012-02-23 14:24:45 +00:00
Campbell Barton
40c59b1a3d minor edits to have the game engine and player building. 2012-02-19 23:36:10 +00:00
Campbell Barton
705f23064e svn merge ^/trunk/blender -r43294:43338 2012-01-13 01:39:57 +00:00
Campbell Barton
a3d1e35d5e de-duplicate object conversion code in BGE 2012-01-12 09:02:29 +00:00
Campbell Barton
50ca81154e svn merge ^/trunk/blender -r42973:42991 2011-12-30 09:23:06 +00:00
Campbell Barton
6d965f4493 style edits for function declarations 2011-12-30 07:55:15 +00:00
Campbell Barton
4ced91da47 svn merge ^/trunk/blender -r42778:42839 2011-12-23 08:41:53 +00:00
Guillermo S. Romero
2f90cfd423 SVN maintenance. 2011-12-21 20:32:29 +00:00
Campbell Barton
84b58df85a svn merge ^/trunk/blender -r42742:42757 2011-12-20 08:09:46 +00:00
Dalai Felinto
32b23b9f74 Cucumber, first batch of merge - UI changes and custom exit key
---------------------------------------------------------------
This was a test drive to see how painful the merge will be.
Next batches are:
- use desktop option for fullscreen
- multisampling option
- bullet collision mask
- python
- storage (vbo, dl, ...)
- lighting

[lighting still needs review]
[python could use review, although it should be straightforward]
[storage should be tested more I think]


Merged /branches/soc-2011-cucumber:r
36991,37059,37157,37416,37497-37499,37501,37522,39036,40593

36991:
==UI==
* Made some options available in Blender Game that were only available in Blender Render (camera resolution, animation fps)
* Created a panel for the embedded player
* Renamed the FPS option for the standalone player to Refresh Rate
* Moved framing options to display
* Made a button to launch the blender player from within blender (only tested on windows for now)

37059:
==UI==
* Added the option to change the exit key for the BGE. The UI currently just sets a number, and this feature most likely does not work for blenderplayer yet. More work on this to come.
* Removed the physics settings from the scene panel for the BGE.
* Added an Add menu in the logic brick header.

37157:
Making the bake options available in Blender Game

37416:
Making the exit key UI element accept key presses instead of numbers. It still does not work for the Blenderplayer, and it does not limit the input to key presses (other events don't work for exiting)

37497:
Some more work on getting the exit key to work in the Blenderplayer.
Input is now restricted to keyboard events only for the exit key UI.
37498:
Some clean up from the last commit.
The exit key setting affects the Blenderplayer now.
37499:
Cleaning up some duplicate code. Now the reverseTranslateTable for converting blender key codes to ketsji key codes is only defined in BL_BlenderDataConverter.
37501:
Centralizing the exit key methods to the keyboard devices. This should make it easier to get exit key control to the python API.

[37517: committed previously]

37522:
Moved control of the exit key away from the keyboard devices, and moved it to ketsjiengine.
Added setExitKey and getExitKey to the python API

39036:
A couple of the doversions were in the wrong spot. This should fix some issues with the exit key not being set.
[not committed entirely, see below]]

40552: space_logic.py (* fixed an error in space_logic.py *)

40593:
launch blenderplayer from ui not working in OSX fix - by Daniel Stokes and me



########################################################
code left behind (to be included in next commit):
########################################################
		{
			/* Initialize default values for collision masks */
			Object *ob;
			for(ob=main->object.first; ob; ob=ob->id.next)
				ob->col_group = ob->col_mask = 1;
		}
2011-12-20 03:11:56 +00:00
Campbell Barton
e936c78251 svn merge ^/trunk/blender -r41503:41575 2011-11-06 10:38:44 +00:00
Campbell Barton
b0adf37ef9 - view bounds (now split from collision bounds) was still being used for bge physics in one place, comparison was incorrectly treating it as a flag too.
- cleanup Object struct - remove pad and unused flags, convert some shot's to char's, saving 24 bytes.
2011-11-05 02:30:25 +00:00