[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [34916] trunk/blender/source: BGE: Action and ShapeKey Actuator PingPong playmode.
Dalai Felinto
dfelinto at gmail.com
Wed Feb 16 20:53:39 CET 2011
Revision: 34916
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=34916
Author: dfelinto
Date: 2011-02-16 19:53:39 +0000 (Wed, 16 Feb 2011)
Log Message:
-----------
BGE: Action and ShapeKey Actuator PingPong playmode.
I have no idea why this hasn't been implemented before (the DEFINES were even there already). But since the Ipo (Fcurve) Actuator supports it I don't see why Action and ShapeKey shouldn't.
More than a new feature or a bugfix this is actually a step forward into unifying them.
Modified Paths:
--------------
trunk/blender/source/blender/makesrna/intern/rna_actuator.c
trunk/blender/source/gameengine/Converter/BL_ActionActuator.cpp
trunk/blender/source/gameengine/Converter/BL_ShapeActionActuator.cpp
Modified: trunk/blender/source/blender/makesrna/intern/rna_actuator.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_actuator.c 2011-02-16 19:52:32 UTC (rev 34915)
+++ trunk/blender/source/blender/makesrna/intern/rna_actuator.c 2011-02-16 19:53:39 UTC (rev 34916)
@@ -549,6 +549,7 @@
static EnumPropertyItem prop_type_items[] ={
{ACT_ACTION_PLAY, "PLAY", 0, "Play", ""},
+ {ACT_ACTION_PINGPONG, "PINGPONG", 0, "Ping Pong", ""},
{ACT_ACTION_FLIPPER, "FLIPPER", 0, "Flipper", ""},
{ACT_ACTION_LOOP_STOP, "LOOPSTOP", 0, "Loop Stop", ""},
{ACT_ACTION_LOOP_END, "LOOPEND", 0, "Loop End", ""},
@@ -1778,6 +1779,7 @@
static EnumPropertyItem prop_type_items[] ={
{ACT_ACTION_PLAY, "PLAY", 0, "Play", ""},
+ {ACT_ACTION_PINGPONG, "PINGPONG", 0, "Ping Pong", ""},
{ACT_ACTION_FLIPPER, "FLIPPER", 0, "Flipper", ""},
{ACT_ACTION_LOOP_STOP, "LOOPSTOP", 0, "Loop Stop", ""},
{ACT_ACTION_LOOP_END, "LOOPEND", 0, "Loop End", ""},
Modified: trunk/blender/source/gameengine/Converter/BL_ActionActuator.cpp
===================================================================
--- trunk/blender/source/gameengine/Converter/BL_ActionActuator.cpp 2011-02-16 19:52:32 UTC (rev 34915)
+++ trunk/blender/source/gameengine/Converter/BL_ActionActuator.cpp 2011-02-16 19:53:39 UTC (rev 34916)
@@ -232,6 +232,16 @@
apply=false;
}
break;
+ case ACT_ACTION_PINGPONG:
+ if (bPositiveEvent){
+ if (!(m_flag & ACT_FLAG_LOCKINPUT)){
+ m_flag &= ~ACT_FLAG_KEYUP;
+ m_localtime = m_starttime;
+ m_starttime = curtime;
+ m_flag |= ACT_FLAG_LOCKINPUT;
+ }
+ }
+ break;
case ACT_ACTION_FLIPPER:
if (bPositiveEvent){
if (!(m_flag & ACT_FLAG_LOCKINPUT)){
@@ -306,6 +316,18 @@
break;
case ACT_ACTION_LOOP_STOP:
break;
+ case ACT_ACTION_PINGPONG:
+ if (wrap){
+ if (!(m_flag & ACT_FLAG_REVERSE))
+ m_localtime = m_endframe;
+ else
+ m_localtime = m_startframe;
+
+ m_flag &= ~ACT_FLAG_LOCKINPUT;
+ m_flag ^= ACT_FLAG_REVERSE; //flip direction
+ keepgoing = false;
+ }
+ break;
case ACT_ACTION_FLIPPER:
if (wrap){
if (!(m_flag & ACT_FLAG_REVERSE)){
Modified: trunk/blender/source/gameengine/Converter/BL_ShapeActionActuator.cpp
===================================================================
--- trunk/blender/source/gameengine/Converter/BL_ShapeActionActuator.cpp 2011-02-16 19:52:32 UTC (rev 34915)
+++ trunk/blender/source/gameengine/Converter/BL_ShapeActionActuator.cpp 2011-02-16 19:53:39 UTC (rev 34916)
@@ -226,6 +226,16 @@
apply=false;
}
break;
+ case ACT_ACTION_PINGPONG:
+ if (bPositiveEvent){
+ if (!(m_flag & ACT_FLAG_LOCKINPUT)){
+ m_flag &= ~ACT_FLAG_KEYUP;
+ m_localtime = m_starttime;
+ m_starttime = curtime;
+ m_flag |= ACT_FLAG_LOCKINPUT;
+ }
+ }
+ break;
case ACT_ACTION_FLIPPER:
if (bPositiveEvent){
if (!(m_flag & ACT_FLAG_LOCKINPUT)){
@@ -300,6 +310,18 @@
break;
case ACT_ACTION_LOOP_STOP:
break;
+ case ACT_ACTION_PINGPONG:
+ if (wrap){
+ if (!(m_flag & ACT_FLAG_REVERSE))
+ m_localtime = m_endframe;
+ else
+ m_localtime = m_startframe;
+
+ m_flag &= ~ACT_FLAG_LOCKINPUT;
+ m_flag ^= ACT_FLAG_REVERSE; //flip direction
+ keepgoing = false;
+ }
+ break;
case ACT_ACTION_FLIPPER:
if (wrap){
if (!(m_flag & ACT_FLAG_REVERSE)){
More information about the Bf-blender-cvs
mailing list