Commit Graph

3183 Commits

Author SHA1 Message Date
Thomas Szepe
fd22a92939 BGE: Add new world API KX_WorldInfo (KX_Scene)
This Patch will add a the world API (mist, background, ambient)  to KX_WorldInfo.
The new API uses now attributes.

Reviewers: campbellbarton, moguri

Reviewed By: moguri

Subscribers: klauser, brecht

Differential Revision: https://developer.blender.org/D157
2015-03-24 00:23:40 +01:00
Thomas Szepe
6c9502a6c1 BGE: Remove BlenderWorldInfo
This patch will remove the BlenderWorldInfo and move the source into KX_WorldInfo.

Reviewers: brecht, moguri

Reviewed By: brecht, moguri

Differential Revision: https://developer.blender.org/D156
2015-03-24 00:19:15 +01:00
Thomas Szepe
ce40fb9ab2 BGE: World color management fix
This patch will fix the color management for the mist and global ambient color.
It will remove the old "Color Management" switch in the BGE "Render > Shading" panel and will use the "Display Device" setting in the "Scene > Color Management" panel instead.

Reviewers: moguri, brecht

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D154
2015-03-23 23:56:46 +01:00
Thomas Szepe
931c3e6544 BGE: Code clean up for world (mist, background, ambient)
Code clean up for BGE world mist, background and global ambient color.
Move mist render update to BlenderWolrdInfo

Reviewers: moguri, brecht

Reviewed By: moguri, brecht

Differential Revision: https://developer.blender.org/D152
2015-03-23 22:49:38 +01:00
Thomas Szepe
c73693d4a5 BGE: Fix T43592: World GLSL
This patch will fix the world GLSL (mist, background, ambient) update for the BGE.

Reviewers: moguri, brecht

Reviewed By: moguri, brecht

Subscribers: panzergame

Differential Revision: https://developer.blender.org/D151
2015-03-23 22:32:49 +01:00
Thomas Szepe
e7ae96ad41 BGE: Fix T27322: World F-Curve
This patch fixes the world (mist, background, ambient) F-Curve for  for the BGE.

Reviewers: moguri, brecht

Reviewed By: moguri, brecht

Differential Revision: https://developer.blender.org/D150
2015-03-23 21:43:42 +01:00
Thomas Szepe
d07c666a0e BGE: Add setMistType and setMistIntensity API.
This patch adds the missing setMistType() and setMistIntensity() to the API

Reviewers: campbellbarton, brecht, moguri

Reviewed By: campbellbarton, brecht, moguri

Subscribers: campbellbarton, dingto

Differential Revision: https://developer.blender.org/D149
2015-03-23 21:40:11 +01:00
Thomas Szepe
2affbb437b BGE: Multitexture world (mist, ambient) fix
This patch fix the existing word API for mist and global ambient lighting.
Add deprecated message to disableMist()
Add setUseMist(enable).

Reviewers: dfelinto, campbellbarton, moguri

Reviewed By: moguri

Subscribers: solarlune, jta, brecht

Projects: #bf_blender:_next

Differential Revision: https://developer.blender.org/D148
2015-03-23 21:36:08 +01:00
Jorge Bernal
ddf58004c4 BGE: LoD Hysteresis clean up
Move scene hysteresis value to KX_Scene where it should be (instead of
KX_GameObject)
2015-03-23 19:03:56 +01:00
Jorge Bernal
e7d051043d BGE: New hysteresis offset to improve LOD level transitions
This change introduces a new hysteresis parameter that it will be added
or subtracted to/from the LOD distance to avoid popping when a LOD
object moves close to the LOD transition continuously.

Then, we have the following:

- a new LOD Hysteresis setting per scene (default 10%) which is located
in Scene context --> Level of Detail panel. This scene parameter also
will active/deactive the scene hysteresis.
- and a new LOD Hysteresis setting per object (default 10%) which is
located in Object context --> Levels of Detail panel. The LOD hysteresis
setting per object (if active) will overwrite the hysteresis setting per
scene value.

