Commit Graph

259 Commits

Author SHA1 Message Date
Benoit Bolsee
f4cc03b0f1 Better fix for BGE bug #7892: dRot is reversed on dynamic objects. Make sure that graphic, Bullet and Sumo(deprecated) objects rotate the same way. This fix reverses the rotation of non-dynamic objects compared to 2.45: you will need to change the sign of dRot in 2.45 games for them to work correctly in 2.46 2008-04-23 21:48:17 +00:00
Benoit Bolsee
bdf5c0689b BGE bug fix: crash at exit when object with Radar/Near sensor has debug properties 2008-04-19 21:15:37 +00:00
Benoit Bolsee
b0049e6088 fix BGE bug #8094: Collision sensor on child object makes the object rotate or move very fast. Collision sensor can now be set on child object without side effect. 2008-04-19 21:09:40 +00:00
Benoit Bolsee
1fc1fb117e BGE: fix compilation error with 2D filters on System without GL extenstion: add conditional compile statements 2008-04-18 22:22:50 +00:00
Chris Want
5d0a207ecb Patch from GSR that a) fixes a whole bunch of GPL/BL license
blocks that were previously missed; and b) greatly increase my
ohloh stats!
2008-04-16 22:40:48 +00:00
Kent Mein
867e12836b This patch spawns from this game engine issue:
[#7113] GE crash pressing as soon as P on 64 bit


Note:         glext.h has been removed from the source
        If you get errors compiling with it you have 2 options
                download/install 	glext.h        (preferred method)
                or set WITH_BF_GLEXT=false
        If your a user and having problems with game engine try
                setting the env var: WITHOUT_GLEXT 1

Kent
2008-04-16 17:40:59 +00:00
Benoit Bolsee
566053319a fix BGE bug #8309: After Parent Object added to the visual layer, Child Camera won't follow.
This bug fix is made of two parts:
1) It's now possible to dynamically add a camera.
2) Empty camera name on a SetCamera actuator now points to the actuator's parent object if this object is a camera. 
This trick is useful to make current a dynamically created camera: just add a SetCamera actuator on the camera itself and leave the name empty. Later, when the camera is added in the scene with an AddObject actuator, either directly or via a parent object, you just need to activate the actuator to make the newly created camera current. If you set a name on a SetCamera actuator, it will always point to the original camera, even after replication.
2008-04-14 20:54:20 +00:00
Benoit Bolsee
4bab327c1b fix BGE patch #7892: dRot motion is reversed on non-dynamic objects
Positive dRot motion actuator will now make the dynamic and non-dynamic objects rotate counter-clock wise.
2008-04-11 21:19:00 +00:00
Benoit Bolsee
e7384c9dd2 Commit patch #8799: Realtime SetParent function in the BGE
This patch consists in new KX_GameObject::SetParent() and KX_GameObject::RemoveParent() functions to create and destroy parent relation during game. These functions are accessible through python and through a new actuator KX_ParentActuator. Function documentation in PyDoc.
The object keeps its orientation, position and scale when it is parented but will further rotate, move and scale with its parent from that point on. When the parent relation is broken, the object keeps the orientation, position and scale it had at that time.
The function has no effect if any of the X/Y/Z scale of the object or its new parent are below Epsilon.
2008-04-06 18:30:52 +00:00
Benoit Bolsee
9edb6c7510 Patch #8740: enable negative axis radar sensor 2008-04-05 22:08:15 +00:00
Kent Mein
b73ba9c181 This commit reverts the #include <mesa/glu.h>
stuff used for peach to the standard <GL/glu.h>
the mesa stuff was needed for the machines for peach but its
not the stanard location of the headers, now that its not
needed were switching it back.

Kent
2008-04-02 15:03:03 +00:00
Benoit Bolsee
b20f6e27ff Commit patch #8724:
This patch modifies the BL_ConvertMesh method from the data conversion module in order to reduce the number of polygon
material objects that are created.

