Commit Graph

844 Commits

Author SHA1 Message Date
Campbell Barton
3f2cb6e878 game engine python api
* removed macros that were not used much, some misleading.
* removed error string setting calls that overwrote the error set by PyArg_ParseTuple with a less useful one.
* use python macros Py_RETURN_NONE, Py_RETURN_TRUE, Py_RETURN_FALSE
2008-08-14 03:23:36 +00:00
Brecht Van Lommel
d60025e95f Bugfix: in the game engine, errors in a particular python script caused
somewhat random crashes, which I think was caused by the error print
using python objects that were freed too soon. Now it frees the dictionary
after the print.
2008-08-13 10:19:47 +00:00
Campbell Barton
2345757746 raise an error when assigning properties to a game object that cant be converted. also use python apis functions for converting floats and int types (faster then PyArg_Parse) 2008-08-12 12:32:54 +00:00
Benoit Bolsee
62f9ba67c0 BGE bug #17450 fixed: When we have parented objects with no scale-applyed objects the ray hit system doesn't work properly. Fix by separating rotation and scaling in the parent inverse node to keep scaling correct down to the leaf objects. Only isotropric scaling should be used, as always with the BGE. 2008-08-08 09:57:17 +00:00
Benoit Bolsee
36ef95eff5 BGE bug #17408 fixed: Radar sensor is oriented the wrong way when the set along negative axis. Improve reliability of Radar detection by clearing the manifold cache instead of updating it. 2008-08-07 17:29:06 +00:00
Benoit Bolsee
15952fb26c BGE bug #17409 fixed: BGE Near Sensor Incorrect once inside the radius. The bug is located in Bullet: the manifold contact points for non-response objects (sensor, ghost) are not refreshed and stay in the cash as long as the objects overlap in the broad phase. Instead of fixing Bullet, I put a work around in the BGE. This may need review when a new Bullet library is integrated 2008-08-07 11:31:24 +00:00
Benoit Bolsee
3adf5dda97 BGE fix: alignToVect() fac parameter clamping should obviously be done the other way round 2008-08-07 11:25:45 +00:00
Chris Want
ba12aa0962 Getting the blenderplayer to compile/link with CMake.
Note: yuck, this is a horrible way to do it -- python devs should
think about splitting the python stuff into separate libs if they
only want to partially include it in the game engine.
2008-08-06 20:37:15 +00:00
Benoit Bolsee
8102217b9c BGE fix: confirm fix for segmentation fault by Diego and remove warning in calling ConvertMaterial Ipos. 2008-08-06 10:23:47 +00:00
Campbell Barton
553e35e36f * blenderplayer wasnt useing the scenes frame rate.
* GBE Python API's alignToVect wasnt clamping the align ammount from 0.0-1.0
* Generated images arnt animated - use for a test to see if the textures animated.
2008-08-06 04:09:10 +00:00
Campbell Barton
028d44c075 Made Mathutils its own module rather then GanmeLogic.Mathutils 2008-08-05 22:26:00 +00:00
Diego Borghetti
a86609af8e Fix segmentation faul in GE.
We assign the material name before check the pointer.

Please Benoit check this and also I have a compiler warning
about the second argument in the previous call of
ConvertMaterialIpos, the argument is NULL but the function
need a dword.
2008-08-05 21:20:14 +00:00
Benoit Bolsee
553694b614 BGE fix bug #17430: BGE Collide/Touch Sensor interfearing with other unrelated sensor states. The bug was introduced in the recent logic optimization patch. It only affects collision and touch sensors. The bug is fixed by keeping track of registration count. 2008-08-05 16:23:33 +00:00
Campbell Barton
cd1d46c61d Added GameLogic.Mathutils so Mathutils and its types can be accessed from blenderplayer.
also changed importText so it dosnt do a malloc
2008-08-05 09:35:46 +00:00
Campbell Barton
3598dcd279 * KX_GameObject.cpp - error with getMesh(), was returning None rather then an error with invalid args. also memory leak with getVectTo() if invalid args were given.
* Material.c - functions for get/setRayTransGlossSamples were not being used.
* BPY_interface.c - removed function GetName(), since everything else just uses id->name+2.
* header_info.c - added ifdef win32 around copy_game_dll since its not needed for other os's yet
2008-08-04 01:57:22 +00:00
Benoit Bolsee
ae762bec91 BGE patch #17398 approved: implementation of BGE method getVectTo(). 2008-08-03 21:59:36 +00:00
Benoit Bolsee
bf168dc3c5 Small update to get the BlenderPlayer compiling (also needed for 2.47) 2008-08-02 22:11:22 +00:00
Nathan Letwory
01b1bd4901 * another commit adding std:: to the sort call (older msvc [<9] choked?) 2008-07-30 20:45:04 +00:00
Benoit Bolsee
8a8a12ed84 BGE patch: logic optimization part 2: remove inactive sensors from logic manager.
With this patch, only sensors that are connected to 
active states are actually registered in the logic
manager. Inactive sensors won't take any CPU,
especially the Radar and Near sensors that use a
physical object for the detection: these objects
are removed from the physics engine.