For the new blends: the hysteresis setting per scene would be active by
default and the per object would be inactive by default.
For the old blends: both hysteresis settings (per scene and per object)
would be inactive by default. A quick way to take advantage of this
feature for old blends would be to activate the hysteresis parameter in
the scene context -> Level of Detail panel

Reviewers: campbellbarton, kupoman, moguri

Reviewed By: kupoman, moguri

Subscribers: nonamejuju, lordodin

Differential Revision: https://developer.blender.org/D957
2015-03-22 18:19:49 +01:00
Thomas Szepe
0b4a71b072 BGE: Add physics constraints replication
This patch will add a physics constraints replication for group instances
(dupli group).
It also fix crashing when when a group instance is made from a linked
group instance and both are on the active layer.

Initial patch T31443 from moerdn (Martin Sell).

Reviewers: lordloki, sergof, moguri, sybren

Reviewed By: moguri, sybren

Differential Revision: https://developer.blender.org/D658
2015-03-22 17:56:26 +01:00
Jorge Bernal
2744ce77de Revert part of D1074 related to acceleration taked into account.
It has been reverted because it was affecting obstacle avoidance
(T44041).

This fix should be backported to 2.74
2015-03-21 17:54:49 +01:00
Sybren A. Stüvel
d21018b334 Fix T44065: fixed vehicle constraint
Commit ffee7f1a58a18bc08add94176ddffe29809139a6 broke vehicle constraints; this fixes that.
2015-03-21 14:42:57 +01:00
Campbell Barton
4b88541d59 CMake: unbundle eigen3
Optionally use systems eigen3 library.

T41989 by @hasufell with edits
2015-03-19 15:41:41 +11:00
Gaia Clary
ef70d644d6 reverting unintentionally changed value of enum OBJ_TEXT 2015-03-16 18:58:58 +01:00
Gaia Clary
9ed5a1073e fix D1130 renamed the enum OBJ_FONT to OBJ_TEXT to avoid naming conflicts in Windows 2015-03-16 18:46:40 +01:00
Antony Riakiotakis
77bc623bc4 Get rid og gluBuild2DMipmaps on game engine. 2015-03-16 16:18:37 +01:00
Sybren A. Stüvel
30527e3e55 Fix T43178: BGE has hard-coded 60 Hz as frame rate
Two areas of the BGE use a hard-coded 60 Hz as frame rate. However, this 60 Hz is just a default setting, and can be changed in the Blender interface.
This setting is now used instead of the hard-coded 60 Hz.

CcdPhysicsEnvironment::SetFixedTimeStep() is actually never called, as we don't even support a true fixed-timestep simulation.
2015-03-16 10:12:37 +01:00
Pierluigi Grassi
225027ce5d BGE - new read-only attribute in KX_GameObject python api (LOD level)
Added a new "current_lod_level" property to the python api of
KX_GameObject. The property returns the current lod level of the game
object. The purpose of the property is activate logic routines only when
an object is at a certain lod-distance from the camera, avoiding to
separately recomputing the same distance in the logic script. Usage in
python script might look like:

owner = bge.logic.getCurrentController().owner
lod_level = owner.currentLodLevel
if lod_level == 0: ...do something
else: ... object might be too distant

Reviewers: dfelinto, kupoman, moguri

Reviewed By: kupoman, moguri

Subscribers: lordloki

Projects: #game_engine

Differential Revision: https://developer.blender.org/D978
2015-03-15 17:26:49 +01:00
Jorge Bernal
dd3ade250d BGE: Fix for T43994 Steering actuator bug with Navmesh
Now the facing option is taken into account as before

This is a regression and to be ported to the final release branch.
2015-03-15 11:38:04 +01:00
Porteries Tristan
176ecd9c9c BGE : Fix for T43724 and T41599 addObject() with KX_FontObject and
overlay scene

GetGameObjectType is overwritten in KX_FontObject to differentiate a
font object into AddNodeReplicaObject function. Now, in this function,
we add fonts in the appropriate list.

Reviewers: campbellbarton, moguri, dfelinto, lordloki

Reviewed By: lordloki

Subscribers: lordloki

