The actual character motion actuator triggers every frame the jump method.
Adding an edge detection to trigger the jump method.
Reviewers: lordloki, sybren, moguri
Reviewed By: moguri
Differential Revision: https://developer.blender.org/D1220
Most of this patch was created by Daniel Stokes, I'm mostly just cleaning
it up and testing it. Still todo: hardness. I need to figure out how to
handle the integer -> float conversion on a dynamic uniform.
Reviewers: psy-fi, brecht
Reviewed By: psy-fi
Subscribers: psy-fi
Differential Revision: https://developer.blender.org/D511
Currently we can't update the physics mesh of an added rigid body.
The cause is that that we need to update all shapes to say that the mesh was changed, for static object we don't do that previously because we use a odd way to reallocate memory at the same place.
So now when a mesh is changed we iterate all physics controllers which use the same shape info and recreate its shape with the correct mesh.
example file : {F168100}
Reviewers: scorpion81, sergof, hg1, sybren, moguri, agoose77
Reviewed By: moguri, agoose77
Subscribers: sybren
Differential Revision: https://developer.blender.org/D1269
rendering
Make scene background color as default for render-to-texture instead of
current blue color (0, 0, 255).
It is very useful for mirrors setups.
Reviewers: moguri, ben2610, sybren, panzergame, hg1
Reviewed By: panzergame, hg1, moguri
Subscribers: mpan3
Differential Revision: https://developer.blender.org/D1287
I have added an optional named "index" argument for methode get/setUV, I have also modified the and set to deprecated methodes setUV2 and getUV2 : the doc was wrong and the methode can't be called anyway because it declared as VARARG in the .h and convert directly the args value to a vector in the .cpp.
Reviewers: sybren, lordloki, hg1
Reviewed By: lordloki, hg1
Subscribers: agoose77
Differential Revision: https://developer.blender.org/D1240
It fix some mistakes in b5e96530353ef22d184a60cd2b59a5e451ee211f and made a more safety behavior for collision callbacks used in compound controllers during adding and removing.
Replace EnableCcdPhysicsController by AddCcdPhysicsController and DisableCcdPhysicsController by RemoveCcdPhysicsController.
Tested with compound shapes and collision sensors.
Reviewers:agoose77, ideasman42
Making the reference argument optional for the addObject function.
```
scene.addObject("Cube")
```
This allows to keep the rotation, scale and position of the original object.
To avoid layer problems with lights if the reference arguments is None, the new object have the same layer than the active layers in scene.
Reviewers: lordloki, moguri, hg1, sybren
Reviewed By: hg1, sybren
Subscribers: agoose77
Projects: #game_engine
Differential Revision: https://developer.blender.org/D1222
Currently there are bugs with physics objects in inactive layers,
character and softbody.
I added a function in CcdPhysicsEnvironement to know if a physics
controller is currently active and for soft body I added the correct function in UpdateCcdPhysicsController to re-add a softbody in the dynamics world.
The bug was introduced in D1243 commit 3d55859
Reviewers: hg1, scorpion81, lordloki, moguri, agoose77, sergof
Reviewed By: sergof
Subscribers: youle, moguri
Differential Revision: https://developer.blender.org/D1253
This callback allows the user to change the camera data right before the
rendering calculations.
scene.pre_draw[] is not enough here, because if you want to change the
camera matrices (projection/modelview) the culling test is done before
that (after pre_draw_setup[] though).
Reviewers: moguri, campbellbarton
Differential Revision: https://developer.blender.org/D1251
Python sample code using this. The sample scene would need a default
camera (not used for rendering), a dummy camera ('Camera.VR'), and two
cameras ('Camera.Left', 'Camera.Right') that will be used for the actual
rendering.
```
import bge
def callback():
scene = bge.logic.getCurrentScene()
objects = scene.objects
vr_camera = objects.get('Camera.VR')
if bge.render.getStereoEye() == bge.render.LEFT_EYE:
camera = objects.get('Camera.Left')
else:
camera = objects.get('Camera.Right')
vr_camera.worldOrientation = camera.worldOrientation
vr_camera.worldPosition = camera.worldPosition
def init():
scene = bge.logic.getCurrentScene()
main_camera = scene.active_camera
main_camera.useViewport = True
scene.pre_draw_setup.append(callback)
objects = scene.objects
vr_camera = objects.get('Camera.VR')
vr_camera.useViewport = True
vr_camera.setViewport(
0,
0,
bge.render.getWindowWidth(),
bge.render.getWindowHeight() )
```
A new function (RunPythonCallBackList) to call all python functions
contained in a python list was developed.
This function has:
- first argument is the python list of callbacks
- second argument is a python list of arguments
- third argument is the minimum quantity of arguments
- forth argument is the maximum quantity of arguments
It improves flexibility and supports *args.
Reviewers: moguri, dfelinto, campbellbarton, sybren
Reviewed By: campbellbarton, sybren
Subscribers: sybren
Projects: #game_engine
Differential Revision: https://developer.blender.org/D1102
A Python API for the collision group / mask has been added:
```
KX_GameObject.collisionGroup
KX_GameObject.collisionMask
```
The maximum number of collision groups and masked has been increased from eight to sixteen.
This means that the max value of collisionGroup/Mask is (2 ** 16) - 1
EndObject will now activate objects that were sleeping and colliding with the removed object.
This means that, unlike now, if a rigid body starts sleeping on top of another object, when the latter is removed the rigid body will activate and fall, rather than float midair as before.
Collision groups that do not intersect used to collide on the first frame. Now this has been fixed so that they collide appropriately.
Thanks to agoose77 for his help.
Reviewers: scorpion81, hg1, agoose77, sergof
Reviewed By: agoose77, sergof
Subscribers: sergof, moguri
Projects: #game_physics, #game_engine
Differential Revision: https://developer.blender.org/D1243
The layers in Blender are using a bit field for the 20 layers. The light layer value was limited to 20, so the highest usable light layer was five.
The patch modify the range and add layer out of range error messages.
Reviewers: sybren, hg1, moguri
Reviewed By: hg1, moguri
Projects: #game_engine
Differential Revision: https://developer.blender.org/D1238
"Frequency" parameter is renamed to "Skip" in the LogicBricks sensors as it represents skipped frames between pulses.
Naming something (frequency) the exact opposite of what it represents (period) was the worst choice.
Also, a new BGE python attribute 'skippedTicks' was introduced. 'frequency' attribute is maintained but deprecated.
Internally, freq variable is used yet at DNA_Sensor to maintain compability and to avoid do_versions.
Thanks to Sybren for the investigation.
{F162440}
Reviewers: campbellbarton, sybren, moguri, hg1
Reviewed By: sybren, hg1
Differential Revision: https://developer.blender.org/D1229
In the BGE you can't create a subclass with more than 1 argument like : "player = Player(owner, 10)"
I have modified the py_base_new to check only the first argument of args tuple.
Now we can do :
class Player(types.KX_GameObject):
def __init__(self, gameobj, life):
print("create new player :", self, ", life :", life)
player = Player(own, 50)
Added keyword arguments to createConstraint.
Changed initial values for the pivod XYZ form 1 to 0.0.
Changed initial values for the axis Z form 1 to 0.0.
Delete the parsing for 4 parameters, because parsing only the X pivot is not necessary, also it was not working correctly (int instead of float).
Reviewers: brita_, sybren, lordloki, campbellbarton, moguri
Reviewed By: lordloki, campbellbarton
Subscribers: campbellbarton
Differential Revision: https://developer.blender.org/D705
In quad-buffer stereo mode, the GE render pass ends with the right eye on the right buffer, but we need to draw on the left buffer to capture the render.
Reviewed By: agoose77, HG1
The getScreenVect(), getScreenPosition() and modelview_matrixmethod returns an incorrect results if called after the camera has been translated on the same frame.
The model view matrix will be update only once per frame with Cam->SetModelviewMatrix in KX_KetsjiEngine::RenderFrame.
Using GetWorldToCamera as model view matrix to get an actual view matrix even if the camera is moved.
Reviewers: sergey, dfelinto, brita_, sybren, hg1, campbellbarton
Reviewed By: hg1, campbellbarton
Projects: #game_engine
Differential Revision: https://developer.blender.org/D1170
Fix of T36285, I just invalidate projection matrix when a camera switch
to viewport mode, because we need to rewrite the projection matrix in
RenderFrame.
It worked with old blender version because when you use viewport render
one camera is added in the camera list and initialize its projection
matrix for the first time. But when we used several cameras + viewport
for splitscreen we had issues.
Reviewers: dfelinto, hg1, ben2610, lordloki, moguri
Reviewed By: moguri
Projects: #game_rendering, #game_engine
Differential Revision: https://developer.blender.org/D1202
This patch adds a new API function to get the actual display dimensions in pixels.
Reviewers: dfelinto, sybren, lordloki, moguri
Reviewed By: lordloki, moguri
Differential Revision: https://developer.blender.org/D648
KX_Scene::addObject: Changed the parameter "other" to "reference", as "other" doesn't mean anything.
KX_Scene::AddReplicaObject: Changed the parameter "parentobject" to "referenceobject", as the parameter did NOT contain a parent object in any way.
Now both functions use the same kind of name for the same thing.
Thanks to panzergame / Porteries Tristan.
The character motion actuator local movement does not taking account of the object rotation.
It is necessary to rotate the motion vector before adding the local movement.
Reviewers: sybren, lordloki, moguri
Reviewed By: lordloki, moguri
Maniphest Tasks: T42709
Differential Revision: https://developer.blender.org/D1206
The return type of raise_exc_wheel() is bool, but the method return -1. The compiler will change the return type type to an int. This can cause some problems on 64bit systems.
Reviewers: lordloki, sybren
Reviewed By: lordloki, sybren
Differential Revision: https://developer.blender.org/D1204