To take advantage of this optimization patch, you
need to define very light idle state when the 
objects are inactive: make them transparent, suspend
the physics, keep few sensors active (e,g a message
sensor to wake up), etc.
2008-07-30 17:41:47 +00:00
Brecht Van Lommel
7f170c18bb Bugfixes: fix for two memory leaks related to dupligroups,
and a missing reference count in the trackto actuator. This
showed up as leaked pose data, but actually the whole object
was not being freed.
2008-07-30 16:15:15 +00:00
Nathan Letwory
e04c48df86 * making sure BGE compiles after brecht's big commit (r15867). Needed <algorithm> to compile with msvc. 2008-07-29 21:56:50 +00:00
Mal Duffin
ca951b3627 Am teaching a GE course this week, and am finding some small issues that I'm hoping to patch.
This one deals with the very small default clipend value ( 100.0 ) when pressing P to run the GE from a non-camera view.  ( ie if the user zooms out a bit from the default box area, the box will get clipped out of view, so it's a WFT from the user )

To see what this fixes, load up Blender default scene, go into perspective, and press P. Everything looks grand.  Now, zoom out until the box is about 10 pixels high, and press P again.  The box will disappear / be clipped out.

I've set the clip end to the maximum ( 5000 ) as defined in Camera.h.

This should be suitable for inclusion in 2.47 branch also.
2008-07-29 20:28:11 +00:00
Brecht Van Lommel
908337bee1 Game Engine: alpha blending and sorting
=======================================

Alpha blending + sorting was revised, to fix bugs and get it
to work more predictable.

* A new per texture face "Sort" setting defines if the face
  is alpha sorted or not, instead of abusing the "ZTransp"
  setting as it did before.
* Existing files are converted to hopefully match the old
  behavior as much as possible with a version patch.
* On new meshes the Sort flag is disabled by the default, to
  avoid unexpected and hard to find slowdowns.
* Alpha sorting for faces was incredibly slow. Sorting faces
  in a mesh with 600 faces lowered the framerate from 200 to
  70 fps in my test.. the sorting there case goes about 15x
  faster now, but it is still advised to use Clip Alpha if
  possible instead of regular Alpha.
* There still various limitations in the alpha sorting code,
  I've added some comments to the code about this.

Some docs at the bottom of the page:
http://www.blender.org/development/current-projects/changes-since-246/realtime-glsl-materials/

Merged some fixes from the apricot branch, most important
change is that  tangents are now exactly the same as the rest
of Blender, instead of being computed in the game engine with a
different algorithm.

Also, the subversion was bumped to 1.
2008-07-29 15:48:31 +00:00
Benoit Bolsee
b0c513e83a BGE patch: fix support of group hidden layer in dupli group instantiation: only the objects in layers matching the group layer mask will be instantiated. This is equivalent to the 3D view 2008-07-28 22:36:27 +00:00
Brecht Van Lommel
bc85f11e68 Bugfix: game engine does not support non-camera type objects as a
camera, would crash, so disabled using the object as a camera then.
2008-07-28 14:28:19 +00:00
Benoit Bolsee
c4116a7f8d BGE patch: support runtime duplication of groups. Adding an object with Dupligroup option set will cause the group to be instantiated. No special actuator is needed for this feature, just put dupligroup objects in inactive layers and add them dynamically 2008-07-26 11:00:21 +00:00
Campbell Barton
229a5809bb added exception messages to game engine matrix and vector conversions. also removed own unneeded defines in arithb.c 2008-07-25 21:14:23 +00:00
Benoit Bolsee
a7f951f25e BGE patch: approve patch #17312: Multiple material IPOs per mesh in BGE. 2008-07-25 13:45:57 +00:00
Benoit Bolsee
ab44742cf3 BGE bug fix: approve patch #17297: Track To Actuator bug fix 2008-07-25 10:52:10 +00:00
Benoit Bolsee
5eb14d70b9 BGE patch: Add PyDoc for new logic bricks, set exception message on Py error, remove args on Py functions that don't take any to save CPU time 2008-07-23 21:37:37 +00:00
Campbell Barton
dcbe9ade7a Added NodeUpdateGS so GameObject Python api alignAxisToVect function,
Otherwise the rotation isn't applied.
2008-07-23 15:45:23 +00:00
Benoit Bolsee
a18c723d55 BGE patch: Add min/max parameters to orientation constraint actuator
The min/max parameters define a minimum/maximum angle
that the object axis can have with the reference 
direction without being constrainted. The angle is 
expressed in degree and is limited to 0-180 range. 
The min/max parameters define a conical free zone
around the reference direction.

If the object axis is outside that free zone, the
actuator will tend to put it back using as a temporary
reference direction the vector that is exactly at
min or max degree of the reference direction 
(depending if the axis angle is below the minimum 
or above the maximum) and is located in the plane 
formed by the axis and the reference direction.

With a low damping value, this is equivalent to 
clamping the axis orientation within min/max degree
of the reference direction.

Backward compatibility corresponds to the absence
of free zone: min = max = 0.
2008-07-22 23:05:06 +00:00
Benoit Bolsee
1abe753bf0 BGE patch: update KX_GameObject::getChildren() to use CListValue instead of python list (allows name search keep refcount consistent) 2008-07-22 16:44:35 +00:00
Joshua Leung
32d10bca2b == Grease Pencil ==
Grease Pencil is a tool which allows you to draw freehand in some views, allowing you to annotate/scribble over the contents of that view in either 2d or 3d. This facilitates many easier communication and planning abilities.

To use, simply enable it from the View menu (choose 'Grease Pencil...' and click 'Use Grease Pencil'). Then, click+drag using the left-mouse button and the shift-key held to draw a stroke.

For more information, check the following page on the wiki:
http://wiki.blender.org/index.php/User:Aligorith/247_Grease_Pencil
2008-07-22 09:53:25 +00:00
Benoit Bolsee
4ae4ecd3ce BGE patch: Optimization of bullet adaptation layer - part 1.
First batch of optimizaton of the bullet adaptation layer in the BGE.
- remove circular motion state update.
- optimization of physic adaptation layer for bullet: bypass
  unecessary conversion of rotation matrix to quaternion and back.
- remove double updates during object replication.
2008-07-21 12:37:27 +00:00
Hamed Zaghaghi
8f17a66036 BGE 2dFilters some extra fixes 2008-07-20 23:34:17 +00:00
Hamed Zaghaghi
5350d5eb2c BGE Bug Fix:#17349, fixes some problems about 2d-filters 2008-07-20 23:03:01 +00:00
Benoit Bolsee
9f53999181 BGE patch: constraint orientation actuator did not work when damping=0. 2008-07-20 21:09:56 +00:00
Campbell Barton
e95e2fb43e GameObject functions getChildren() and getChildrenRecursive() 2008-07-20 17:18:46 +00:00
Benoit Bolsee
d725e5f78e BGE bug fix (for 2.47): setParent() fix, third part: set mass to 0 when parenting. Allow loc/scale/orientation change on child object with physic controller. 2008-07-20 15:40:03 +00:00
Campbell Barton
37c8f08f28 syntax change so GCC 4.3 will build 2008-07-19 13:04:55 +00:00
Benoit Bolsee
7e990de294 BGE bug fix (good for 2.47): remove static-static collision messages on the console since previous SetParent fix. The physical object is set to static+ghost while the object is parented. This behavior will be made optional in a future release. The DisableDynamics actuator will also make the object static except that the ghost/non-ghost flag is preserved. 2008-07-19 10:27:52 +00:00
Benoit Bolsee
9ed079bf5c BGE patch: Relink actuators with target within group when duplicating group; generalize protection against object deletion for all actuators that point to objects.
Certain actuators hold a pointer to an objects: Property,
SceneCamera, AddObject, Camera, Parent, TractTo. When a
group is duplicated, the actuators that point to objects
within the group will be relinked to point to the
replicated objects and not to the original objects.
This helps to setup self-contained group with a camera
following a character for example.
This feature also works when adding a single object
(and all its children) with the AddObject actuator.

The second part of the patch extends the protection
against object deletion to all the actuators of the above
list (previously, only the TrackTo, AddObject and
Property actuators were protected). In case the target
object of these actuators is deleted, the BGE won't
crash.
2008-07-19 07:45:19 +00:00
Benoit Bolsee
5e2ee19187 BGE patch: support for partial hierarchy in dupligroup instantiation; removal of links that point to inactive objects during group instantiation.
This situation corresponds to a group containing only a portion
of a parent hierarchy (the Apricot team needed that to avoid
logic duplication). The BGE will instantiate only the
children that are in the group so that it follows the 3D view
more closely.
As a result, the logic links to the objects in the portion of the
hierarchy that was not replicated will point to inactive objects
(if the groups are stored in inactive layers as they should be). 
To keep the logic system consistent, these links are automatically
removed.
This last part of the patch is a general fix that could go in
2.47 but as this situation does not normally occurs in pre-2.47
games, it is not needed.
2008-07-18 19:56:56 +00:00
Benoit Bolsee
a397b4b82f BGE bug fix (good for 2.47): SetParent actuator did not work on dynamic objects. Dynamics will now be disabled automatically and the object will be set ghost for the duration of the parenting; this is to avoid static interaction with the parent object. The dynamic state is restored when the parenting is removed with RemoveParent actuator. This fix also applies to setParent() and removeParent() python functions. 2008-07-18 14:40:24 +00:00
Benoit Bolsee
439e474e4e BGE patch: use the Blender convention to duplicate groups in the BGE so that the objects will be created with the location and orientation as in Blender. Note that the BGE handles scaling in a parent tree differently than Blender. To avoid discrepencies between the 3D view and the BGE, use only isotropic scaling on all your objects except the leaf objects (i.e. without children) that can have anisotropic scaling 2008-07-17 15:33:27 +00:00
Benoit Bolsee
5848fee125 BGE bug fix (good for 2.47): fix logic reconnection after replication. The old method was matching the bricks by name assuming they are unique but it is not always the case, especially with the new dupligroup feature. The new method matches the bricks by objects and position. 2008-07-17 12:29:42 +00:00
Benoit Bolsee
dbfc5f6b71 BGE patch: fix mesh deformation errors with duplicated objects sharing the same mesh in case of 1) armature+multiple material 2) shape drivers 2008-07-16 21:24:54 +00:00
Benoit Bolsee
7afacb6ea8 BGE patch: DUPLIGROUP option supported in BGE.
Blender duplicates groups in the 3D view at the location of objects having the DUPLIGROUP option set. This feature is now supported in the BGE: the groups will be instantiated as in the 3D view when the scene is converted. This is useful to populate a scene with multiple enemies without having to actually duplicate the objects in the blend file.

Notes: * The BGE applies the same criteria to instantiate the group as Blender to display them: if you see the group in the 3D view, it will be instantiated in the BGE.
       * Groups are instantiated as if the object having the DUPLIGROUP option (usually an empty) executed an AddObject actuator on the top objects of the group (objects without parent).
       * As a result, only intra-group parent relationship is supported: the BGE will not instantiate objects that have parents outside the group.
       * Intra-group logic bricks connections are preserved between the duplicated objects, even between the top objects of the group.
       * For best result, the state engine of the objects in the group should be self-contained: logic bricks should only have intra-group connections. Use messages to communicate with state engines outside the group.
       * Nested groups are supported: if one or more objects in the group have the DUPLIGROUP option set, the corresponding groups will be instantiated at the corresponding position and orientation. 
       * Nested groups are instantiated as separate groups, not as one big group.
       * Linked groups are supported as well as groups containing objects from the active layers.
       * There is a difference in the way Blender displays the groups in the 3D view and how BGE instantiates them: Blender does not take into account the parent relationship in the group and displays the objects as if they were all children of the object having the DUPLIGROUP option. That's correct for the top objects of the group but not for the children. Hence the orientation of the children objects may be different in the BGE.
       * An AddGroup actuator will be added in a future release.