Normally, there should be only one material object for each material bucket(the group of meshes that are rendered together
with a single material). However, the number of materials that are created right now in the converter is much higher
and eats a lot of memory in scenes with large polygon counts. This patch deletes those material objects(KX_BlenderMaterial)
that are used only temporarily in the converter(and are now deleted only when the converter is destroyed, at the end
of the game).

For a cube that's subdivided 7 times(90+ k polygons) I get 200 MB usage in the game engine in 2.45 and 44 MB with a
svn build with this patch applied if the "Use Blender Materials" option is activated in the Game menu.
2008-03-23 23:12:40 +00:00
Benoit Bolsee
7e031b7a39 Correction on BGE fixes:
- check that an object has been created before setting the physics environment
- check that there is an active camera before using it
- when a camera is deleted, remove it from m_cameras list
2008-03-21 22:44:12 +00:00
Benoit Bolsee
b194059b7f BGE fix: ghost objects created with AddObject actuator will retain their ghost property 2008-03-15 20:52:03 +00:00
Benoit Bolsee
435a49dfe7 New rayCastTo() python method for KX_GameObject:
rayCastTo(other,dist,prop)

Look towards another point/KX_GameObject and return first object hit within dist with a property that match prop, None if no object found or if it does not match prop.

Parameters:
  other = 3-tuple (xyz coordinates) or object reference (target=center of object)
          (type = list [x,y,z] or object reference)
  dist = max distance of detection (can be negative => look behind)
         If 0 or omitted => detect up to other
	 (type=float)
  prop = property name that object must have
         If empty or omitted => detect any object
         (type=string)
2008-03-15 17:08:58 +00:00
Benoit Bolsee
3444d6612a Delta Loc/Rot/Scale Ipo curve are now supporting in the BGE with the following limitations:
1. All Ipo channels are now independent. 
In Blender 2.45, all 3 Loc Ipo channels were automatically set
together. For example, having just a LocX Ipo channel was sufficient
to fix the X, Y and Z coordinates, with the Y and Z value taken
from the object original Y and Z location in Blender. The same
was true for the 3 Rot and the 3 Scale Ipo channels: the missing
channels were assumed to have constant value taken from the object
original orientation/scale in Blender.
With this patch, all Ipo channels are now independent. 
THIS WILL CREATE BACKWARD COMPATIBILITY PROBLEM if you omit to
define the 3 channels of a same type together in your Blend file:
the undefined Loc, Rot, Scale coordinates of the object will
be influenced by the parent/spawner Loc/Rot/Scale in case the
object is a child or dynamically created.

2. Delta Loc, Rot, Scale are now supported with the following
limitations:
- The delta Loc/Rot Ipo modify the object global (NOT local)
location/orientation
- The delta Scale change the object local scale
- The delta Ipo curves are relative to the object starting
Loc/Rot/Scale when the Ipo was first activated; after that, the
delta Ipo becomes global. This means that the object will return
to this initial Loc/Rot/Scale when you later restart the Ipo
curve, even if you had changed the object Loc/Rot/Scale in the
meantime. Of course this applies only to the specific Loc/Rot/Scale
coordinate that are defined in the Ipo channels as the channels
are now independent.

3. When the objects are converted from Blender to the BGE, the
delta Loc/Rot/Scale that might result from initial non-zero values
in delta Ipo Curves will be ignored. However, as soon as the
delta Ipo curve is activated, the non-zero values will be taken
into account and the object will jump to the same Loc/Rot/Scale
situation as in Blender. Note that delta Ipo curves with initial
non-zero values is bad practice; logically, a delta Ipo curver
should always start from 0.

