#include "global.h"#include "MercuryObjectCommands.h"#include "MercuryObject.h"#include "MercuryUtil.h"#include "MercuryMath.h"#include "MercuryLog.h"Go to the source code of this file.
Defines | |
| #define | STD_COMMAND(x, y, z) |
| #define | STD_FLOAT_COMMAND(x, y) STD_COMMAND( x, y, float ) |
| #define | ADD_COLOR_COMMAND(x, y) |
| #define | ADD_COMMAND(x, y) |
Functions | |
| STD_FLOAT_COMMAND (X,"x") STD_FLOAT_COMMAND(Y | |
| y | STD_FLOAT_COMMAND (Z,"z") STD_FLOAT_COMMAND(RotX |
| y rotationx | STD_FLOAT_COMMAND (RotY,"rotationy") STD_FLOAT_COMMAND(RotZ |
| y rotationx rotationz | STD_FLOAT_COMMAND (ScaleX,"scalex") STD_FLOAT_COMMAND(ScaleY |
| y rotationx rotationz scaley | STD_FLOAT_COMMAND (ScaleZ,"scalez") STD_COMMAND(DrawOrder |
| y rotationx rotationz scaley static int void | ExecuteObjectCommand (const float fPercent, const float fLastPercent, MercuryObject *pObject, MercuryTweenOperation *pOperation) |
| ADD_COLOR_COMMAND (Diffuse,"diffuse") ADD_COLOR_COMMAND(Ambient | |
| ambient | ADD_COLOR_COMMAND (Emissive,"emissive") ADD_COLOR_COMMAND(Specular |
| ADD_COMMAND (X,"addx") ADD_COMMAND(Y | |
| addy | ADD_COMMAND (Z,"addz") ADD_COMMAND(RotX |
| addy addrotationx | ADD_COMMAND (RotY,"addrotationy") ADD_COMMAND(RotZ |
| addy addrotationx static addrotationz void | CommandHide (const float fPercent, const float fLastPercent, MercuryObject *pObject, MercuryTweenOperation *pOperation) |
| static float | TweenLinear (const float fPercent, PStack &pArgs) |
| static float | TweenSleep (const float fPercent, PStack &pArgs) |
| static float | TweenQuadratic (const float fPercent, PStack &pArgs) |
Variables | |
| AutoCommandRegisterer | CommandRegisterer |
| y rotationx rotationz scaley | draworder |
| static int | FunctionNumberExecCommand = CommandRegisterer.RegisterFunction( ExecuteObjectCommand, "cmd" ) |
| static int | FunctionHideNumber = CommandRegisterer.RegisterFunction( CommandHide, "hide" ) |
| static int | FunctionNumberCMDlinear = CommandRegisterer.RegisterTweenType( TweenLinear, "linear" ) |
| static int | FunctionNumberCMDsleep = CommandRegisterer.RegisterTweenType( TweenSleep, "sleep" ) |
| static int | FunctionNumberCMDquadratic = CommandRegisterer.RegisterTweenType( TweenQuadratic, "quadratic" ) |
| #define ADD_COLOR_COMMAND | ( | x, | |||
| y | ) |
Value:
static void ADDCCMD##x( const float fPercent, const float fLastPercent, MercuryObject * pObject, MercuryTweenOperation * pOperation ) \ { \ MercuryColor newloc; \ if ( pOperation->Parameters.PeekItem(0).GetType() == PSElement::PARAMETER ) \ newloc.SetR( pObject->Tweening.m_pCurrentTween->pKArgs.PeekItem( pOperation->Parameters.PeekItem(0).GetValueI() ).GetValueF() ); \ else \ newloc.SetR( pOperation->Parameters.PeekItem(0).GetValueF() ); \ if ( pOperation->Parameters.PeekItem(1).GetType() == PSElement::PARAMETER ) \ newloc.SetG( pObject->Tweening.m_pCurrentTween->pKArgs.PeekItem( pOperation->Parameters.PeekItem(1).GetValueI() ).GetValueF() ); \ else \ newloc.SetG( pOperation->Parameters.PeekItem(1).GetValueF() ); \ if ( pOperation->Parameters.PeekItem(2).GetType() == PSElement::PARAMETER ) \ newloc.SetB( pObject->Tweening.m_pCurrentTween->pKArgs.PeekItem( pOperation->Parameters.PeekItem(2).GetValueI() ).GetValueF() ); \ else \ newloc.SetB( pOperation->Parameters.PeekItem(2).GetValueF() ); \ if ( pOperation->Parameters.PeekItem(3).GetType() == PSElement::PARAMETER ) \ newloc.SetA( pObject->Tweening.m_pCurrentTween->pKArgs.PeekItem( pOperation->Parameters.PeekItem(3).GetValueI() ).GetValueF() ); \ else \ newloc.SetA( pOperation->Parameters.PeekItem(3).GetValueF() ); \ \ MercuryColor oldloc = pObject->Get##x(); \ MercuryColor diffloc = newloc-oldloc; \ MercuryColor totalmove = diffloc*(1/(1-fLastPercent)); \ MercuryColor fToMove = totalmove * ( fPercent - fLastPercent ); \ \ pObject->Set##x( fToMove + oldloc ); \ } \ \ static int FunctionADDCCMD##x = CommandRegisterer.RegisterFunction( ADDCCMD##x, y );
Definition at line 100 of file MercuryObjectCommands.cpp.
| #define ADD_COMMAND | ( | x, | |||
| y | ) |
Value:
static void ADDCMD##x( const float fPercent, const float fLastPercent, MercuryObject * pObject, MercuryTweenOperation * pOperation ) \ { \ float diffloc = pOperation->Parameters.PeekItem().GetValueF(); \ float oldloc = pObject->Get##x(); \ float totalmove = diffloc*(fPercent-fLastPercent); \ float fToMove = totalmove; \ pObject->Set##x( fToMove + oldloc ); \ } \ \ static int FunctionNumberADDCMD##x = CommandRegisterer.RegisterFunction( ADDCMD##x, y );
Definition at line 136 of file MercuryObjectCommands.cpp.
| #define STD_COMMAND | ( | x, | |||
| y, | |||||
| z | ) |
Value:
static void CMD##x( const float fPercent, const float fLastPercent, MercuryObject * pObject, MercuryTweenOperation * pOperation ) \ { \ float newloc; \ if ( pOperation->Parameters.PeekItem().GetType() == PSElement::PARAMETER ) {\ newloc = pObject->Tweening.m_pCurrentTween->pKArgs.PeekItem( pOperation->Parameters.PeekItem().GetValueI() ).GetValueF(); \ } else \ newloc = pOperation->Parameters.PeekItem().GetValueF(); \ float oldloc = pObject->Get##x(); \ float diffloc = newloc-oldloc; \ float totalmove = diffloc/(1-fLastPercent); \ float fToMove = totalmove * ( fPercent - fLastPercent ); \ pObject->Set##x( (z)( fToMove + oldloc ) ); \ } \ \ static int FunctionNumberCMD##x = CommandRegisterer.RegisterFunction( CMD##x, y );
Definition at line 56 of file MercuryObjectCommands.cpp.
| #define STD_FLOAT_COMMAND | ( | x, | |||
| y | ) | STD_COMMAND( x, y, float ) |
Definition at line 73 of file MercuryObjectCommands.cpp.
| ambient ADD_COLOR_COMMAND | ( | Emissive | , | |
| "emissive" | ||||
| ) |
| ADD_COLOR_COMMAND | ( | Diffuse | , | |
| "diffuse" | ||||
| ) |
| addy addrotationx ADD_COMMAND | ( | RotY | , | |
| "addrotationy" | ||||
| ) |
| addy ADD_COMMAND | ( | Z | , | |
| "addz" | ||||
| ) |
| ADD_COMMAND | ( | X | , | |
| "addx" | ||||
| ) |
| addy addrotationx static addrotationz void CommandHide | ( | const float | fPercent, | |
| const float | fLastPercent, | |||
| MercuryObject * | pObject, | |||
| MercuryTweenOperation * | pOperation | |||
| ) | [static] |
Definition at line 155 of file MercuryObjectCommands.cpp.
| y rotationx rotationz scaley static int void ExecuteObjectCommand | ( | const float | fPercent, | |
| const float | fLastPercent, | |||
| MercuryObject * | pObject, | |||
| MercuryTweenOperation * | pOperation | |||
| ) | [static] |
Definition at line 88 of file MercuryObjectCommands.cpp.
| y rotationx rotationz scaley STD_FLOAT_COMMAND | ( | ScaleZ | , | |
| "scalez" | ||||
| ) |
| y rotationx rotationz STD_FLOAT_COMMAND | ( | ScaleX | , | |
| "scalex" | ||||
| ) |
| y rotationx STD_FLOAT_COMMAND | ( | RotY | , | |
| "rotationy" | ||||
| ) |
| y STD_FLOAT_COMMAND | ( | Z | , | |
| "z" | ||||
| ) |
| STD_FLOAT_COMMAND | ( | X | , | |
| "x" | ||||
| ) |
| static float TweenLinear | ( | const float | fPercent, | |
| PStack & | pArgs | |||
| ) | [static] |
Definition at line 164 of file MercuryObjectCommands.cpp.
| static float TweenQuadratic | ( | const float | fPercent, | |
| PStack & | pArgs | |||
| ) | [static] |
Definition at line 177 of file MercuryObjectCommands.cpp.
| static float TweenSleep | ( | const float | fPercent, | |
| PStack & | pArgs | |||
| ) | [static] |
Definition at line 169 of file MercuryObjectCommands.cpp.
Definition at line 11 of file MercuryObjectCommands.cpp.
| y rotationx rotationz scaley draworder |
Definition at line 84 of file MercuryObjectCommands.cpp.
int FunctionHideNumber = CommandRegisterer.RegisterFunction( CommandHide, "hide" ) [static] |
Definition at line 161 of file MercuryObjectCommands.cpp.
int FunctionNumberCMDlinear = CommandRegisterer.RegisterTweenType( TweenLinear, "linear" ) [static] |
Definition at line 182 of file MercuryObjectCommands.cpp.
int FunctionNumberCMDquadratic = CommandRegisterer.RegisterTweenType( TweenQuadratic, "quadratic" ) [static] |
Definition at line 184 of file MercuryObjectCommands.cpp.
int FunctionNumberCMDsleep = CommandRegisterer.RegisterTweenType( TweenSleep, "sleep" ) [static] |
Definition at line 183 of file MercuryObjectCommands.cpp.
int FunctionNumberExecCommand = CommandRegisterer.RegisterFunction( ExecuteObjectCommand, "cmd" ) [static] |
Definition at line 97 of file MercuryObjectCommands.cpp.