2008-07-15 20:05:23 +00:00
Benoit Bolsee
e433719f51 BGE bug fix (good for 2.47): radar and near sensor did not filter correctly the collisioning objects based on ACTOR flag when the parent object was added dynamically. This could result in a very big performance decrease. 2008-07-15 18:57:10 +00:00
Kent Mein
4c48b4846e Updated so things compile. (Missing includes needed)
Kent
2008-07-15 18:12:08 +00:00
Campbell Barton
38cfe9c1a2 importing the GameLogic module was being done by adding the text "import GameLogic" to the start of all scripts used in the game engine, this meant every error line number was off by 1 (quite annoying). better to do this to the dictionary that the scripts run with. 2008-07-14 00:47:07 +00:00
Benoit Bolsee
572f1d88d2 BGE bug fix (good for 2.47): automatic detection that target object of AddObject actuator is being deleted to avoid crash (bad game design anyway) 2008-07-12 12:10:27 +00:00
Hamed Zaghaghi
a49c9c458a improvement of 2d-filter custom shader,
some bugfixes,
now you can use depth buffer and luminance buffer without any settings,
also you can use object's properties in a shader
2008-07-12 10:21:37 +00:00
Campbell Barton
310a37c29c Adding an option for action actuator - "Continue" this means animations always play from where they left off. Continue was the 2.46 operation too, so new functionality is the option to disable.
When using states, an action like kick or throw can often switch out before finishing playing the action, and there was no way to play from the start frame the second time round. (even setting the actions current frame through python doesn't work work)
2008-07-10 14:23:19 +00:00
Brecht Van Lommel
99fdf27af9 Sync with Apricot Game Engine
=============================

* Clean up and optimizations in skinned/deformed mesh code.
* Compatibility fixes and clean up in the rasterizer.
* Changes related to GLSL shadow buffers which should have no
  effect, to keep the code in sync with apricot.
2008-07-10 12:47:20 +00:00
Campbell Barton
732d886e0a bugfix, vector was not checked for zero length before normalizing, closing blender instantly with an assert. 2008-07-09 15:30:15 +00:00
Campbell Barton
60d099648c added a factor argument for aligning to vector, this isn't correct since it does linear interpolation of the vector and renormalizes.
(can be improved to rotate correctly but for our  use ist ok for now, would also be useful to have an argument to clamp the maximum rotation angle to get a constant rotation speed),

This will used to make franky upright when falling from an angle, to track to a surface when hanging onto a ledge and setting the glide pitch.
Without this rotation is instant and jerky.

currently this is done with Mathutils which isnt available in Blender Player.

def do_rotate_up(own):
	own.alignAxisToVect([0,0,1], 2, 0.1)

replaces...

def do_rotate_up(own):
	up_nor = Vector(0,0,1)
	own_mat = Matrix(*own.getOrientation()).transpose()
	own_up = up_nor * own_mat
	ang = AngleBetweenVecs(own_up, up_nor)
	if ang > 0.005:
		# Set orientation
		cross = CrossVecs(own_up, up_nor)
		new_mat = own_mat * RotationMatrix(ang*0.1, 3, 'r', cross)
		own.setOrientation(new_mat.transpose())


M    source/gameengine/Ketsji/KX_GameObject.cpp
M    source/gameengine/Ketsji/KX_GameObject.h
2008-07-09 09:21:52 +00:00
Campbell Barton
e279fc4a81 fix for crasher with touch sensor, ben you may want to look at this, should be ok since the ray sensor does NULL checks in for getNewClientInfo in a similar area. 2008-07-08 22:43:44 +00:00
Campbell Barton
bbf1ce2762 bugfix - GameEngine PyObject methods did not all return when using dir(), because inherited methods were ignored, This made it incredibly annoying, not only having to search a C++ file to see what functions were available. but looking up methods inherited from other C++ classes.
There is still no __members__ attribute so dir() wont work at all for attributes.
2008-07-08 17:57:31 +00:00
Benoit Bolsee
d1fd99b070 BGE logic patch: new "Add" mode for Ipo actuator, several corrections in state system.
New Add mode for Ipo actuator
=============================
A new Add button, mutually exclusive with Force button, is available in
the Ipo actuator. When selected, it activates the Add mode that consists
in adding the Ipo curve to the current object situation in world
coordinates, or parent coordinates if the object has a parent. Scale Ipo
curves are multiplied instead of added to the object current scale.
If the local flag is selected, the Ipo curve is added (multiplied) in 
the object's local coordinates. 
Delta Ipo curves are handled identically to normal Ipo curve and there 
is no need to work with Delta Ipo curves provided that you make sure 
that the Ipo curve starts from origin. Origin means location 0 for 
Location Ipo curve, rotation 0 for Rotation Ipo curve and scale 1 for 
Scale Ipo curve.

The "current object situation" means the object's location, rotation 
and scale at the start of the Ipo curve. For Loop Stop and Loop End Ipo 
actuators, this means at the start of each loop. This initial state is
used as a base during the execution of the Ipo Curve but when the Ipo 
curve is restarted (later or immediately in case of Loop mode), the  
object current situation at that time is used as the new base.

For reference, here is the exact operation of the Add mode for each
type of Ipo curve (oLoc, oRot, oScale, oMat: object's loc/rot/scale
and orientation matrix at the start of the curve; iLoc, iRot, iScale,
iMat: Ipo curve loc/rot/scale and orientation matrix resulting from
the rotation).

Location
  Local=false: newLoc = oLoc+iLoc
  Local=true : newLoc = oLoc+oScale*(oMat*iLoc)
Rotation
  Local=false: newMat = iMat*oMat
  Local=true : newMat = oMat*iMat
Scale
  Local=false: newScale = oScale*iScale
  Local=true : newScale = oScale*iScale

Add+Local mode is very useful to have dynamic object executing complex
movement relative to their current location/orientation. Of cource, 
dynamics should be disabled during the execution of the curve.

Several corrections in state system
===================================
- Object initial state is taken into account when adding object
  dynamically
- Fix bug with link count when adding object dynamically
- Fix false on-off detection for Actuator sensor when actuator is
  trigged on negative event.
- Fix Parent actuator false activation on negative event
- Loop Ipo curve not restarting at correct frame when start frame is
  different from one.
2008-07-08 12:18:43 +00:00
Campbell Barton
8a729824f4 GameObject rayCast and rayCastTo were not setting exception strings (causes return without exception set error)
Also made game state buttons only have a dot in states that have controllers in them.
2008-07-06 14:11:30 +00:00
Andrea Weikert
0bdfc6a953 == BUGFIX ==
- fix crash when exiting game engine (with ESC-key).
- reason for crash: std::vector iterator is invalid after vector::erase
2008-07-04 20:24:15 +00:00
Campbell Barton
107b78a3d2 Made some python game engine funcs use NOARGS, getAxisVec was using wrong multiplication order.
Use BUT_TOGDUAL for controllers init states so you can see what the init state is for any controller without using the button to check.
2008-07-04 19:00:56 +00:00
Benoit Bolsee
70d239ef7d BGE logic update: new servo control motion actuator, new distance constraint actuator, new orientation constraint actuator, new actuator sensor.
General
=======
- Removal of Damp option in motion actuator (replaced by
  Servo control motion).
- No PyDoc at present, will be added soon.

Generalization of the Lvl option
================================
A sensor with the Lvl option selected will always produce an 
event at the start of the game or when entering a state or at 
object creation. The event will be positive or negative 
depending of the sensor condition. A negative pulse makes
sense when used with a NAND controller: it will be converted
into an actuator activation.

Servo control motion
====================
A new variant of the motion actuator allows to control speed 
with force. The control if of type "PID" (Propotional, Integral, 
Derivate): the force is automatically adapted to achieve the 
target speed. All the parameters of the servo controller are
configurable. The result is a great variety of motion style: 
anysotropic friction, flying, sliding, pseudo Dloc...
This actuator should be used in preference to Dloc and LinV
as it produces more fluid movements and avoids the collision 
problem with Dloc.
LinV : target speed as (X,Y,Z) vector in local or world 
       coordinates (mostly useful in local coordinates).
Limit: the force can be limited along each axis (in the same
       coordinates of LinV). No limitation means that the force
       will grow as large as necessary to achieve the target 
       speed along that axis. Set a max value to limit the 
       accelaration along an axis (slow start) and set a min
       value (negative) to limit the brake force.
P:     Proportional coefficient of servo controller, don't set
       directly unless you know what you're doing.
I:     Integral coefficient of servo controller. Use low value
       (<0.1) for slow reaction (sliding), high values (>0.5)
       for hard control. The P coefficient will be automatically
       set to 60 times the I coefficient (a reasonable value).
D:     Derivate coefficient. Leave to 0 unless you know what
       you're doing. High values create instability. 

Notes: - This actuator works perfectly in zero friction 
         environment: the PID controller will simulate friction
         by applying force as needed.
       - This actuator is compatible with simple Drot motion
         actuator but not with LinV and Dloc motion.
       - (0,0,0) is a valid target speed.
       - All parameters are accessible through Python.

Distance constraint actuator
============================
A new variant of the constraint actuator allows to set the
distance and orientation relative to a surface. The controller
uses a ray to detect the surface (or any object) and adapt the
distance and orientation parallel to the surface.
Damp:  Time constant (in nb of frames) of distance and 
       orientation control.
Dist:  Select to enable distance control and set target 
       distance. The object will be position at the given
       distance of surface along the ray direction.
Direction: chose a local axis as the ray direction.
Range: length of ray. Objecgt within this distance will be 
       detected.
N    : Select to enable orientation control. The actuator will
       change the orientation and the location of the object 
       so that it is parallel to the surface at the vertical
       of the point of contact of the ray.  
M/P  : Select to enable material detection. Default is property
       detection.
Property/Material: name of property/material that the target of
       ray must have to be detected. If not set, property/
       material filter is disabled and any collisioning object
       within range will be detected.
PER  : Select to enable persistent operation. Normally the 
       actuator disables itself automatically if the ray does
       not reach a valid target. 
time : Maximum activation time of actuator. 
       0 : unlimited.
       >0: number of frames before automatic deactivation.  
rotDamp: Time constant (in nb of frame) of orientation control.
       0 : use Damp parameter.
       >0: use a different time constant for orientation.

Notes: - If neither N nor Dist options are set, the actuator
         does not change the position and orientation of the
         object; it works as a ray sensor.
       - The ray has no "X-ray" capability: if the first object
         hit does not have the required property/material, it
         returns no hit and the actuator disables itself unless
         PER option is enabled.
       - This actuator changes the position and orientation but
         not the speed of the object. This has an important 
         implication in a gravity environment: the gravity will
         cause the speed to increase although the object seems
         to stay still (it is repositioned at each frame).
         The gravity must be compensated in one way or another.
         the new servo control motion actuator is the simplest 
         way: set the target speed along the ray axis to 0
         and the servo control will automatically compensate 
         the gravity.
       - This actuator changes the orientation of the object 
         and will conflict with Drot motion unless it is 
         placed BEFORE the Drot motion actuator (the order of 
         actuator is important)
       - All parameters are accessible through Python.

Orientation constraint 
======================
A new variant of the constraint actuator allows to align an
object axis along a global direction.
Damp : Time constant (in nb of frames) of orientation control.
X,Y,Z: Global coordinates of reference direction. 
time : Maximum activation time of actuator. 
       0 : unlimited.
       >0: number of frames before automatic deactivation.  

Notes: - (X,Y,Z) = (0,0,0) is not a valid direction
       - This actuator changes the orientation of the object
         and will conflict with Drot motion unless it is placed
         BEFORE the Drot motion actuator (the order of 
         actuator is important).
       - This actuator doesn't change the location and speed. 
         It is compatible with gravity.
       - All parameters are accessible through Python.

Actuator sensor 
===============
This sensor detects the activation and deactivation of actuators 
of the same object. The sensor generates a positive pulse when 
the corresponding sensor is activated and a negative pulse when 
it is deactivated (the contrary if the Inv option is selected). 
This is mostly useful to chain actions and to detect the loss of 
contact of the distance motion actuator.

Notes: - Actuators are disabled at the start of the game; if you
         want to detect the On-Off transition of an actuator 
         after it has been activated at least once, unselect the
         Lvl and Inv options and use a NAND controller.
       - Some actuators deactivates themselves immediately after 
         being activated. The sensor detects this situation as 
         an On-Off transition.
       - The actuator name can be set through Python.
2008-07-04 08:14:50 +00:00
Campbell Barton
bd74679a39 small changes to py funcs that can run 100s of times a second, so python wont generate empty args tuple when they are not needed. 2008-07-04 00:30:44 +00:00
Campbell Barton
5c93e75682 non user visible changes and small optimizations to the game engine pyapi as well as fixing some bugs.
* 2 returning errors without exception set another return None instead of NULL.
* a missing check for parent relation
* BPY matrix length was incorrect in matrix.c, this change could break some scripts, however when a script expects a list of lists for a matrix, the len() function is incorrect and will give an error. This was the only thing stopping apricot game logic running in trunk.

Also added a function for GameObjects  -  getAxisVect(vec), multiplies the vector be the objects worldspace rotation matrix. Very useful if you want to know what the forward direction is for an object and dont want to use Blender.Mathutils which is tedious and not available in BlenderPlayer yet.
2008-07-04 00:05:50 +00:00
Campbell Barton
31aa43da97 Adding GameObject setLinearVelocity(), without this interacting with objects requires them to have logic bricks to apply force which doesn't work well when the character is in a seperate blend file to the levels. (its also messy to have a script & multiple motion actuators on each object you can pickup and throw).
This is also needed for removing any force that existed before suspending dynamics - In the case of franky hanging, resuming dynamics when he fell would apply the velocity he had when grabbing making dropping to the ground work unpredictably. 

Also note in pydocs that enable/disable rigidbody physics doesn't work with bullet yet.
2008-07-03 01:34:50 +00:00
Campbell Barton
b0958b6646 Checked all cases where PyArg_ParseTuple is used in blenders game engine and made sure all will raise errors when called with invalid args. 2008-07-01 16:43:46 +00:00
Campbell Barton
bc8364fef0 bugfix, ActionActuator was missing many checks for PyArg_ParseTuple failing.
This meant an error in a script could be reported in a different line or script file which makes it quite hard to trace the problem. There were also places where invalid pointers could be used because of this.
The whole game engine pyapi probably needs to have these checks added.
2008-07-01 13:21:37 +00:00
Campbell Barton
96152f8409 track to would crash (with a C++ assert) if the source and target are in the same location, which I have had happen a few times while testing. 2008-07-01 05:16:08 +00:00
Campbell Barton
6a3e8e7fff BGE python api addition, GameObject get/setState and Controller.getState()
Also added a note in the tooltip for action priority when using more then 1 action at a time.
2008-06-29 21:52:23 +00:00
Brecht Van Lommel
ab7794392e Fix for bug #7753: after game engine drawing with vertex arrays,
nurbs/curves/text dissappears.

This also removes the "vertex arrays" option and enables it always
for OpenGL version >= 1.1 - there's no need to have an option to
make things render faster disabled by default, also it should work
stable now.
2008-06-29 21:51:27 +00:00
Jean-Luc Peurière
7056d63f41 adding explicit cast to get things compiling 2008-06-29 12:25:15 +00:00
Hamed Zaghaghi
b98e53b8ac BGE , fix an compile error 2008-06-28 14:19:25 +00:00
Hamed Zaghaghi
1231a2171a BGE 2d-filter, custom shaders now can have depth texture and luminance texture 2008-06-28 03:18:11 +00:00
Campbell Barton
f0a3cbcdac patch [#15865] BGE API call to delete objects
from Dalai Felinto (dfelinto) 
renamed deleteObject to endObject() to match the user interface.
2008-06-27 11:35:55 +00:00
Campbell Barton
11cdc2a002 Python API/Game engine fixes, dosn't affect 2.47
* Action FrameProp was checking if the string was true, not that it contained any text.
* Added GameObject.getVisible() since there is already a getVisible
* Added GameObject.getPropertyNames() Needed in apricot so Franky can collect and throw items in the level without having the names defined elsewhere or modifying his game logic which is stored in a separate blend file.
2008-06-26 12:39:06 +00:00
Campbell Barton
84c4e89eba Commented out face transp changing when switching images, this is more annoying then helpful.
Edited Game engine docs to note that the matrix will need to be transposed if used with Mathutils.Matrix()
Edited "Collision" button since ray-sensor also uses collision.
2008-06-25 16:09:29 +00:00
Benoit Bolsee
c353af4d3a BGE patch 15044 approved: Edit Object Dynamics Actuator.
Add enable/disable dynamics actuator under the "Edit Object" category.
The Enable/disable rigid body option is also availale but not implemented.
2008-06-25 14:09:15 +00:00
Benoit Bolsee
820c2df12c BGE patch: Add automatic support for armature driven shape keys.
To take advantage of this feature, you must have a mesh with 
relative shape keys and shape Ipo curves with drivers referring
to bones of the mesh's parent armature. 
The BGE will automatically detect the dependency between the 
shape keys and the armature and execute the Ipo drivers during
the rendering of the armature actions.
This technique is used to make the armature action more natural: 
the shape keys compensate in places where the armature deformation 
is uggly and the drivers make sure that the shape correction
is synchronized with the bone position.

Note: This is not compatible with shape actions; BLender does 
not allow to have Shape Ipo Curves and Shape actions at the same
time.
2008-06-24 22:19:00 +00:00
Benoit Bolsee
4d478cbe86 BGE patch: remove Shape key driver code from previous commit 2008-06-24 21:39:45 +00:00
Benoit Bolsee
15c105c157 BGE patch: Add damping and clamping option to motion actuator.
This patch introduces two options for the motion actuator:

damping: number of frames to reach the target velocity. It takes
into account the startup velocityin the target velocity direction
and add 1/damping fraction of target velocity until the full 
velocity is reached. Works only with linear and angular velocity.
It will be extended to delta and force motion method in a future
release.

clamping: apply the force and torque as long as the target velocity
is not reached. If this option is set, the velocity specified 
in linV or angV are not applied to the object but used as target
velocity. You should also specify a force in force or torque field: 
the force will be applied as long as the velocity along the axis of
the vector set in linV or angV is not reached. Works best in low
friction environment.
2008-06-24 19:37:43 +00:00
Benoit Bolsee
02132de7aa BGE patch: Add NAND, NOR, XOR, XNOR controllers.
NAND controller is an inverted AND controller: the output is 
     1 if any of the input is 0.
NOR  controller is an inverted OR controller: the output is 0
     if any of the input is 1.
XOR  controller is an exclusive OR: the output is 1 if and only
     if one input is 1 and all the other inputs are 0.
XNOR controller is an inverted XOR: the output is 0 if and only
     if one input is 0 and all the other inputs are 0.
The NAND, NORT and XNOR controllers are very usefull to create
complementary outputs to start and stop actuators synchronously.
MSCV project files updated.
2008-06-23 20:41:18 +00:00
Benoit Bolsee
67c0b32375 BGE patch: Add level option on sensor and fix sensor reset.
Level option is now available on all sensors but is only implemented on 
mouse and keyboard sensors. The purpose of that option is to make
the sensor react on level rather than edge by default. It's only
applicable to state engine system when there is a state transition:
the sensor will generate a pulse if the condition is met from the
start of the state. Normally, the keyboard sensor generate a pulse
only when the key is pressed and not when the key is already pressed.
This patch allows to select this behavior.
The second part of the patch corrects the reset method for sensors
with inverted output.
2008-06-23 20:26:48 +00:00
Benoit Bolsee
75e22a1917 BGE patch #14386: Action Actuator Current Frame Prop. This patch is very usefull for action feedback logic: a sensor on the property can be used to detect a certain moment in the action and trigger more stuff. The property must be on float type for best results 2008-06-23 15:32:44 +00:00
Benoit Bolsee
5372def2b0 BGE patch: add state engine support in the logic bricks.
This patch introduces a simple state engine system with the logic bricks. This system features full
backward compatibility, multiple active states, multiple state transitions, automatic disabling of 
sensor and actuators, full GUI support and selective display of sensors and actuators. 
Note: Python API is available but not documented yet. It will be added asap.

State internals
===============
The state system is object based. The current state mask is stored in the object as a 32 bit value; 
each bit set in the mask is an active state. The controllers have a state mask too but only one bit
can be set: a controller belongs to a single state. The game engine will only execute controllers 
that belong to active states. Sensors and actuators don't have a state mask but are effectively 
attached to states via their links to the controllers. Sensors and actuators can be connected to more
than one state. When a controller becomes inactive because of a state change, its links to sensors 
and actuators are temporarily broken (until the state becomes active again). If an actuator gets isolated, 
i.e all the links to controllers are broken, it is automatically disabled. If a sensor gets isolated, 
the game engine will stop calling it to save CPU. It will also reset the sensor internal state so that
it can react as if the game just started when it gets reconnected to an active controller. For example,
an Always sensor in no pulse mode that is connected to a single state (i.e connected to one or more 
controllers of a single state) will generate a pulse each time the state becomes active. This feature is 
not available on all sensors, see the notes below.

GUI
===
This system system is fully configurable through the GUI: the object state mask is visible under the
object bar in the controller's colum as an array of buttons just like the 3D view layer mask.
Click on a state bit to only display the controllers of that state. You can select more than one state
with SHIFT-click. The All button sets all the bits so that you can see all the controllers of the object. 
The Ini button sets the state mask back to the object default state. You can change the default state 
of object by first selecting the desired state mask and storing using the menu under the State button. 
If you define a default state mask, it will be loaded into the object state make when you load the blend
file or when you run the game under the blenderplayer. However, when you run the game under Blender, 
the current selected state mask will be used as the startup state for the object. This allows you to test
specific state during the game design.

The controller display the state they belong to with a new button in the controller header. When you add
a new controller, it is added by default in the lowest enabled state. You can change the controller state 
by clicking on the button and selecting another state. If more than one state is enabled in the object
state mask, controllers are grouped by state for more readibility. 

The new Sta button in the sensor and actuator column header allows you to display only the sensors and 
actuators that are linked to visible controllers.

A new state actuator is available to modify the state during the game. It defines a bit mask and 
the operation to apply on the current object state mask:

Cpy: the bit mask is copied to the object state mask.
Add: the bits that set in the bit mask will be turned on in the object state mask.
Sub: the bits that set in the bit mask will be turned off in the object state mask.
Inv: the bits that set in the bit mask will be inverted in the objecyy state mask.

Notes
=====
- Although states have no name, a simply convention consists in using the name of the first controller 
  of the state as the state name. The GUI will support that convention by displaying as a hint the name
  of the first controller of the state when you move the mouse over a state bit of the object state mask
  or of the state actuator bit mask.
- Each object has a state mask and each object can have a state engine but if several objects are 
  part of a logical group, it is recommended to put the state engine only in the main object and to
  link the controllers of that object to the sensors and actuators of the different objects.
- When loading an old blend file, the state mask of all objects and controllers are initialized to 1 
  so that all the controllers belong to this single state. This ensures backward compatibility with 
  existing game.
- When the state actuator is activated at the same time as other actuators, these actuators are 
  guaranteed to execute before being eventually disabled due to the state change. This is useful for
  example to send a message or update a property at the time of changing the state.
- Sensors that depend on underlying resource won't reset fully when they are isolated. By the time they
  are acticated again, they will behave as follow:
  * keyboard sensor: keys already pressed won't be detected. The keyboard sensor is only sensitive 
    to new key press.
  * collision sensor: objects already colliding won't be detected. Only new collisions are 
    detected.
  * near and radar sensor: same as collision sensor.
2008-06-22 14:23:57 +00:00
Campbell Barton
a1e78a0cca * Documented that get/setOrientation use an inverted rotation matrix
* OB prefix is needed when specifying the object for the Message Actuator, this is very bad since other object fields in the BGE dont need this prefix - a real fix would need do_versions to keep old files running.
* RotationMatrix was all nans if the rotation vector axis was 0,0,0, Changed so in this case just return a matrix that doesn't rotate anything,

spent some angry hours to find these issues, maybe this will save others the hassle ;)
2008-06-20 20:54:29 +00:00
Benoit Bolsee
de7619991c BGE bug fix for new shape action: mesh with multiple materials did not deform properly 2008-06-19 14:40:46 +00:00
Benoit Bolsee
df8a3882c6 BGE patch #13625: getLinearVelocity() rewrite to use only vector and matrix operations 2008-06-18 21:22:17 +00:00
Brecht Van Lommel
3f488f4d70 * Fix for a crash in game engine vertex array drawing with texfaces.
* For 2D filters, don't require opengl 2.0 but just the extensions,
  so it works on computers without full 2.0 support too.
* In debug mode, don't print memory statistics for preview render.
2008-06-18 10:30:14 +00:00
Jiri Hnidek
5cd4b6ac90 Small fix to be able to compile Blender. 2008-06-18 09:52:31 +00:00
Campbell Barton
d39154bb50 bugfix, BGE, use vec.safe_normalized() rather then vec.normalized() because in some cases the ray_cast sensor could crash blender. 2008-06-18 09:06:51 +00:00
Benoit Bolsee
48c7c9d957 Forgot to set Id property on new shape action files 2008-06-18 07:03:47 +00:00
Benoit Bolsee
2bece8dcb5 BGE Patch: Add Shape Action support and update MSCV_7 project file for glew.
Shape Action are now supported in the BGE. A new type of actuator "Shape Action" is available on mesh objects. It can be combined with Action actuator on parent armature. Only relative keys are supported. All the usual action options are available: type, blending, priority, Python API. Only actions with shape channels should be specified of course, otherwise the actuator has no effect. Shape action will still work after a mesh replacement provided that the new mesh has compatible shape keys.
2008-06-18 06:46:49 +00:00
Brecht Van Lommel
272a91f754 Merge of apricot branch game engine changes into trunk, excluding GLSL.
GLEW
====

Added the GLEW opengl extension library into extern/, always compiled
into Blender now. This is much nicer than doing this kind of extension
management manually, and will be used in the game engine, for GLSL, and
other opengl extensions.

* According to the GLEW website it works on Windows, Linux, Mac OS X,
  FreeBSD, Irix, and Solaris. There might still be platform specific
  issues due to this commit, so let me know and I'll look into it.
* This means also that all extensions will now always be compiled in,
  regardless of the glext.h on the platform where compilation happens.

Game Engine
===========

Refactoring of the use of opengl extensions and other drawing code
in the game engine, and cleaning up some hacks related to GLSL
integration. These changes will be merged into trunk too after this.

The game engine graphics demos & apricot level survived my tests,
but this could use some good testing of course.

For users: please test with the options "Generate Display Lists" and
"Vertex Arrays" enabled, these should be the fastest and are supposed
to be "unreliable", but if that's the case that's probably due to bugs
that can be fixed.

* The game engine now also uses GLEW for extensions, replacing the
  custom opengl extensions code that was there. Removes a lot of
  #ifdef's, but the runtime checks stay of course.
* Removed the WITHOUT_GLEXT environment variable. This was added to
  work around a specific bug and only disabled multitexturing anyway.
  It might also have caused a slowdown since it was retrieving the
  environment variable for every vertex in immediate mode (bug #13680).

* Refactored the code to allow drawing skinned meshes with vertex
  arrays too, removing some specific immediate mode drawing functions
  for this that only did extra normal calculation. Now it always splits
  vertices of flat faces instead.
* Refactored normal recalculation with some minor optimizations,
  required for the above change.
* Removed some outdated code behind the __NLA_OLDDEFORM #ifdef.
* Fixed various bugs in setting of multitexture coordinates and vertex
  attributes for vertex arrays. These were not being enabled/disabled
  correct according to the opengl spec, leading to crashes. Also tangent
  attributes used an immediate mode call for vertex arrays, which can't
  work.
* Fixed use of uninitialized variable in RAS_TexVert.
* Exporting skinned meshes was doing O(n^2) lookups for vertices and
  deform weights, now uses same trick as regular meshes.
2008-06-17 10:27:34 +00:00
Campbell Barton
c9d1924ea5 Use the scenes framerate for ipo and action framerate in the game engine, was hard coded to 25. 2008-06-17 10:06:38 +00:00
Campbell Barton
9b69c56917 Material color was always overriding OBCOL for blender text. 2008-06-16 09:16:04 +00:00
Campbell Barton
f63b70635c bugfix, clip alpha wasn't working in the GE, not happy with these functions, they probably need bigger changes not to assume all alpha requires face sorting with a disabled depth buffer, 2008-06-15 09:43:24 +00:00
Benoit Bolsee
89c1875bc9 BGE patch: support Set Scene in BGE. Linked Set Scene should have no name conflict in Object, Object data and Action of the main scene to avoid confusion in Python scripting. Nested Set Scene are supported. You will need Python scripting to create cross references between objects in the main scene and the Set (e.g TrackTo actuator) 2008-06-14 20:42:15 +00:00
Campbell Barton
fc7a83b458 Added access for adjusting timeOffset value at runtime, used for apricot (Franky climbing walls) 2008-06-14 17:12:49 +00:00
Campbell Barton
8bd82d4e36 Some pose action ipo corruptions when using BGE, added some debug printf's when copying to/from the same pose since it should never happen. 2008-06-13 02:20:09 +00:00
Campbell Barton
192037960d error in variable name, not sure how this even compiled 2008-06-09 22:54:56 +00:00
Campbell Barton
f39758cddc adding clip alpha (binary alpha) to the 3D view and game engine. 2008-06-09 15:45:46 +00:00
Joshua Leung
71573cbd55 Bugfix #13666:
Missing #include <stdio.h> in source/gameengine/Ketsji/KX_RayCast.cpp
2008-06-08 10:48:37 +00:00
Hamed Zaghaghi
6ffadbfb10 fix 2dfilter problem on AMD64, Patches item #13626 2008-06-06 01:28:51 +00:00
Kent Mein
fbb56ee997 Issue jms was having with # else on msvc. Seems odd but easy to fix.
Kent
2008-06-04 18:11:48 +00:00
Hamed Zaghaghi
d565e8a02f bugfix #13618 - 2d filters + GLSL python scripts 2008-06-04 02:54:42 +00:00
Benoit Bolsee
772d241582 Fix BGE bug #13605: GameEngine corrupts Pose data 2008-06-03 22:54:24 +00:00
Benoit Bolsee
1cc61f633f Patch #11000 approved: [new function] KX_GameObject::alignAxisToVect() Align an object's axis to a given vector 2008-06-02 17:31:05 +00:00
Benoit Bolsee
da1f38f99d Apply BGE patch 11137: Render objects with negative scaling correctly (as in Blender) 2008-05-25 14:37:39 +00:00
Benoit Bolsee
e2a9590a15 BGE patch: rename rayCastToEx() to rayCast() - better name 2008-05-24 22:50:31 +00:00
Benoit Bolsee
cc6dac8c42 BGE patch: add rayCastToEx(), an extended version of rayCastTo() for use in game script 2008-05-24 18:06:58 +00:00
Benoit Bolsee
7f10f5f66f fix BGE bug #8646: unusable anaglyph settings
The best rules for stereo rendering are now applied to Blender. Here is the new situation:
1) The focal distance is now settable through the GUI: select the camera (each camera can have a different setting) and go to the camera data (F9): the "Dof Dist" and "Dof Ob" can be used to set the focal distance for that camera. The "Dof Ob" is interesting because it sets the focal distance so that the center this object will appear at the surface of the screen when running the game.
2) The eye separation is automatically set to focal_distance/30, which is considered to be a reasonable value. If you need a different value, you can always use Python scripting. 

