Commit Graph

3244 Commits

Author SHA1 Message Date
Dalai Felinto
c8f6313487 Fix T45428: Sometimes in a dupligroup linked actuators are not triggered
Revert "BGE: Cleanup : merge 3 loop in 1 in function DupliGroupRecurse."

This reverts commit 371e5f25a054759014efa27c6fe4d497854ed64e.

The fix is basically to revert the cleanup commit 371e5f25 (and 3d658bf7)
Also 5dc22fbbf had to be adapted to the reverted code.

Conflicts:
	source/gameengine/Ketsji/KX_Scene.cpp
2015-07-16 12:53:20 -03:00
Alexander Romanov
38940662e5 Particle Info node support for GLSL mode and the internal render.
With this patch "Particle Info" node from Cycles works in GLSL and BI

Alexander (Blend4Web Team)

Reviewers: psy-fi
Note: moved particle info to object render instance instead of
shadeinput during review - Antony.

Differential Revision: https://developer.blender.org/D1313
2015-07-14 18:52:29 +02:00
Campbell Barton
0918461d61 Move from MTFace to MTexPoly w/ texture checks
Part of moving away from MFace.
2015-07-14 22:36:00 +10:00
Antony Riakiotakis
e142ae77ca Imbuf types refactor.
ImBuf types were getting stored as bitflags in a 32bit integer which had
    already run out of space. Solved the problem by separating file type to
    an ftype enum, and file specific options to foptions.

    Reviewed by Campbell, thanks a lot!
2015-07-13 13:58:17 +02:00
Jorge Bernal
6ffc988ae3 BGE Clean-up: New EXP prefix for the BGE Expression module
The expression module now uses an EXP prefix and it follows a
distribution similar to blender.

Additionally the hash function in EXP_HashedPtr.h was simplified and the
files EXP_C-Api.h &.EXP_C-Api.cpp were deleted because were unused.

Reviewers: campbellbarton, moguri, sybren, hg1

Projects: #game_engine