4. If you define both a global and delta channel of the same
type (LocX and DLocX), the result will be a global channel equivalent
to the sum of the two channels (LocX+DLocX).
2008-03-12 21:33:24 +00:00
Benoit Bolsee
52293831b2 BGE fix: game object to controller links consistancy maintained regardless of order of deletion
AddObject actuator forces last created object to hang in memory even after object is removed from scene => bad link between object and physic controller that causes Blender to crash in case a python script tries to use it (bad programming anyway). 
This patch avoids the crash by maintaining consistent links at all time.
2008-03-09 21:51:38 +00:00
Benoit Bolsee
822e51bd2d BGE memleak fixed: mesh/material not deleted when switching scene 2008-03-09 21:42:03 +00:00
Benoit Bolsee
0db0f5734d Various mem leaks related to CValue reference count fixed 2008-03-01 19:46:50 +00:00
Benoit Bolsee
3cf5b1d6fb Radar/Near sensor performance problem fixed 2008-03-01 19:17:37 +00:00
Benoit Bolsee
407b2d334d unknown property fixed in sensor/actuators 2008-03-01 19:05:41 +00:00
Benoit Bolsee
13aa413361 patch 8235 8218 8211 added: various gameengine improvements, fixed windows project files 2008-02-15 23:12:03 +00:00
Kent Mein
e04d7128cd This is patch [#8232] Memory leak in KX_Scene destructor fixed
Submitted By: Benoit Bolsee (ben2610)

Fixes a loop so that it removes objects properly from the scene.

Kent
2008-02-05 17:37:52 +00:00
Hamed Zaghaghi
5faa2e63a1 bugfix 8183, Ray sensor with material/property filter always triggers when hitting object without the required characteristic fixed by Benoit Blosee(ben2610), and some minor changes for 2d-filters. 2008-02-04 03:48:46 +00:00
Hamed Zaghaghi
47b53510a5 merging game_engine branch changes into trunk, 2d-filters and opengl speedup 2008-02-04 02:33:27 +00:00
Kent Mein
7b2e348d4f This is a modified version of this patch:
[#7660] Solaris 10 x86 support (Makefiles)

Hopefully it will not mess up anything for anyone else.  I removed
some hardcoded static libs and made NAN_*_LIB definitions so they could be 
overridden, to allow greater flexability.

Let me know if there are any problems/questions.

Kent
2007-12-05 16:58:52 +00:00
Hamed Zaghaghi
21eb3e11e0 2d-Filters feature and actuators. 2007-10-22 20:24:26 +00:00
Mal Duffin
51b56a4d3f GE Patch by Hamed Zaghaghi - Adding Motion Blur to the Game Engine.
I reviewed the code, suggested an update ( initialising accumulation buffer ), and tested the resulting update successfully.

It's great to see more GE developers!GE Patch by Hamed Zaghaghi to add motion blur to the GE ( using the accumulation buffer ).

I reviewed code and tested, gave some feedback ( initialising accumulation buffer ) which was implemented straight away, and re-reviewed.

It's great to have another GE coder on the team!
2007-09-29 18:51:01 +00:00
Kent Mein
4e2143f639 This commit fixes up a bunch of svn properties to hopefully make things a little nicer for everyone.
Patch provied by gsrb3d

bug tracker #7061

Kent
2007-08-28 10:07:08 +00:00
Erwin Coumans
fb622c7c3c //someone reversed axle direction conventions inside Bullet (axle winding), so need to compensate to keep game blender vehicles working the same. 2007-07-06 04:45:57 +00:00
Kent Mein
22ef0daefd This is patch #6825 (The patch missed a couple of them but
this should get it all.

recurse was spelled resurse in a couple of places.

Kent
2007-06-25 20:15:36 +00:00
Erwin Coumans
ca26aeb7b2 upgrade to latest Bullet 2.53. cross the fingers it doesn't break one of the exotic or less exotic platforms 2007-06-23 05:28:07 +00:00
Charlie Carley
92f1d59b44 Test commit... 2007-05-29 07:46:07 +00:00
Campbell Barton
afdd54fa37 moved source and text to american spelling
* colour -> color
* centre -> center
* normalise -> normalize
* modelling -> modeling
2007-04-04 13:18:41 +00:00
Charlie Carley
7fd8ba99bb Applied patch #5247 by scabootssca. This adds an instant replace mesh feature. 2007-03-26 03:35:01 +00:00
Charlie Carley
9deb69dbca Applied patch #6102 submitted by Mal 2007-03-23 02:20:12 +00:00
Charlie Carley
f56fca448a Added a guard to prevent more than one texture to be generated per image. 2007-03-08 03:00:33 +00:00
Kent Mein
6c17f1187e Patch provided by Carsten,
KX_RaySensor::Evaluate returns false when hit was detected and it was
already marked as hit.  (no change in state)

Kent
2007-02-19 21:46:57 +00:00
Charlie Carley
3947f9b885 1). Fix for cube maps in the player.
ImBuf pointer was being overridden causing the ibuf->rect to be zero.

2). Added vertex attributes for tangents in in vertex arrays.
This, probably needs the extensions enabled (glEnableVertexAttribArrayARB, glDisableVertexAttribArrayARB), but am a little
weary about enabling them right now.
2007-02-01 02:10:38 +00:00
Charlie Carley
56a4f529fd Two errors caused by previous commit;
One related to extension handling on Linux, the other is a fix for compiling with Irix and STL
2007-01-23 13:25:20 +00:00
Charlie Carley
557360224f Klockwork (http://www.klocwork.com) report; game engine fixes, related to 'Use Blender Materials'
/source/gameengine/Ketsji/BL_Material.cpp;16;18;Critical;1;
/source/gameengine/Ketsji/BL_Shader.cpp;293;30;Critical;1;
/source/gameengine/Ketsji/BL_Shader.cpp;314;30;Critical;1;
/source/gameengine/Ketsji/BL_Shader.cpp;341;30;Critical;1;
/source/gameengine/Ketsji/BL_Shader.cpp;1264;40;Critical;1;
/source/gameengine/Ketsji/BL_Shader.cpp;1194;40;Critical;1;
/source/gameengine/Ketsji/BL_Shader.cpp;916;30;Critical;1;
/source/gameengine/Ketsji/KX_BlenderMaterial.cpp;257;24;Critical;1;
/source/gameengine/Ketsji/KX_BlenderMaterial.cpp;262;24;Critical;1;
/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_GLExtensionManager.cpp;195;24;Error;3;
/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp;1209;16;Critical;1;
2007-01-21 04:45:44 +00:00
Erwin Coumans
3917b1af5f bugfix for an incompatibility with ipo actuator in play mode, thanks Malachy for the fix. 2007-01-21 00:56:10 +00:00
Charlie Carley
c4202fbd43 First commit! Small bug fix for cube map crashing in the player.
Cube maps don't display correctly in the player at the moment too.. something to do with regenerating/loading the images
2007-01-13 08:30:08 +00:00
Erwin Coumans
983fc9ab89 Bugfix from Malachy, for some IPO logic brick changes. 2007-01-10 01:16:49 +00:00
Erwin Coumans
4a70681ce2 patch by Charlie, related to recent changes of multi-uv/lightmap generation. This fix makes it possible to use lightmaps in the game engine. 2007-01-07 04:39:39 +00:00
Erwin Coumans
cf4d627897 2 bugfixes by Malachy, related to message sensor / ipo actuator firing wrongly 2007-01-07 04:35:33 +00:00
Erwin Coumans
14d60ca000 -fixes in player: draw physics debugging, only render frames when actually updated, fix with hierarchies not properly build (causing crashes) 2006-12-26 22:02:31 +00:00
Erwin Coumans
5aabafeb99 prevent crashes: some python scripts keep 'global variable' access to destroyed game objects. 2006-12-25 04:11:39 +00:00
Erwin Coumans
e820cdf6a0 fixing some issues: force needs to wake up objects, property sensor issue, island activation issue 2006-12-25 02:02:13 +00:00
Ton Roosendaal
5ffa4dd55a Warning fixes for previous Image commit, also fixed verse_image.c 2006-12-20 18:29:23 +00:00