Notes: 
- If you switch camera during the game, the focal distance will also change unless you have set the focal distance by scripting, in which case it overwrites the focal distance setting of all cameras.
- If you don't set the focal distance in the camera data or by scripting, the default value will be used. The default value corresponds more of less to the near clipping plane which means that all the objects will be very far with little 3D effect.
- If you don't set the eye separation by scripting, it is automatically computed as focal_distance/30, regardless on how the focal distance was set.
2008-05-24 08:34:04 +00:00
Campbell Barton
92c9ae280c replacing epydoc generation script with one copied from bpy docs 2008-05-20 05:55:12 +00:00
Benoit Bolsee
a6a4b78417 Fix BGE bug #7532: TrackTo Actuator does not work correctly if it has a Vertex Parent. This is only a partial fix: the user must put the parent vertex at the center of the parent object and disable the physics on the tracking object (use empty or collision free object). 2008-05-14 20:22:57 +00:00
Campbell Barton
ac71783e8d last commit had a typo, also adjusted teh and colour instances 2008-05-12 21:12:10 +00:00
Benoit Bolsee
96486b356f fix BGE bug #8668: Behavior of os.getcwd() is not consistent between operating systems
Add a function GameLogic.expandPath() that works like Blender.sys.expandpath() and is also available in the BlenderPlayer.
Fix the game actuator in the BlenderPlayer to work like in Blender: 
- try first to load the .blend from the current working directory
- if not found, try to load from the startup .blend or runtime base directory
2008-05-11 18:45:30 +00:00
Kent Mein
106974a9d2 Fixing up the webplugin defines for the Makefiles.
Now you can do one of the following to disable it:
export NAN_NO_PLUGIN=true
export WITH_BF_WEBPLUGIN=false