Projects: #game_logic, #game_engine

Differential Revision: https://developer.blender.org/D1130
2015-03-15 10:50:59 +01:00
Jorge Bernal
73ad76970e BGE: Fix for T43980 MouseLook (actuator) triggers MouseMovement (sensor)
on other objects permanently

only trigger mouse event when it is necessary, this way we avoid
conflicts with other mouse sensors.
2015-03-13 00:50:25 +01:00
Campbell Barton
29e5de3728 Fix BGE: calling ReleaseInstance on NULL joystick 2015-03-09 16:36:35 +11:00
Jorge Bernal
b4fccce1f6 BGE: Fix for regressions T43883 and T43456 (and T43876 likely). SDL joystick related
Only to create and destroy joystick devices for connected joysticks

Reviewers: campbellbarton, sybren, moguri

Reviewed By: sybren

Maniphest Tasks: T43883, T43876

Differential Revision: https://developer.blender.org/D1161
2015-03-07 21:27:30 +01:00
Sybren A. Stüvel
ffee7f1a58 BGE: Fix crash when a constraint misses its reference object
Blender allows you to create a constraint without specifying its reference
object, even when the constraint requires such a reference. The BGE would
crash on this. This change simply ignores such a constraint.
2015-03-04 14:15:41 +01:00
Thomas Szepe
38c30c41d7 BGE: Fix ShowDeprecationWarning macro.
Reviewers: lordloki, brita_, sybren, moguri

Reviewed By: moguri

Differential Revision: https://developer.blender.org/D1144
2015-02-27 23:10:43 +01:00
Antony Riakiotakis
15957a9e4d Get rid of gluScaleImage in our game engine as well. 2015-02-27 14:47:39 +01:00
Thomas Szepe
eaabe9d6c6 BGE: Fix for CreateConstraint API
This patch fix two bugs related to CreateConstraint().
1. Disable linked collision only working with 6DoF constraints.
2. If all pivot axis rotations setted to zero the linked object disappears.

{F101374}

Reviewers: moguri, sybren, brita_, lordloki

Reviewed By: lordloki

Subscribers: p9ablo

Differential Revision: https://developer.blender.org/D704
2015-02-26 20:08:22 +01:00
Bastien Montagne
d9fa9bffd5 Grmll, sorry for the noise, fix stupi cpoypaste typo in previous commit. 2015-02-26 11:46:05 +01:00
Bastien Montagne
ac26a61385 Attempt to fix BGE build on windows.
Caused by rBb5b359b48f7f35a79b3eec, better to try a full build before pushing that type of commit. :/
2015-02-26 11:42:22 +01:00
Antony Riakiotakis
b5b359b48f Warning messagebox for windows when an unsupported implementation of
OpenGL is detected:

Hoping to decrease the frequency of by far one of the most frequent bug
reports by windows users.

There is some reorganization of the GHOST API to allow easy addition of
further OpenGL options in the future. The change is not propagated too
deep to keep the size of the patch managable. We might reorganize things
here later.

For OpenGL we do two checks here:
One is a combination of GDI generic renderer or vendor microsoft
corporation and OpenGL version 1.1. This means the system does not
use GPU acceleration at all. We warn user to install a graphics
driver and of cases where this might happen (remote connection, using
blender through virtual machine)

The other one just checks if OpenGL version is less than 1.4 (we can
easily change that in the future of course) and warns that it is
deprecated.

Both cases will still let blender startup correctly but users should now
have a clear idea of the system being unsupported.

A user preference flag is provided to turn the warning off.