Differential Revision: https://developer.blender.org/D1221
2015-07-12 16:58:12 +02:00
Campbell Barton
a8b8d60c50 CustomData: deprecate CD_ID_MCOL 2015-07-10 16:47:39 +10:00
Campbell Barton
a837797740 Cleanup: quiet warning 2015-07-09 19:33:02 +10:00
Porteries Tristan
980ea4e54f Use it->second instead of (*it).second in KX_BlenderSceneConverter. 2015-07-09 09:45:21 +02:00
Porteries Tristan
0c14a897dd BGE: Fix wrong current logic manager in collision callback. 2015-07-07 13:37:27 +02:00
Quentin Wenger
6ed1a1abe2 BGE: bge.texture API documentation enhancement
This patch attempts to improve and review the documentation of bge.texture, as requested in the [[ http://wiki.blender.org/index.php/Dev:2.5/Source/Development/Todo/GameEngine#Video_Texture | TODO list ]].

More specifically, it

  - fixes the rst syntax, including titles of the examples bge.texture.py and bge.texture.1.py;

  - adds, standardizes and reviews description of the API elements, particularly signatures, types, etc.

  - adds SOURCE_* constants to the doc

  - splits the doc into thematical parts (Video, Image, Texture, and Filter Classes, Functions, Constants).

Notes:

  - The parameter "mode" of ImageBuff.plot has to be described better. Actually, the whole set of IMB_BLEND_* constants (from IMB_imbuf.h) should be exposed to Python. I'll do that in a future diff, and complete the doc at the same moment (adding those IMB_BLEND_* constants to the Constants part of this doc).

  - The option of using webcams in VideoFFmpeg is still particularly not well documented. I am planning to make a proposal about fixing T18634 (and its corresponding TODO in the list) by integrating OpenCV in the BGE (and Blender?). The idea would then probably be to add a new class, f.ex. ImageWebcam, making this functionnality more specialized. So for now I don't think it is worth to document that part much.

This patch fixes T44284 too.

Reviewers: moguri, kupoman, campbellbarton, panzergame, lordloki

Reviewed By: panzergame, lordloki

Subscribers: hg1

Projects: #game_engine, #game_python, #documentation

Maniphest Tasks: T44284

Differential Revision: https://developer.blender.org/D1352
2015-07-06 21:48:25 +02:00
Jorge Bernal
12583287e7 BGE: Fix T45341: Crash when camera is eliminated
A null check is added to avoid crashes when the camera is removed during
the game and no other is available
2015-07-06 15:40:50 +02:00
Sybren A. Stüvel
be07ab58c6 BGE Fix T45207: Camera actuator shakes with low height
The camera-aiming code was using a near-zero-length cross product, which
caused oscillations. Thresholding on the cross product length seems to
fix this.

Reviewers: lucky3, Matpi, lordloki

Reviewed By: lordloki

Projects: #game_engine

Differential Revision: https://developer.blender.org/D1387
2015-07-06 12:20:29 +02:00
Porteries Tristan
b997bda9f9 BGE: Fix T45259 collision sensor registration. 2015-07-03 23:48:26 +02:00
Thomas Szepe
97b431e42d BGE: Add integer uniforms for 2D Filter
Actually it is only possible to pass float properties to a 2D filter (GLSL fragment shader).
This patch allows also to use integer properties for the 2D filter.

Reviewers: sybren, agoose77, kupoman, moguri, lordloki, panzergame

Reviewed By: lordloki, panzergame

Projects: #game_engine

Differential Revision: https://developer.blender.org/D1370
2015-07-03 17:07:31 +02:00
Porteries Tristan
145ab8c49e BGE: Extend Python API for KX_BlenderMaterial (specular, diffuse…)
Add support for material diffuse, specular… in KX_BlenderMaterial python proxy. And use mathutils in KX_BlenderMaterial for the specular and diffuse color in KX_BlenderMaterial.

Reviewers: sybren, brita_, kupoman, agoose77, dfelinto, moguri, campbellbarton, hg1

Reviewed By: moguri, campbellbarton, hg1

Subscribers: dfelinto

Projects: #game_engine

Differential Revision: https://developer.blender.org/D1298
2015-07-03 11:47:48 +02:00
Dalai Felinto
fdb474fc8a Game Engine: Camera Lens Shift: support to change it during game 2015-07-02 13:51:30 -03:00
Porteries Tristan
e61ead7d4c BGE: Fix T45267 Lib load without material caching. 2015-07-02 12:27:14 +02:00
Sybren A. Stüvel
db8ccc18f7 Fix T45269: Blender 2.75 crashes when I run my the game
Velocity clamping on static objects caused a crash.
2015-07-02 12:05:49 +02:00
Porteries Tristan
e80e4c937b BGE: Fix T45196 armature action on libloading. 2015-07-02 11:56:49 +02:00
Porteries Tristan
607dca0705 BGE: Fix T44069 playing action during libfree. 2015-07-01 16:51:48 +02:00
Dalai Felinto
f12b1790a0 Fix 73841 : Game Engine - Camera Lens Shift
This is essential for video projection, and the alternative until now was to manually change the projection matrix via Python.
( http://www.blender.org/manual/game_engine/camera/introduction.html#camera-lens-shift
- this page will be removed as soon as I commit this)

Also this is working for perspective and orto cameras BUT if the sensor is not AUTO it will only look correct in blenderplayer (this is an unrelated bug, but just in case someone runs into it while testing this, now you know why you got the issue).

Kudos for the BlenderVR project for supporting this feature development.

Differential Revision: https://developer.blender.org/D1379
2015-06-29 10:45:27 -03:00
Sybren A. Stüvel
9f48aa45ad BGE: added clamping of angular velocity.
Angular velocity clamping was missing from the BGE. It is implemented
similarly to the linear velocity clamping. It is needed to be able to
drive physical simulations of systems that have a limited rotational
speed.

Reviewed by: campbellbarton, panzergame, ton

Differential Revision: https://developer.blender.org/D1365
2015-06-28 12:54:53 +02:00
Sybren A. Stüvel
c5c2883ce0 BGE Fix: apply velocity clamping on every physics subtick
This patch uses the Bullet "internal tick callback" functionality to
ensure that velocity clamping is performed after every physics update.
This makes a difference when physics subticks > 1, as in that case the
too-high velocity could have impacted the simulation.

This patch follows the examples at [1] and [2]; the latter example
also explains that the way we limit velocity in the BGE (before this
patch) is wrong.

[1] http://bulletphysics.org/mediawiki-1.5.8/index.php/Simulation_Tick_Callbacks
[2] http://www.bulletphysics.org/mediawiki-1.5.8/index.php/Code_Snippets#I_want_to_cap_the_speed_of_my_spaceship;

Reviewed by: panzergame

Differential Revision: https://developer.blender.org/D1364
2015-06-28 12:54:53 +02:00
Quentin Wenger
49aa7b1261 BGE: Fix color used as background in VideoTexture.
Now we use color converted (if we do a color management) by the setter for background color in VideoTexture (ImageRender & ImageMirror).

Reviewers:panzergame
2015-06-24 13:03:23 +02:00
Porteries Tristan
d979ac4cc9 BGE: Fix T45110, T44174, armature animations update and mirror render.
Reveiwers:Moguri, Matpi, youle
2015-06-22 18:16:31 +02:00
Porteries Tristan
2a305580b2 BGE: Fix T38030: wrong vertex index returned by KX_PolyProxy
Fix T38030.
In c++ source we use one list for triangles and an other for quads, but KX_PolyProxy doesn't care about that and return the vertex offset in its list. So we just have to compute the offset of each RAS_DisplayArray to its previous to have an absolute vertex index.

Reviewers: moguri, campbellbarton, kupoman, agoose77, brita_, hg1

Reviewed By: agoose77, hg1

Projects: #game_engine

Maniphest Tasks: T38030

Differential Revision: https://developer.blender.org/D1324
2015-06-20 14:21:31 +02:00
Campbell Barton
6b3a43ccb4 BGE: dissallow calling reverse on internal clists 2015-06-20 20:02:16 +10:00
Jorge Bernal
51188ecbf1 BGE Cleanup: Translation of several comments in Dutch 2015-06-20 01:19:32 +02:00
Jorge Bernal
8e1ba0b805 BGE Cleanup: remove dead code at SetCenterOfMassTransform
Basically, at this line body is always NULL and the code is never
executed

Reviewers: moguri, hg1, panzergame, agoose77

Reviewed By: hg1, panzergame, agoose77

Subscribers: blueprintrandom

Projects: #game_engine

Differential Revision: https://developer.blender.org/D1331
2015-06-20 01:00:22 +02:00
Porteries Tristan
e9406256d0 BGE: Simplify collision callback registration.
Remove list m_triggerController and just use getter CcdPhysicsController->Registered().

Reviewers: sybren, agoose77
2015-06-19 16:40:42 +02:00
Campbell Barton
94eb2647d5 BGE: correct case for createConstraint keyword 2015-06-16 21:22:41 +10:00
Campbell Barton
fa823dc828 Cleanup: style 2015-06-16 10:32:41 +10:00
Jorge Bernal
6d63446710 BGE: Fix for precision lost in setBackground/getBackground at Video Texture
Now internally the variables are processed as floats avoiding int->float->char conversions that are causing precision lost.

A check for int numbers is maintained to keep compatibility with old behaviour.

Reviewers: ben2610, campbellbarton, moguri, hg1

Reviewed By: moguri, hg1

Subscribers: campbellbarton

Projects: #game_engine

Differential Revision: https://developer.blender.org/D1301
2015-06-16 00:05:25 +02:00
Porteries Tristan
1c707a2392 BGE: Fix T43918: adding submodule bge.app including attribute version.
This patch adds the submodule app to bge. apps contains constants similar to bpy.app, particularly version (tuple of three ints like 2.75.1).

It was requested in T43918 and set as TODO.

The patch also adds rst doc for the module.

Reviewers: moguri, kupoman, lordloki, panzergame, campbellbarton

Reviewed By: lordloki, panzergame, campbellbarton

Subscribers: marcino15

Projects: #game_logic, #game_python, #game_engine

Differential Revision: https://developer.blender.org/D1348
2015-06-15 21:46:56 +02:00
Campbell Barton
5b8af1d1f1 Fix T44704: BGE regression importing bpy.types 2015-06-15 21:11:45 +10:00
Campbell Barton
edfe2d6691 BGE: fix use after free 2015-06-15 20:56:44 +10:00
Campbell Barton
75a86d6a8e Fix for building without Python 2015-06-14 04:53:10 +10:00
Mitchell Stokes
5aade17bdf Revert "BGE : KX_VertexProxy support for more than 2 UV channel."
This reverts commit fb0dd596e9a58f095730359a11759c40ea46be44.

This commit reintroduced a deprecated API that we'd rather not see in a
release. A better solution is being worked on.
2015-06-06 13:12:27 -07:00
Jorge Bernal
b2e5c017a1 BGE: correct ftell use in LoadGlobalDict 2015-06-05 11:16:46 +10:00
Jorge Bernal
f3434e5f82 BGE Cleanup: remove dead code for collide, visible and twoside variables
As material is not NULL at this stage there is no need to do a NULL
check. Also to remove dead code

Reviewers: dfelinto, panzergame, hg1, moguri

Reviewed By: panzergame, hg1, moguri

Projects: #game_engine

Differential Revision: https://developer.blender.org/D1330
2015-06-05 02:24:23 +02:00
Campbell Barton
33a7b72678 Fix T44919: BGE marhutils attrs leak memory 2015-06-02 11:08:17 +10:00
Jorge Bernal
28ef76d0f0 BGE Cleanup: Removing flen variable where it is not used 2015-05-30 18:30:34 +02:00
Jorge Bernal
71dcaa7744 BGE Cleanup: Identical code for both if/else branches 2015-05-30 18:15:11 +02:00
Jorge Bernal
9755986637 BGE: Fix memory leak when unable to add wheel 2015-05-29 17:03:54 +02:00
Jorge Bernal
bdf242fa21 BGE Cleanup: Remove old commented Sumo physics code 2015-05-28 17:50:39 +02:00
Jorge Bernal
3b158d2e05 BGE Cleanup: The value of ikconstraint cannot be NULL at this stage and
therefore it is not necessary the NULL check.
2015-05-28 17:18:50 +02:00
Thomas Szepe
9aea98d33c BGE: Add missing m_jumping initialization 2015-05-27 18:19:38 +02:00
Porteries Tristan
153cebd95b BGE: Fix bug with default material and MTFace.
It set default material even if there are a MTface but no blender material.
Tested in GLSL and Multitexture.

Reviewers: HG1
2015-05-25 10:33:04 +02:00
Porteries Tristan
2da9a39418 BGE : Fix black material on meshes without materials in blenderplayer.
Blenderplayer forgot to initialize the default material (defmaterail) with function init_def_material().
This reverts also the plumber commit 2fa4a48bcef05671890fafc3fe50a8fa619f0259.

Reviewers: campbellbarton
2015-05-24 11:46:57 +02:00
Campbell Barton
5d30c23c35 doxygen: corrections/updates
Also add depsgraph & physics
2015-05-20 14:12:22 +10:00