Blender Git Loki

Git Commits -> Revision d1fd99b

Revision d1fd99b by Benoit Bolsee (master)
July 8, 2008, 12:18 (GMT)
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.

Commit Details:

Full Hash: d1fd99b0700b6a779e4d01ddbffb4b946d02b382
SVN Revision: 15486
Parent Commit: 168ae67
Lines Changed: +274, -178

19 Modified Paths:

/projectfiles_vc7/blender/blenlib/BLI_blenlib.vcproj (+6, -0) (Diff)
/source/blender/makesdna/DNA_actuator_types.h (+3, -2) (Diff)
/source/blender/src/buttons_logic.c (+40, -21) (Diff)
/source/gameengine/Converter/BL_BlenderDataConversion.cpp (+2, -1) (Diff)
/source/gameengine/Converter/KX_ConvertActuators.cpp (+4, -3) (Diff)
/source/gameengine/GameLogic/SCA_ActuatorSensor.cpp (+1, -1) (Diff)
/source/gameengine/GameLogic/SCA_IActuator.h (+1, -0) (Diff)
/source/gameengine/GameLogic/SCA_IObject.cpp (+7, -1) (Diff)
/source/gameengine/GameLogic/SCA_IObject.h (+15, -0) (Diff)
/source/gameengine/GameLogic/SCA_ISensor.h (+2, -0) (Diff)
/source/gameengine/Ketsji/KX_GameObject.cpp (+15, -24) (Diff)
/source/gameengine/Ketsji/KX_GameObject.h (+11, -3) (Diff)
/source/gameengine/Ketsji/KX_IpoActuator.cpp (+77, -94) (Diff)
/source/gameengine/Ketsji/KX_IpoActuator.h (+9, -3) (Diff)
/source/gameengine/Ketsji/KX_IPO_SGController.cpp (+65, -22) (Diff)
/source/gameengine/Ketsji/KX_IPO_SGController.h (+5, -2) (Diff)
/source/gameengine/Ketsji/KX_ParentActuator.cpp (+6, -0) (Diff)
/source/gameengine/Ketsji/KX_Scene.cpp (+2, -0) (Diff)
/source/gameengine/SceneGraph/SG_Controller.h (+3, -1) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021