Now stop posting those bug reports without installing a driver first -
please?
2015-02-25 13:51:53 +01:00
Sybren A. Stüvel
6d9c99422b Fix T43748: MouseLook actuator raises an Assert error
An assertion seems to be inverted by mistake, as MT_assert(!m_mouse); is followed
by using m_mouse->XXXX.
2015-02-21 14:39:04 +01:00
Ines Almeida
3445ff0f93 scene conversion: style cleanup 2015-02-21 12:16:21 +00:00
Ines Almeida
4c0adb95dc gamengine: removing useless comment 2015-02-21 12:16:21 +00:00
Ines Almeida
9bfdcc4d32 gameengine: removing addInitFromFrame hack 2015-02-21 12:16:20 +00:00
Ines Almeida
5785df431b gameengine: dataconversion import and whitespace cleanup 2015-02-21 12:16:20 +00:00
HG1
8db9b07cb3 Fix T33762 - texture fonts were not using the material color (gameengine) 2015-02-21 12:16:20 +00:00
HG1
f1a65a9fab makeScreenshot - adding frame number to the filename 2015-02-21 12:16:20 +00:00
Benoit Bolsee
cf4646b95f commiting patch to fix T30173 2015-02-21 12:16:19 +00:00
Ines Almeida
c391a67830 gameengine: KX_Scene comment cleanup 2015-02-21 12:16:19 +00:00
Ines Almeida
cfec320f1e BGE cleanup: removing unused async logic bricks
This code was never run and is an outdated copy from the code above.
If someday this is needed again, it is better to start clean.
2015-02-21 12:16:19 +00:00
Thomas Szepe
87572091fb BGE: Fix T43215: Rigidbody constraints deletion.
Deleting an object was deleting all rigidbody constraints in the scene.
Bug was introduced with D701.

Reviewers: agoose77, sergof, moguri, lordloki, sybren

Reviewed By: lordloki, sybren

Subscribers: sybren, hbar, blueprintrandom, sergof, agoose77

Differential Revision: https://developer.blender.org/D1007
2015-02-20 23:37:32 +01:00
Ines Almeida
528514c393 bge physics: disallowing compound collisions for soft bodies
Closes D610, T40427, T30630

Cherrypicked from local squash
Conflicts:
	release/scripts/startup/bl_ui/properties_game.py
2015-02-19 11:20:18 +00:00
Jorge Bernal
5d0696052a BGE: Fix T41502 Path following jumping
New Lock Z velocity parameter was added. This parameter avoid the micro-jumping.
By default it is actived except when you load an old file that it is deactived to keep former behaviour.

Additionally it was solved another issue related with the acceleration: That is the acceleration value was not taked into account and we had always the maximum linear velocity from the beginning of movement. Now the acceleration is taken into account until we reach the maximum velocity.
When you load an old file, the acceleration value is set to the maximum range (1000.f). This way we simulate a maximum velocity constant from the beginning of movement (former behaviour).

{F142195}

Reviewers: moguri, dfelinto, campbellbarton

Reviewed By: campbellbarton

Subscribers: sergey

Differential Revision: https://developer.blender.org/D1074
2015-02-18 23:24:02 +01:00
Jorge Bernal
4ed8b70870 BGE: Fix T42437: Physics/Compound bug
Null check to verify that parent has a character controller. Otherwise (i.e empty) it will crash.

Reviewers: moguri, campbellbarton

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D1115
2015-02-18 19:59:21 +01:00
Jorge Bernal
9bd2a7c0a8 BGE: Fix T41570: Blender crash when physics createConstraint
Move physicsid type to unsigned long long to avoid crashes on Windows 8.1 64bits.
Other systems also modified to put them inline with this solution.

Reviewers: dfelinto, brita_, moguri, juicyfruit, campbellbarton

Reviewed By: juicyfruit, campbellbarton

Subscribers: juicyfruit

Differential Revision: https://developer.blender.org/D1122
2015-02-18 19:52:54 +01:00
Sybren A. Stüvel
bf157ce927 Fix T42919 & T42218: BGE: Python-driven armature animation got buggy
Due to changes in the way animation updates were handled,
BL_ArmatureObjects were no longer registering to KX_Scene as animated.

Moguri says: It might have been relying on the deformer update which
moved rom being called on every object in the render step. Now
armature deformers are only updated if they need to be.

Fix T42919 & Fix T42218
2015-02-15 02:00:56 +01:00
Jorge Bernal
1af042d9ed BGE: Fix for T42285 & T38935 crashes. They are Rayhit related.
We make sure that good values are passed to GetPolygon() and we check that the visual mesh doesn't have a wrong displacement when it passes over a object which has a mesh triangle as compound bound.