or
export WITH_BF_WEBPLUGIN=true to enable building it.
(Its set to false by default)

Kent
2008-05-08 18:38:21 +00:00
Benoit Bolsee
44cdc480de Fix BGE bug #6054: Camera actuator crashes Blender. The crash occurs when min,max << height (bad practice anyway). 2008-05-07 22:32:45 +00:00
Benoit Bolsee
881802d8a3 BGE patch #10492 approved: getLinearVelocity() now can provide local velocity as well. This patch is harmless and backward compatible; it can go safely into 2.46 release 2008-05-06 20:55:55 +00:00
Kent Mein
3ba9069c04 Fixes Makefiles for mac_compat_glext.h by updating some include paths.
Kent
2008-05-06 09:43:28 +00:00
Kent Mein
b36fe51c7d Fixed some indentation, I stumbled across (spaces vs tabs)
and also removed return 0 from a void stub.

Kent
2008-05-05 17:29:11 +00:00
Benoit Bolsee
cf654b44b6 Fix BGE bug in patch #8724 (memory optimization): serious problem with alpha texture when Use Blender Material is active and several objects have same texture. This bug messes up greatly with OpenGL texture. The GE is not usable without this fix. 2008-05-04 21:14:38 +00:00
Campbell Barton
6c05a92fe1 missed out on some BLI_convertstringcode's, also found that playing relative quicktime paths from the python api never worked, was using the 'Scene' type cast to a char. 2008-05-04 15:02:48 +00:00
Ken Hughes
7aa6833499 More compiler fixes for BLI_convertstringcode calls 2008-05-04 14:14:09 +00:00
Joshua Leung
e6be454787 More compiler fixes for BLI_convertstringcode calls 2008-05-04 11:09:30 +00:00
Benoit Bolsee
e7a106625c BGE bug fix: set parent actuator change the orientation of object 2008-05-02 17:22:28 +00:00
Benoit Bolsee
f0a41d9d97 Partially revert BGE bug fix #8863: don't send keyboard sensor positive pulse on level, this would badly interfere with keyboard sensors controlling set scene/restart scene actuators. Only send negative pulse on level to stop actuators after scene suspend 2008-05-02 15:47:08 +00:00
Benoit Bolsee
d99ddc5cf8 Fix BGE bug #8863: Keyboard Sensor does not send negative pulse if key released while scene suspended. The fix covers keyboard and mouse sensor 2008-05-01 20:43:18 +00:00
Benoit Bolsee
31adad5b4d Fix BGE bug: dynamic-but-not-rigid objects are added as rigid body during the game. 2008-05-01 16:00:59 +00:00
Benoit Bolsee
eef2b7e125 Complement to bug fix #8869: crash with alpha mesh 2008-05-01 12:35:21 +00:00
Benoit Bolsee
3a430c33d2 fix BGE bug #8869: Added objects are not lit correctly
The current layer information is now stored in KX_GameObject and inherited from the parent object when dynamically added. This information is used during the rendering the select the lamps. As the selected lamps are always coming from active layers, their position and orientation are correct.
2008-04-30 19:58:44 +00:00
Jean-Luc Peurière
b6a6507ddf getting ARB shaders working again in GE.
This is is a kludge, and only to get a release
working. later solution is to use glew
2008-04-29 16:22:13 +00:00
Benoit Bolsee
2740bbc89c Update MSVC project files to support ffmpeg. Make sure you do svn update in lib/windows to link with latest ffmpeg libraries 2008-04-27 15:02:37 +00:00
Benoit Bolsee
bc059cb8b2 BGE bug: crash when an object being tracked-to is deleted (bad practice anyway). Fix by creating a generic cross reference between actuators (only TrackTo uses it at the moment) and objects so that the actuator is informed when the target object is deleted 2008-04-26 20:41:25 +00:00
Benoit Bolsee
9b9359120f BGE bug: fix a crash at game exit caused by inconsistent controller map after object deletion. The bug became apparent since the memory leaks have been fixed. 2008-04-24 21:26:39 +00:00
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
9098de4479 second attempt to fix compilation problem with 2D shaders on systems without GLExt or without shader support: use GL_ARB_shader_objects to conditionally compile the 2D shader code 2008-04-20 21:01:13 +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
Benoit Bolsee
35e655cd5a BGE: Fix restitution: object will now bounce according to material restitution setting 2008-04-16 18:47:36 +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
Campbell Barton
83c5401896 replace magic numbers with constants for (G.vd->persp), view naming was also using persp as a flag which worked but isnt correct. 2008-04-16 08:48:49 +00:00
Benoit Bolsee
6bb327badc BGE fix: keep reference count consist on source object when replicating property copy actuator 2008-04-14 22:45:28 +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
dfd7387641 fix BGE bug #8880: blenderplayer closing when esc is pressed
ESC now quits the game by default in all modes unless a keyboard sensor is set on ESC. 
In this case, the game designer must arrange for an alternative way to quit the game.
2008-04-12 21:18:58 +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
539ff57015 fix BGE bug #8813: new rayCastTo() function hits near sensor collision box 2008-04-10 20:17:12 +00:00
Benoit Bolsee
34771ef405 add KX_GameObject::rayCastTo() PyDoc 2008-04-06 20:02:41 +00:00
Benoit Bolsee
88ce1c0638 Removed my own patch #8208: export SCA_ISensor::Evaluate() to Python. It was only useful for the ray sensor and the new rayCastTo() function provides better functionality 2008-04-06 19:14:04 +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
Benoit Bolsee
cc33fcfe7b Commit patch #2439: Mesh replacement in BGE will react properly to armature deform
Changing the mesh of an object that has a deform controller (armature) is now properly handled. The new mesh must have vertex groups matching the armature bones. In simple terms, the new mesh must deform correctly when you assign it to the object in Blender and you test the action. It will deform the same when you replace the object mesh during the game.
2008-04-05 13:33:08 +00:00
Benoit Bolsee
1bdc909555 BGE bug [#4839] fixed: joystick keeps working after an overlay scene is removed 2008-04-04 20:39:31 +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
51ea7645e2 Fix BGE bug: BGE will crash if objects with display debug property is deleted (bad practice anyway). The actual deletion is now postponed until end of scene 2008-04-01 20:46:20 +00:00
Andrea Weikert
d9de141077 == bugfix ==
fix for [#6950] Blender crashes when .blog file top line is 160 characters or more
- made sure BLI_convertstringcode doesn't return more than 240 chars 
- went through all callers and fixed places where string passed to BLI_convertstringcode was too short
- TODO: look into increasing sample->name and sound->name too, I prevented crashes, but filename might get shortened.
2008-03-30 16:18:01 +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
6615f8b74f BGE correction: AddRef() on source object of property actuator to protect against crash if the source object is deleted (bad game design anyway) 2008-03-22 14:47:42 +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
b1ef25663a BGE crash when using angV & linV actuator on static objects
The error was causing by the KINEMATIC flag not set automatically when the linear or angular velocity was set on static objects. Note that these actuators still won't work on static objects: the crash is fixed but not the actuator; linV and angV only work on dynamic objects. Fixing the linV and angV actuators on static object requires a bit more reflexion. For the time being, use dRot and dLoc on static objects.
Cleaned the code a bit: added systematic check on the physic controller presence before taking action.
2008-03-10 21:30:35 +00:00
Benoit Bolsee
1f0ae739cb BGE memleak fix: OpenGL Display Lists not deleted when switching scene
This fix also improves performance of Display List for replica objects: Display List ID caching is now enabled for replica objects which avoids a tree search on each frame and for each replica.
2008-03-09 22:02:32 +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
ce7a21047f BGE memleak fixed: game actuator does not release file buffer 2008-03-09 21:37:01 +00:00
Nathan Letwory
cc2b922d01 * to be able to properly compile this, the friend needs 'class' too: friend class CcdOverlapFilterCallBack 2008-03-02 09:39:14 +00:00
Benoit Bolsee
0db0f5734d Various mem leaks related to CValue reference count fixed 2008-03-01 19:46:50 +00:00
Benoit Bolsee
44314581dc Mem leak fixed in sound buffer & parent invert node 2008-03-01 19:29:01 +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
8d81e154f6 random sensor fixed (patch 8414) 2008-03-01 18:46:23 +00:00
Nathan Letwory
012f0a336c === PyNodes ===
* Make PyNodes work with threaded renderer. This patch is by Willian. He has worked hard on getting this sorted out - now you should be able to render with PyNodes AND multiple threads.
2008-02-23 12:05:28 +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
Campbell Barton
bc9848f7e6 Added a global string to be used for the tempdir. since the user preference is not loaded in background mode and the user preference is not validated and has no fallback.
'btempdir' is set with BLI_where_is_temp() - This tries to use U.tempdir but falls back to $TEMP or /tmp/
2008-02-13 13:55:22 +00:00
Nathan Letwory
f6dcb28560 * remove constness. 2008-02-10 20:41:59 +00:00
Nathan Letwory
8a91b29b0f * make some explicit casts to make some compilers happy 2008-02-10 20:00:25 +00:00
Joshua Leung
33f3f85235 Reverting some other changes zaghaghi made 2008-02-05 21:09:38 +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
Kent Mein
fd7c729bd1 This is patch: [#8216] Make blender compile with gcc 4.3
minus one small include file that was commented out, I'm not
sure why it was commented out but I'm pretty sure its needed.
If there are still problems later we can sort it out, everything
else is pretty simple.

Kent
2008-02-04 21:52:03 +00:00
Kent Mein
43bfcd70a3 Added missing include dir so it builds again.
Kent
2008-02-04 15:52:47 +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
Ton Roosendaal
86f3b640ec Blender interface code in Game Engine, who would that have thought!
(this fixes compile error in GE)
2007-11-28 13:33:59 +00:00
Brecht Van Lommel
6d5396fc65 Fix for multimodifier commit breaking game engine compile. 2007-11-17 21:12:25 +00:00
Hamed Zaghaghi
bf4d79c47b Patch [#7743] Enable display lists when vertex arrays are enabled, by Ovidiu Sabou.
this patch enable GE two use both vertex array and display lists. and speed up the engine a little, by the way thanks ovidiu.
2007-11-06 18:39:16 +00:00
Hamed Zaghaghi
af169b41fd 2d Filters updated, now you can use custom filter and write your own GLSL shader program to filter rendering result. 2007-11-06 12:16:12 +00:00
Kent Mein
86278584f3 Tweaks I needed to get blender compiling on my new macbook running leopard.
Kent
2007-11-05 17:27:11 +00:00
Hamed Zaghaghi
aa774427f6 GE Patch(#7684) by Ovidiu Sabou, Speedup patch for GE in OpenGL Display Lists. 2007-11-04 05:31:20 +00:00
Hamed Zaghaghi
ef9ead78f2 GE Patch(#7684) by Ovidiu Sabou, Speedup patch for GE in OpenGL Display Lists. 2007-10-29 19:41:25 +00:00
Hamed Zaghaghi
21eb3e11e0 2d-Filters feature and actuators. 2007-10-22 20:24:26 +00:00
Peter Schlaile
a0390e5cc3 == Core ==
This adds fractional FPS support to blender and should finally
make NTSC work correctly.

NTSC has an FPS of 30.0/1.001 which is approximately 29.97 FPS.
Therefore, it is not enough to simply make frs_sec a float, since
you can't represent this accurately enough. 
I added a seperate variable frs_sec_base and FPS is now 
frs_sec / frs_sec_base.

I changed all the places, where frs_sec was used to my best knowledge.

For convenience sake, I added several macros, that should make life
easier in the future:

FRA2TIME(a) : convert frame number to a double precision time in seconds
TIME2FRA(a) : the same in the opposite direction
FPS         : return current FPS as a double precision number 
              (last resort)

This closes bug #6715 
Standard framerates not supported / breaks sync -- 23.967 29.967 etc.

https://projects.blender.org/tracker/?func=detail&aid=6715&group_id=9&atid=125

Please give this heavy testing with NTSC files, quicktime in/export
and the python interface.
Errors are most probably only spotted on longer timelines, so that is
also important.

The patch was tested by Troy Sobotka and me, so it most probably should
work out of the box, but wider testing is important, since errors are
very subtle.

Enjoy!
2007-10-21 15:42:08 +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
Diego Borghetti
457824e437 Fix insert_vert_icu, missing the new "fast" argument. 2007-09-18 14:01:33 +00:00
Kent Mein
ed47851517 Updated calls to insert_vert_ipo to be
insert_vert_icu since insert_vert_ipo no longer exists.

Kent
2007-09-17 15:32:10 +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
Kent Mein
38ec778cb7 This should fix up saving a blender runtime.
If you look at the log, the last change to this file I was trying to fix
game engine bug #6667.  In so doing I added a print usage if you do not
pass any arguments to the gameplayer.

Things should work better now.

Kent
2007-08-07 16:34:45 +00:00
Brecht Van Lommel
ddbd9182d4 Forgot to commit file in the game engine. 2007-07-28 21:35:32 +00:00
Campbell Barton
a114f8f17a was missing header 2007-07-19 14:28:57 +00:00
Campbell Barton
b903864aa5 removing duplicate constants 2007-07-19 12:29:28 +00:00
Erwin Coumans
3792ae1560 bugfixes for generic (experimental) Bullet rigidbody constraint: use cone-twist instead (needs a few more minor fixes)
Note: Visual Studio projectfiles and other buildsystems need to add extern/bullet2/src/BulletDynamics/ConstraintSolver/btConeTwistConstraint.cpp to the project!
2007-07-16 05:56:51 +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
470dda4a21 This is a fix for game engine bug #6667
http://projects.blender.org/tracker/index.php?func=detail&aid=6667&group_id=9&atid=306

I moved some of the X11 initation code down a little bit so that
if you run gameplayer with no args or gameplayer -h 
it will not crash even if you do not have X11 present.
(All it does is print usage)

Kent
2007-06-27 15:08:31 +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
Erwin Coumans
14ad8c9941 preparation to upgrade to Bullet 2.53 2007-06-23 05:02:31 +00:00
Erwin Coumans
5c8d1352ea bugfix: adding static objects will 'replace' previously added static object in game engine. need to use new motion state. 2007-06-23 04:49:17 +00:00
Charlie Carley
a9640819ff Applied patch [#5795] Parent to bone - Supplied by Monster. 2007-05-31 20:40:59 +00:00
Charlie Carley
92f1d59b44 Test commit... 2007-05-29 07:46:07 +00:00
Ton Roosendaal
fbbc038cb6 Fix provided by Mal:
- 3D Window, textured drawmode shows lighted again for non-textured faces
- Engine: faces show lighted again when 3d windows was Solid draw mode

Example:
http://www.candointeractive.com/blender/BlenderViewport.jpg
2007-05-20 15:55:49 +00:00
Jean-Luc Peurière
c0dcbacd4b post release update of the scons build system for os x powerpc
assume os x 10.4 as defaut
2007-05-19 22:57:28 +00:00
Erwin Coumans
d814e2b9c6 two minor changes, hopefully before release:
- reset randseed, which should make simulations more predictable
- re-activate substeps (for more accurate simulations)
2007-05-07 17:10:44 +00:00
Campbell Barton
99135b0674 dont use tface hide or select anymore, since maintaining 2 sets of hide/select data for each face is annoying.
using mface->flag for both.

Also found that the cdDM_drawMappedFaces and cdDM_drawFacesTex_common could get normals mixed up when rendering hidden faces. because hidden/invisible faces used continue without advancing to the next normal.
2007-04-29 13:39:46 +00:00
Nathan Letwory
7afd05d2ea * spelling commit by ideasman did accidental rename of one var, but not properly :) 2007-04-04 14:25:10 +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
Kent Mein
3ac0c09d15 This commit does a couple of things to the Makefiles.
The first is it adds libIlmThread.a to the OpenEXR libs.

The second thing it does, is make it possible to define what TARGETS
you want to build inside of your user-def.mk file.  This simplifies
source/Makefile quite a bit.  I made each platform have the same
defaults (build dynamic blender, gameengine and gameplayer)  I think
most platforms should be building this combo anyway and if you need to
change it its trivial so no need to have different defaults for each platform.
The new defines are as follows with their default settings in:
         source/nan_definitions.mk

    export WITH_BF_DYNAMICOPENGL ?= true
    export WITH_BF_STATICOPENGL ?= false
    export WITH_BF_GAMEENGINE ?= true
    export WITH_BF_GAMEPLAYER ?= true
    export WITH_BF_WEBPLUGIN ?= false

Let me know if you have any problems with it.

Kent
2007-03-27 15:42:27 +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
Hans Lambermont
55cde4276b Finally commit a workaround for the Python>2.3 and FreeBSD>5.0 problem.
See http://projects.blender.org/pipermail/bf-committers/2005-April/010506.html
and projects.blender.org/pipermail/bf-committers/2006-December/017035.html

A workaround was proposed by Kester Maddock
http://projects.blender.org/pipermail/bf-committers/2005-April/010510.html
and recently again, independently by Andreas Kasparz (no URL, private email)

See also http://svn.python.org/projects/python/tags/r24c1/Include/pyport.h,
starting line 430 : "On 4.4BSD-descendants, ctype functions serves the
whole range of wchar_t character set rather than single byte code points
only. This characteristic can break some operations of string object..."
2007-02-18 21:03:23 +00:00
Charlie Carley
abc2a4ca44 Left out the case where MTFace can be null. 2007-02-05 08:07:55 +00:00
Charlie Carley
2afea953e3 Bug fix for TF_BMFONT faces. Colors on the material were backwards when rendered. 2007-02-05 05:48:09 +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
Erwin Coumans
00e956477e fix crash in constraint conversion, fix reference frame transformations for generic 6dof constraint 2007-01-19 03:14:51 +00:00
Charlie Carley
cc041b114b Add a break, to get the bumpmap demo running again! 2007-01-13 09:00:17 +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
Tom Musgrove
4a1a766a16 = game engine fixes=
two fixes to the GE by Charlie
2007-01-08 04:22:23 +00:00
Erwin Coumans
f4ee0f4b4c fixes in rigidbody constraints rigidbody -> IPO baking:
copy system with rigidbody constraint will link new constraints to new objects (instead of old)
fps from blender will be used when baking (left shift/ctrl/alt + P)
2007-01-07 04:54:29 +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
ea71aeb254 fix, static objects were not dynamically added at the right position. 2007-01-05 02:31:34 +00:00
Erwin Coumans
76b6a6611c normalize hitnormal 2006-12-26 23:03:36 +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
Brecht Van Lommel
18e81ecafa Bugfix: UV texture layer without vertex color layer did not display correct
in the game engine.
2006-12-22 08:23:25 +00:00
Ton Roosendaal
496410a255 GamePlayer: now uses new Image API calls too, so it compiles. 2006-12-20 19:29:37 +00:00
Ton Roosendaal
5ffa4dd55a Warning fixes for previous Image commit, also fixed verse_image.c 2006-12-20 18:29:23 +00:00
Erwin Coumans
1852d1a410 Enable 'show physics visualization' in the Game Menu. Should help to locate problems with collision detection/physics (also useful when baking, and/or using the new rigidbody constraints). 2006-12-20 06:43:43 +00:00