Reviewers: dfelinto, sergof, agoose77, moguri

Reviewed By: moguri

Subscribers: agoose77

Differential Revision: https://developer.blender.org/D979
2015-02-13 00:12:21 +01:00
Jorge Bernal
9e217ccb2e BGE Fix T39026: No collisions detected with parented rigid body object
Fix for T39026. Preliminary investigation by blenderscripter on D446.
Also it solves bug T41285 (Parenting object leave collission box).

Refactor commit b90de0331df6c92af909b20a3e183596ff3511e4 introduced a
regression bug.

Reviewers: sergof, campbellbarton, moguri

Reviewed By: moguri

Subscribers: blueprintrandom, blenderscripter

Differential Revision: https://developer.blender.org/D1064
2015-02-12 23:56:50 +01:00
Campbell Barton
d4934f8f6d cleanup: style/indentation 2015-02-11 18:39:28 +11:00
Sybren A. Stüvel
2b01b71339 Fix T43565: BGE removed unneeded if/else in BL_KetsjiEmbedStart 2015-02-10 21:28:18 +01:00
Ines Almeida
4edc1bbe02 BGE - Vehicle Controller - add background and API checks for arguments of function calls
Fixes T41570 crash
For readability, attachDir was renamed to downDir and the Python API docs renamed accordingly
2015-02-09 20:58:15 +00:00
Ines Almeida
a088b9488d Recreating bge python modules instead of using existing
All of the initXPythonBinding functions are changed to always creating the module instead of importing if previously existing.
I can instead only remove the module return when the import is ok, so that it always inits. But then, I don't see the point in importing.

I make sure that these functions are called only once per run, inside initBGE.
This was not the case with GameTypes. I moved initPyTypes inside of initGameTypesPythonBinding due to that.

I reorganized initGamePlayerPythonScripting and initGamePythonScripting so that they run things in the same order.
initGamePlayerPythonScripting imports mathutils and aud, the other only aud. Shouldn't it be the same for both?

Reviewers: campbellbarton

Subscribers: sybren

Projects: #game_engine, #game_python

Differential Revision: https://developer.blender.org/D1070
2015-02-09 20:56:38 +00:00
Sybren A. Stüvel
dd65a44c9a BGE physics: When colliding, report first contact point to Python
This patch adds two parameters to the functions in the
collisionCallbacks list. The callback function should thus be like
this:

```
def on_colliding(other, point, normal):
    print("Colliding with %s at %s with normal %s" % (other, point, normal))

game_ob.collisionCallbacks.append(on_colliding)
```

The `point` parameter will contain the collision point in world
coordinates on the current object, and the `normal` contains the
surface normal at the collision point.

The callback functions are checked for the number of arguments
`co_argcount`. The new `point` and `normal` arguments are only passed
when `co_argcount > 1` or when `co_argcount` cannot be determined.

Reviewers: brita_, campbellbarton

Subscribers: sergey, sybren, agoose77

Projects: #game_physics

Differential Revision: https://developer.blender.org/D926
2015-02-08 15:52:13 +01:00
Campbell Barton
b12f3cbee7 cleanup: style 2015-02-07 04:50:21 +11:00
Ines Almeida
15cd222270 BGE: python API initialization cleanup
The goal of these changes is to Close T40132 and to get rid of the 'PyRun_SimpleString'

Hilighted changes are:
- consistent naming and initialization of BGE submodules
- initialization of the 'bge' module as a proper module
- using PyDoc_STRVAR instead of static char*
- generic cleanup (unused arguments, logica ordering, naming and whitespace)

Reviewers: campbellbarton

Maniphest Tasks: T40132

Differential Revision: https://developer.blender.org/D983
2015-02-03 15:32:55 +00:00
Ines Almeida
2699866720 BGE: python API cleanup - initialization for bge with submodules, closes D615 2015-02-03 15:32:55 +00:00
Ines Almeida
0e0af4f772 BGE: python API cleanup - adding proper initialization to GameTypes 2015-02-03 15:32:55 +00:00
Ines Almeida
e67bd30bdf BGE: python API cleanup - replace BLI_program_path with BKE_appdir_program_path 2015-02-03 15:32:55 +00:00
Ines Almeida
ba0978c1a9 BGE: python API cleanup - bge submodules definitions 2015-02-03 15:32:54 +00:00
Ines Almeida
a7b0330c13 BGE: python API cleanup - using PyDoc_STRVAR instead of static char*
Cherry-picking d503f8a onto 117edbb
Conflicts:
	source/gameengine/Ketsji/KX_PythonInit.cpp
2015-02-03 15:32:54 +00:00
Ines Almeida
95425bc97a BGE: python API initialization cleanup
-Removing unused parameters
-Updating some parts to match bpy_interface.c initialization

Cherry-picking 14fceb6 onto 117edbb
Conflicts:
	source/gameengine/Ketsji/KX_PythonInit.cpp
2015-02-03 15:32:54 +00:00
Antony Riakiotakis
750506be97 Adjust GLSL drawing of window coordinates from camera view (use camera
bounds instead of window bounds). Fixes remaining part of T43346
2015-02-02 14:26:05 +01:00
Campbell Barton
3cf7a8008e Fix crash on joystick access (if SDL's not found)
D985 by @pgi
2015-01-29 17:17:29 +11:00
Sybren A. Stüvel
dd673337f1 BGE: draw contact points + normals in yellow
Red was used with different semantics in the physics visualisation,
switching to yellow to prevent confusion.

A screenshot can be found at http://www.pasteall.org/pic/80766 -- it's
the yellow balls + lines.

Reviewers: brita_, lordloki, campbellbarton

Reviewed By: lordloki, campbellbarton

Subscribers: lordloki

Projects: #game_physics

Differential Revision: https://developer.blender.org/D925
2015-01-28 22:09:58 +01:00
Sybren A. Stüvel
e5a852c3f3 BGE: draw contact points as sphere + line indicating the surface normal.
A screenshot can be found at http://www.pasteall.org/pic/80766 -- it's the yellow balls + lines.

Reviewers: brita_, lordloki, campbellbarton

Reviewed By: lordloki, campbellbarton

Subscribers: lordloki

Projects: #game_physics

Differential Revision: https://developer.blender.org/D925
2015-01-28 22:09:58 +01:00
Campbell Barton
59e2f919ac missed last commit 2015-01-27 03:41:05 +11:00
Campbell Barton
b94efe0e8b BGE: remove Py3.1 workaround 2015-01-27 03:29:45 +11:00
Bastien Montagne
31219415d6 Fix BGE compilation after recent renames in BKE_image (tsst...). 2015-01-24 14:57:57 +01:00
Dalai Felinto
8ed439b89e bge.render.getStereoEye() and bge.types.LEFT_EYE/RIGHT_EYE
This function allows the user to run specific code for each of the
rendered stereoscopic eyes in the Game Engine.

The initial use case is to set the camera projection matrix in
a scene.pre_draw callback function for each eye, to be used in VR
(Virtual Reality) installations.

Reviewed by Mitchell Stokes and Campbell Barton, thank you guys.

Sample Test Python Script:
"""
import bge
import bgl
import blf

def init():
    """init function - runs once"""
    scene = bge.logic.getCurrentScene()
    scene.post_draw.append(write)

def write():
    """write on screen - depending on the eye"""
    width = bge.render.getWindowWidth()
    height = bge.render.getWindowHeight()

    # OpenGL setup
    bgl.glMatrixMode(bgl.GL_PROJECTION)
    bgl.glLoadIdentity()
    bgl.gluOrtho2D(0, width, 0, height)
    bgl.glMatrixMode(bgl.GL_MODELVIEW)
    bgl.glLoadIdentity()

    eye = bge.render.getStereoEye()

    if eye == bge.render.LEFT_EYE:
        blf.position(0, (width * 0.2), (height * 0.3), 0)
        blf.size(0, 40, 72)
        blf.draw(0, "Left")

    else: # bge.render.RIGHT_EYE:
        blf.position(0, (width * 0.7), (height * 0.3), 0)
        blf.size(0, 40, 72)
        blf.draw(0, "Right")
"""
2015-01-22 03:00:24 -02:00
Sybren A. Stüvel
7165db53f2 Cleanup of BGE code CcdPhysicsEnvironment::CallbackTriggers()
Refactored some code to be easier to read. Semantically the code is
identical.

  - Some conditions were negated to be able to return/continue early,
    rather than having the majority of the code inside an if-body.
  - Conditions were simplified (!(a == b)) turned into (a != b);
    repeated conditions calculated only once.
  - Unnecessary variables and one unnecessary condition were
    eliminated.

Reviewers: campbellbarton, lordloki

Reviewed By: lordloki

Projects: #game_physics

Differential Revision: https://developer.blender.org/D954
2015-01-21 18:43:05 +01:00
Campbell Barton
6b655ca62c Cleanup: style 2015-01-21 11:57:11 +11:00
Sybren A. Stüvel
ed8dc78691 BGE physics: get/set linear and angular damping
This patch adds the following R/W properties and method to `KX_GameObject`:

  - `linearDamping`  -- get/set linear damping
  - `angluarDamping`  -- get/set angular damping
  - `setDamping(linear, angular)` -- set both simultaneously

These allow runtime changes to the same properties that are accessible at design time in Blender's UI via `game.damping` and `game.rotation_damping`. The names of the properties were chosen to mirror the internal names of the BGE physics engine, as these are (AFAIK) also the commonly used names in physics literature.

Reviewers: campbellbarton

Projects: #game_physics

Differential Revision: https://developer.blender.org/D936
2015-01-15 18:37:22 +01:00
Bastien Montagne
1187b98d48 Fix T43174: "Record animation" does not update fcurve handles
`INSERT_FAST` implies you call `calchandles_fcurve()` at the end...
For now, since we do not store edited FCurves nor can we get them easily
(requires RNA...), just update handles of all fcurves, it's much more
performant than removing usage of `INSERT_FAST` anyway.
2015-01-09 15:29:47 +01:00
Mitchell Stokes
8ebb552a95 Fix T40257: Frustum culling not working properly
Instead of getting fancy this time, we'll just use Mahalin's simpler
fix. This may have slight performance impacts, but it is a lot simpler
than the previous fix and shouldn't cause as many bugs.
2015-01-07 20:41:07 -08:00
Mitchell Stokes
4fac29ca0e Revert "Fix T40257: Frustum culling not working properly"
This reverts commit 315609ec0c1e28eb12bde3e8bbd2a5b03672b1a9.

This fix still causes more issues than it solves.
2015-01-07 20:38:05 -08:00
Campbell Barton
29d2c71117 Fix for bool flag use 2015-01-07 12:08:55 +11:00
Jorge Bernal
ee58d44945 BGE: Fix for bugs T42520 and T42097 (mouse look actuator related).
With this fix the mouse actuator movement works well as with even screen resolutions as odd screen resolutions.
Also it fixed the movement when the border of the blenderplayer window is out of the screen limits.

Reviewed By: moguri

Differential Revision: https://developer.blender.org/D946
2015-01-05 22:07:35 -08:00
Campbell Barton
1ef33968fd Recent fix for SDL2 broke joysticks for SDL1.2 2015-01-05 20:23:30 +11:00
Campbell Barton
b240b8e231 Freestyle: reserve array sizes before filling
also use PyList_GET_ITEM when list size is known.
2015-01-04 21:23:26 +11:00
Campbell Barton
de6b546e15 Fix 8 memory leaks from bad PyList_Append use 2015-01-04 20:35:16 +11:00
Campbell Barton
8106a6b75d mathutils: refactor instantiation
remove 'type' argument, very few mathutils objects are wrapped,
add new function for creating wrapped objects.

also fixes unlikely memory leak if the data-array can't be allocated.
2015-01-04 17:43:57 +11:00
Campbell Barton
bf169d6ca6 Fix T43066: Joystick broken in GE since 2.73rc
Caused by move to SDL2, fix thanks to jensverwiebe.
2015-01-02 17:14:33 +11:00
Sergey Sharybin
784517dfb9 Joystick: Suppress add/remove device events
Previously they'll be printed to the console as a totally unknown events
together claim this shouldn't have happened which is just misleading.
2014-12-31 14:56:42 +05:00
Jens Verwiebe
c1f54bcdcc OSX: revive GHOST_HACK_getFirstFile cause it breaks things on older OSX versions.
Dunno exactly why this was done earlier, but propose not to remove code not understood.
2014-12-25 15:12:56 +01:00
Mitchell Stokes
1999b5a814 Fix ping-pong actions when using the Action Actuator. 2014-12-11 00:05:11 -08:00
Benoit Bolsee
cf7bdb42ac BGE VideoTexture: refresh() on ImageFFmpeg should have no effect.
ImageFFmpeg objects will not refresh properly because the image
file is closed immediately after creation. Therefore refresh()
should have no effect on them.
This was causing problems with ImageMix using ImageFFmpeg as
sources: refreshing the ImageMix object is required to update
the mix but it has the side effect of refreshing the underlying
sources, hence the need to skip refresh on fixed images.
2014-12-04 23:55:53 +01:00
Antony Riakiotakis
76bfce231a Make sure materials are updated before passing to renderer in game
engine - report by Dalai on irc.
2014-12-03 18:12:31 +01:00
HG1
47ebf96de4 BGE: Fix Rigid body constraint deletion
Fix for T41294.
Rigid body constraints are not deleted, if the corresponding game objects are deleted.

Reviewers: moguri

Differential Revision: https://developer.blender.org/D701
2014-12-02 19:26:06 -08:00
Mitchell Stokes
5996ad2fd4 Fixes for T41168
after the completion of the action in "Flipper", layer is removed and the actuator mistakenly receive zero when trying to get the current frame

Patch Author: avrprj

Reviewers: moguri

Projects: #game_logic

Differential Revision: https://developer.blender.org/D906
2014-12-02 19:12:03 -08:00
Campbell Barton
43fa4baa6c Refactor: BLI_path_util (part 2)
Use BKE_appdir/tempdir naming prefix for functions extracted from BLI_path_util
2014-11-23 18:55:52 +01:00
Campbell Barton
6308c16675 Refactor: BLI_path_util (split out app directory access)
This module is intended for path manipulation functions
but had utility functions added to access various directories.
2014-11-23 18:42:18 +01:00
Campbell Barton
57c9d69e6b Cleanup: warnings 2014-11-23 15:13:58 +01:00
Campbell Barton
46e2d5ee41 Cleanup: typo 2014-11-21 14:16:35 +01:00
Sergey Sharybin
80d1d624d3 Support dynamic loading of SDL libraries
This is mainly to address old issue when one need to have SDL library installed
in order to use our official builds. Some hip distros already installs SDL,
but it's not quite the same across all the variety of the distros.

We also now switching to SDL-2.0, most of the distros have it in repositories
already, so it shouldn't be huge deal to install it if needed.

Reviewers: campbellbarton

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D878
2014-11-17 17:43:18 +05:00
Campbell Barton
c31f74de6b Cleanup: use BLI_listbase_count_ex to avoid redundant looping 2014-11-16 14:23:37 +01:00
Campbell Barton
7d040d2a08 Cleanup: use BLI_listbase_*** prefix for count,sort,sort_r 2014-11-16 13:57:58 +01:00
Martijn Berger
96ca64629d Windows (MSVC2013) move to SDL2 2014-11-13 16:23:27 +01:00
Benoit Bolsee
04814476c0 Fix another crash with Navigation mesh.
Navigation mesh object need to access the current scene at
creation time. This can be at scene start or when an object
is instantiated from an inactive layer. The method of getting
the scene differs in these cases. This fix handles both.
2014-10-11 12:17:31 +02:00
Jason Wilkins
8d084e8c8f Ghost Context Refactor
https://developer.blender.org/D643
Separates graphics context creation from window code in Ghost so that they can vary separately.
2014-10-07 15:47:32 -05:00