mirror of
https://bitbucket.org/mfeemster/fractorium.git
synced 2025-01-21 21:20:07 -05:00
--User changes
-Add motion support from Simon Detheridge at the ember level instead of just individual xforms: Add the ability to manipulate camera pitch, yaw and other goodies during flame rotation using a new element specified at the top-level of the flame. Create a new 'saw' motion function, so that these values can effectively be looped (e.g. yaw -1 to +1) over the course of a rotation. Add an offset to existing motion elements, to start them partway through their cycle. This would (for example) enable creating circular motion of xform affines, by combining two offset sine waves, one with an offset of 0.25 or 0.75. Fix loops in EmberGenome (they only had an on/off effect - this was broken in flame-genome as well) and make the loop count floating-point as well. For sequence animations, it's not necessary for clips to loop precisely if they're not designed specifically for the ES project. Similarly, there's no need for motion_frequency to be an integer value either so this was changed to allow motion that doesn't necessarily start or end at the loop boundary. I've attempted to keep each bit of functionality in its own commit. There's an argument as to whether to call the new flame motion elements <flame_motion/> (to differentiate programmatically) or just <motion/> (for consistency within the file) -- I opted for the former because it was easier to modify the xml parser that way. --Code changes -Change FlameMotion.h to EmberMotion.h to keep the naming convention consistent. -Made elements of EmberMotion.m_MotionParams into their own type, MotionParam, which allows for CopyVec() to work. -Change m_FlameMotionElements to m_EmberMotionElements in Ember. -Use CopyVec() for EmberMotion instead of manual copy in copy constructors. -Add exports in Ember.cpp for EmberMotion. -Format eEmberMotionParam enum with one entry per line since it has many entries. -Use fabs() in XmlToEmber instead of glm::abs. -Minor formatting.
This commit is contained in:
parent
3a9ce0928f
commit
fb262c2469
@ -271,6 +271,7 @@
|
||||
<ClInclude Include="..\..\..\Source\Ember\CarToRas.h" />
|
||||
<ClInclude Include="..\..\..\Source\Ember\Curves.h" />
|
||||
<ClInclude Include="..\..\..\Source\Ember\EmberDefines.h" />
|
||||
<ClInclude Include="..\..\..\Source\Ember\EmberMotion.h" />
|
||||
<ClInclude Include="..\..\..\Source\Ember\EmberPch.h" />
|
||||
<ClInclude Include="..\..\..\Source\Ember\Ember.h" />
|
||||
<ClInclude Include="..\..\..\Source\Ember\DensityFilter.h" />
|
||||
|
@ -113,6 +113,9 @@
|
||||
<ClInclude Include="..\..\..\Source\Ember\Curves.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\Source\Ember\EmberMotion.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\..\Source\Ember\DllMain.cpp">
|
||||
|
@ -53,5 +53,5 @@ HEADERS += \
|
||||
../../../Source/Ember/VariationsDC.h \
|
||||
../../../Source/Ember/Xform.h \
|
||||
../../../Source/Ember/XmlToEmber.h \
|
||||
../../../Source/Ember/FlameMotion.h
|
||||
../../../Source/Ember/EmberMotion.h
|
||||
|
||||
|
@ -24,6 +24,7 @@ template<> unique_ptr<QTIsaac<ISAAC_SIZE, ISAAC_INT>> QTIsaac<ISAAC_SIZE, ISAAC_
|
||||
#include "VariationList.h"
|
||||
#include "Affine2D.h"
|
||||
#include "Xform.h"
|
||||
#include "EmberMotion.h"
|
||||
#include "EmberToXml.h"
|
||||
#include "XmlToEmber.h"
|
||||
#include "SpatialFilter.h"
|
||||
@ -65,6 +66,8 @@ uint Timing::m_ProcessorCount;
|
||||
template EMBER_API class StandardIterator<T>; \
|
||||
template EMBER_API class XaosIterator<T>; \
|
||||
template EMBER_API class Xform<T>; \
|
||||
template EMBER_API class MotionParam<T>; \
|
||||
template EMBER_API class EmberMotion<T>; \
|
||||
template EMBER_API class IteratorHelper<T>; \
|
||||
template EMBER_API class Variation<T>; \
|
||||
template EMBER_API class ParamWithName<T>; \
|
||||
|
@ -5,7 +5,7 @@
|
||||
#include "PaletteList.h"
|
||||
#include "SpatialFilter.h"
|
||||
#include "TemporalFilter.h"
|
||||
#include "FlameMotion.h"
|
||||
#include "EmberMotion.h"
|
||||
|
||||
/// <summary>
|
||||
/// Ember class.
|
||||
@ -184,10 +184,7 @@ public:
|
||||
if (ember.m_Edits != nullptr)
|
||||
m_Edits = xmlCopyDoc(ember.m_Edits, 1);
|
||||
|
||||
m_FlameMotionElements.clear();
|
||||
|
||||
for(int i = 0; i < ember.m_FlameMotionElements.size(); ++i)
|
||||
m_FlameMotionElements.push_back(ember.m_FlameMotionElements[i]);
|
||||
CopyVec(m_EmberMotionElements, ember.m_EmberMotionElements);
|
||||
|
||||
return *this;
|
||||
}
|
||||
@ -479,7 +476,7 @@ public:
|
||||
for (size_t i = 0; i < TotalXformCount(); i++)
|
||||
GetTotalXform(i)->DeleteMotionElements();
|
||||
|
||||
m_FlameMotionElements.clear();
|
||||
m_EmberMotionElements.clear();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -1294,19 +1291,20 @@ public:
|
||||
}
|
||||
|
||||
#define APP_FMP(x) x += param.second * Interpolater<T>::MotionFuncs(motion.m_MotionFunc, motion.m_MotionFreq * (blend + motion.m_MotionOffset))
|
||||
|
||||
/// <summary>
|
||||
/// Update ember parameters based on stored motion elements
|
||||
/// </summary>
|
||||
/// <param name="blend">The time percentage value which dictates how much of a percentage of 360 degrees it should be rotated and the time position for the motion elements</param>
|
||||
void ApplyFlameMotion(T blend)
|
||||
{
|
||||
for (size_t i = 0; i < m_FlameMotionElements.size(); ++i)
|
||||
for (size_t i = 0; i < m_EmberMotionElements.size(); ++i)
|
||||
{
|
||||
const FlameMotion<T> &motion = m_FlameMotionElements[i];
|
||||
auto& motion = m_EmberMotionElements[i];
|
||||
|
||||
for (size_t j = 0; j < motion.m_MotionParams.size(); ++j)
|
||||
{
|
||||
const pair<eFlameMotionParam, T> ¶m = motion.m_MotionParams[j];
|
||||
auto& param = motion.m_MotionParams[j];
|
||||
|
||||
switch (param.first)
|
||||
{
|
||||
@ -1768,7 +1766,7 @@ public:
|
||||
size_t m_Index;
|
||||
|
||||
//The list of motion elements for the top-level flame params
|
||||
vector<FlameMotion<T>> m_FlameMotionElements;
|
||||
vector<EmberMotion<T>> m_EmberMotionElements;
|
||||
|
||||
private:
|
||||
/// <summary>
|
||||
|
@ -120,10 +120,26 @@ enum eProcessState : uint { NONE = 0, ITER_STARTED = 1, ITER_DONE = 2, FILTER_DO
|
||||
enum eInteractiveFilter : uint { FILTER_LOG = 0, FILTER_DE = 1 };
|
||||
enum eScaleType : uint { SCALE_NONE = 0, SCALE_WIDTH = 1, SCALE_HEIGHT = 2 };
|
||||
enum eRenderStatus : uint { RENDER_OK = 0, RENDER_ERROR = 1, RENDER_ABORT = 2 };
|
||||
enum eFlameMotionParam : uint {
|
||||
FLAME_MOTION_NONE = 0, FLAME_MOTION_ZOOM = 1, FLAME_MOTION_ZPOS = 2, FLAME_MOTION_PERSPECTIVE = 3, FLAME_MOTION_YAW = 4, FLAME_MOTION_PITCH = 5, FLAME_MOTION_DEPTH_BLUR = 6,
|
||||
FLAME_MOTION_CENTER_X = 7, FLAME_MOTION_CENTER_Y = 8, FLAME_MOTION_ROTATE = 9, FLAME_MOTION_HUE = 10, FLAME_MOTION_BRIGHTNESS = 11, FLAME_MOTION_GAMMA = 12,
|
||||
FLAME_MOTION_GAMMA_THRESH = 13, FLAME_MOTION_HIGHLIGHT_POWER = 14, FLAME_MOTION_BACKGROUND_R = 15, FLAME_MOTION_BACKGROUND_G = 16,
|
||||
FLAME_MOTION_BACKGROUND_B = 17, FLAME_MOTION_VIBRANCY = 18
|
||||
enum eEmberMotionParam : uint
|
||||
{
|
||||
FLAME_MOTION_NONE = 0,
|
||||
FLAME_MOTION_ZOOM = 1,
|
||||
FLAME_MOTION_ZPOS = 2,
|
||||
FLAME_MOTION_PERSPECTIVE = 3,
|
||||
FLAME_MOTION_YAW = 4,
|
||||
FLAME_MOTION_PITCH = 5,
|
||||
FLAME_MOTION_DEPTH_BLUR = 6,
|
||||
FLAME_MOTION_CENTER_X = 7,
|
||||
FLAME_MOTION_CENTER_Y = 8,
|
||||
FLAME_MOTION_ROTATE = 9,
|
||||
FLAME_MOTION_HUE = 10,
|
||||
FLAME_MOTION_BRIGHTNESS = 11,
|
||||
FLAME_MOTION_GAMMA = 12,
|
||||
FLAME_MOTION_GAMMA_THRESH = 13,
|
||||
FLAME_MOTION_HIGHLIGHT_POWER = 14,
|
||||
FLAME_MOTION_BACKGROUND_R = 15,
|
||||
FLAME_MOTION_BACKGROUND_G = 16,
|
||||
FLAME_MOTION_BACKGROUND_B = 17,
|
||||
FLAME_MOTION_VIBRANCY = 18
|
||||
};
|
||||
}
|
||||
|
@ -221,8 +221,8 @@ public:
|
||||
|
||||
os << "\">\n";
|
||||
|
||||
for (i = 0; i < ember.m_FlameMotionElements.size(); ++i)
|
||||
os << " " << ToString(ember.m_FlameMotionElements[i]);
|
||||
for (i = 0; i < ember.m_EmberMotionElements.size(); ++i)
|
||||
os << " " << ToString(ember.m_EmberMotionElements[i]);
|
||||
|
||||
//This is a grey area, what to do about symmetry to avoid duplicating the symmetry xforms when reading back?//TODO//BUG.
|
||||
//if (ember.m_Symmetry)
|
||||
@ -729,7 +729,7 @@ private:
|
||||
/// Convert a FlameMotion element to an xml string
|
||||
/// </summary>
|
||||
/// <param name="motion">The FlameMotion object to convert to XML</param>
|
||||
string ToString(const FlameMotion<T> &motion)
|
||||
string ToString(const EmberMotion<T>& motion)
|
||||
{
|
||||
ostringstream os;
|
||||
os << "<flame_motion motion_frequency=\"" << motion.m_MotionFreq << "\" ";
|
||||
@ -738,7 +738,8 @@ private:
|
||||
os << "motion_offset=\"" << motion.m_MotionOffset << "\" ";
|
||||
|
||||
os << "motion_func=";
|
||||
switch(motion.m_MotionFunc)
|
||||
|
||||
switch (motion.m_MotionFunc)
|
||||
{
|
||||
case MOTION_SIN:
|
||||
os << "\"sin\"";
|
||||
@ -760,7 +761,7 @@ private:
|
||||
T cx = 0.0;
|
||||
T cy = 0.0;
|
||||
|
||||
for(int i = 0; i < motion.m_MotionParams.size(); ++i)
|
||||
for (int i = 0; i < motion.m_MotionParams.size(); ++i)
|
||||
{
|
||||
switch(motion.m_MotionParams[i].first)
|
||||
{
|
||||
@ -821,10 +822,10 @@ private:
|
||||
}
|
||||
}
|
||||
|
||||
if ( r != 0.0 || g != 0.0 || b != 0.0 )
|
||||
if (r != 0.0 || g != 0.0 || b != 0.0)
|
||||
os << " background=\"" << r << " " << g << " " << b << "\"";
|
||||
|
||||
if ( cx != 0.0 || cy != 0.0 )
|
||||
if (cx != 0.0 || cy != 0.0)
|
||||
os << " center=\"" << cx << " " << cy << "\"";
|
||||
|
||||
os << "/>\n";
|
||||
|
@ -1,66 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "EmberDefines.h"
|
||||
|
||||
namespace EmberNs
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// FlameMotion elements allow for motion of the flame parameters such as zoom, yaw, pitch and friends
|
||||
/// The values in these elements can be used to modify flame parameters during rotation in much the same
|
||||
/// way as motion elements on xforms do.
|
||||
/// Template argument expected to be float or double.
|
||||
/// </summary>
|
||||
template <typename T>
|
||||
class EMBER_API FlameMotion
|
||||
{
|
||||
public:
|
||||
|
||||
FlameMotion()
|
||||
{
|
||||
m_MotionFreq = 0;
|
||||
m_MotionFunc = MOTION_SIN;
|
||||
m_MotionOffset = 0;
|
||||
}
|
||||
|
||||
FlameMotion(const FlameMotion<T> &other)
|
||||
{
|
||||
operator=<T>(other);
|
||||
}
|
||||
|
||||
template <typename U>
|
||||
FlameMotion(const FlameMotion<U> &other)
|
||||
{
|
||||
operator=<U>(other);
|
||||
}
|
||||
|
||||
FlameMotion<T>& operator = (const FlameMotion<T>& other)
|
||||
{
|
||||
if (this != &other)
|
||||
FlameMotion<T>::operator=<T>(other);
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <typename U>
|
||||
FlameMotion &operator = (const FlameMotion<U> &other)
|
||||
{
|
||||
m_MotionParams.clear();
|
||||
|
||||
for (int i = 0; i < other.m_MotionParams.size(); ++i)
|
||||
m_MotionParams.push_back(pair<eFlameMotionParam, T>(other.m_MotionParams[i].first, T(other.m_MotionParams[i].second)));
|
||||
|
||||
m_MotionFunc = other.m_MotionFunc;
|
||||
m_MotionFreq = T(other.m_MotionFreq);
|
||||
m_MotionOffset = T(other.m_MotionOffset);
|
||||
return *this;
|
||||
}
|
||||
|
||||
T m_MotionFreq;
|
||||
T m_MotionOffset;
|
||||
eMotion m_MotionFunc;
|
||||
vector<pair<eFlameMotionParam, T>> m_MotionParams;
|
||||
|
||||
};
|
||||
|
||||
}
|
@ -196,6 +196,10 @@ public:
|
||||
/// <summary>
|
||||
/// Member-wise constructor.
|
||||
/// </summary>
|
||||
/// <param name="rr">The red value, either 0-1 or 0-255.</param>
|
||||
/// <param name="gg">The green value, either 0-1 or 0-255.</param>
|
||||
/// <param name="bb">The blue value, either 0-1 or 0-255.</param>
|
||||
/// <param name="aa">The alpha value, either 0-1 or 0-255.</param>
|
||||
Color(T rr, T gg, T bb, T aa)
|
||||
: v4T(rr, gg, bb, aa)
|
||||
{
|
||||
|
@ -1013,10 +1013,8 @@ public:
|
||||
}
|
||||
|
||||
rotated.ApplyFlameMotion(blend);
|
||||
|
||||
rotated.RotateAffines(-blend * 360);//Rotate the affines.
|
||||
|
||||
rotated.DeleteMotionElements(); // delete all motion elements from the looped flame
|
||||
rotated.DeleteMotionElements();//Delete all motion elements from the looped ember, at the xform level and at the parent ember level.
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -978,7 +978,7 @@ private:
|
||||
if (theXform)
|
||||
{
|
||||
//Check for non-zero motion params.
|
||||
if (abs(theXform->m_MotionFreq) > 0.0)//Original checked for motion func being non-zero, but it was set to MOTION_SIN (1) in Xform::Init(), so don't check for 0 here.
|
||||
if (fabs(theXform->m_MotionFreq) > 0.0)//Original checked for motion func being non-zero, but it was set to MOTION_SIN (1) in Xform::Init(), so don't check for 0 here.
|
||||
{
|
||||
m_ErrorReport.push_back(string(loc) + " : Motion parameters should not be specified in regular, non-motion xforms");
|
||||
}
|
||||
@ -1007,7 +1007,7 @@ private:
|
||||
}
|
||||
else if (!Compare(childNode->name, "flame_motion"))
|
||||
{
|
||||
FlameMotion<T> motion;
|
||||
EmberMotion<T> motion;
|
||||
|
||||
att = childNode->properties;
|
||||
|
||||
@ -1026,13 +1026,14 @@ private:
|
||||
else if (!Compare(curAtt->name, "motion_function"))
|
||||
{
|
||||
string func(attStr);
|
||||
if ( func == "sin" )
|
||||
|
||||
if (func == "sin")
|
||||
motion.m_MotionFunc = MOTION_SIN;
|
||||
else if ( func == "triangle" )
|
||||
else if (func == "triangle")
|
||||
motion.m_MotionFunc = MOTION_TRIANGLE;
|
||||
else if ( func == "hill" )
|
||||
else if (func == "hill")
|
||||
motion.m_MotionFunc = MOTION_HILL;
|
||||
else if ( func == "saw" )
|
||||
else if (func == "saw")
|
||||
motion.m_MotionFunc = MOTION_SAW;
|
||||
else
|
||||
{
|
||||
@ -1041,31 +1042,31 @@ private:
|
||||
}
|
||||
}
|
||||
else if (!Compare(curAtt->name, "zoom"))
|
||||
ret = ret && AttToFlameMotionFloat(att, attStr, FLAME_MOTION_ZOOM, motion);
|
||||
ret = ret && AttToEmberMotionFloat(att, attStr, FLAME_MOTION_ZOOM, motion);
|
||||
else if (!Compare(curAtt->name, "cam_zpos"))
|
||||
ret = ret && AttToFlameMotionFloat(att, attStr, FLAME_MOTION_ZPOS, motion);
|
||||
ret = ret && AttToEmberMotionFloat(att, attStr, FLAME_MOTION_ZPOS, motion);
|
||||
else if (!Compare(curAtt->name, "cam_persp"))
|
||||
ret = ret && AttToFlameMotionFloat(att, attStr, FLAME_MOTION_PERSPECTIVE, motion);
|
||||
ret = ret && AttToEmberMotionFloat(att, attStr, FLAME_MOTION_PERSPECTIVE, motion);
|
||||
else if (!Compare(curAtt->name, "cam_yaw"))
|
||||
ret = ret && AttToFlameMotionFloat(att, attStr, FLAME_MOTION_YAW, motion);
|
||||
ret = ret && AttToEmberMotionFloat(att, attStr, FLAME_MOTION_YAW, motion);
|
||||
else if (!Compare(curAtt->name, "cam_pitch"))
|
||||
ret = ret && AttToFlameMotionFloat(att, attStr, FLAME_MOTION_PITCH, motion);
|
||||
ret = ret && AttToEmberMotionFloat(att, attStr, FLAME_MOTION_PITCH, motion);
|
||||
else if (!Compare(curAtt->name, "cam_dof"))
|
||||
ret = ret && AttToFlameMotionFloat(att, attStr, FLAME_MOTION_DEPTH_BLUR, motion);
|
||||
ret = ret && AttToEmberMotionFloat(att, attStr, FLAME_MOTION_DEPTH_BLUR, motion);
|
||||
else if (!Compare(curAtt->name, "rotate"))
|
||||
ret = ret && AttToFlameMotionFloat(att, attStr, FLAME_MOTION_ROTATE, motion);
|
||||
ret = ret && AttToEmberMotionFloat(att, attStr, FLAME_MOTION_ROTATE, motion);
|
||||
else if (!Compare(curAtt->name, "hue"))
|
||||
ret = ret && AttToFlameMotionFloat(att, attStr, FLAME_MOTION_HUE, motion);
|
||||
ret = ret && AttToEmberMotionFloat(att, attStr, FLAME_MOTION_HUE, motion);
|
||||
else if (!Compare(curAtt->name, "brightness"))
|
||||
ret = ret && AttToFlameMotionFloat(att, attStr, FLAME_MOTION_BRIGHTNESS, motion);
|
||||
ret = ret && AttToEmberMotionFloat(att, attStr, FLAME_MOTION_BRIGHTNESS, motion);
|
||||
else if (!Compare(curAtt->name, "gamma"))
|
||||
ret = ret && AttToFlameMotionFloat(att, attStr, FLAME_MOTION_GAMMA, motion);
|
||||
ret = ret && AttToEmberMotionFloat(att, attStr, FLAME_MOTION_GAMMA, motion);
|
||||
else if (!Compare(curAtt->name, "gamma_threshold"))
|
||||
ret = ret && AttToFlameMotionFloat(att, attStr, FLAME_MOTION_GAMMA_THRESH, motion);
|
||||
ret = ret && AttToEmberMotionFloat(att, attStr, FLAME_MOTION_GAMMA_THRESH, motion);
|
||||
else if (!Compare(curAtt->name, "highlight_power"))
|
||||
ret = ret && AttToFlameMotionFloat(att, attStr, FLAME_MOTION_HIGHLIGHT_POWER, motion);
|
||||
ret = ret && AttToEmberMotionFloat(att, attStr, FLAME_MOTION_HIGHLIGHT_POWER, motion);
|
||||
else if (!Compare(curAtt->name, "vibrancy"))
|
||||
ret = ret && AttToFlameMotionFloat(att, attStr, FLAME_MOTION_VIBRANCY, motion);
|
||||
ret = ret && AttToEmberMotionFloat(att, attStr, FLAME_MOTION_VIBRANCY, motion);
|
||||
else if (!Compare(curAtt->name, "background"))
|
||||
{
|
||||
double r, g, b;
|
||||
@ -1078,11 +1079,13 @@ private:
|
||||
}
|
||||
|
||||
if (r != 0)
|
||||
motion.m_MotionParams.push_back(pair<eFlameMotionParam, T>(FLAME_MOTION_BACKGROUND_R, T(r)));
|
||||
motion.m_MotionParams.push_back(MotionParam<T>(FLAME_MOTION_BACKGROUND_R, T(r)));
|
||||
|
||||
if (g != 0)
|
||||
motion.m_MotionParams.push_back(pair<eFlameMotionParam, T>(FLAME_MOTION_BACKGROUND_G, T(g)));
|
||||
motion.m_MotionParams.push_back(MotionParam<T>(FLAME_MOTION_BACKGROUND_G, T(g)));
|
||||
|
||||
if (b != 0)
|
||||
motion.m_MotionParams.push_back(pair<eFlameMotionParam, T>(FLAME_MOTION_BACKGROUND_B, T(b)));
|
||||
motion.m_MotionParams.push_back(MotionParam<T>(FLAME_MOTION_BACKGROUND_B, T(b)));
|
||||
}
|
||||
else if (!Compare(curAtt->name, "center"))
|
||||
{
|
||||
@ -1096,9 +1099,10 @@ private:
|
||||
}
|
||||
|
||||
if (cx != 0)
|
||||
motion.m_MotionParams.push_back(pair<eFlameMotionParam, T>(FLAME_MOTION_CENTER_X, T(cx)));
|
||||
motion.m_MotionParams.push_back(MotionParam<T>(FLAME_MOTION_CENTER_X, T(cx)));
|
||||
|
||||
if (cy != 0)
|
||||
motion.m_MotionParams.push_back(pair<eFlameMotionParam, T>(FLAME_MOTION_CENTER_Y, T(cy)));
|
||||
motion.m_MotionParams.push_back(MotionParam<T>(FLAME_MOTION_CENTER_Y, T(cy)));
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1110,7 +1114,7 @@ private:
|
||||
xmlFree(attStr);
|
||||
}
|
||||
|
||||
currentEmber.m_FlameMotionElements.push_back(motion);
|
||||
currentEmber.m_EmberMotionElements.push_back(motion);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1125,26 +1129,27 @@ private:
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Parse a floating point value from an xml attribute and add the value to a FlameMotion object
|
||||
/// Parse a floating point value from an xml attribute and add the value to a EmberMotion object
|
||||
/// </summary>
|
||||
/// <param name="att">The current attribute</param>
|
||||
/// <param name="attStr">The attribute value to parse</param>
|
||||
/// <param name="param">The flame motion parameter type</param>
|
||||
/// <param name="motion">The flame motion element to add the parameter to</param>
|
||||
/// <returns>True if there were no errors, else false.</returns>
|
||||
bool AttToFlameMotionFloat(xmlAttrPtr att, const char *attStr, eFlameMotionParam param, FlameMotion<T> &motion)
|
||||
bool AttToEmberMotionFloat(xmlAttrPtr att, const char* attStr, eEmberMotionParam param, EmberMotion<T>& motion)
|
||||
{
|
||||
const char* loc = __FUNCTION__;
|
||||
|
||||
bool r = false;
|
||||
T val = 0.0;
|
||||
|
||||
if (Atof(attStr, val))
|
||||
{
|
||||
motion.m_MotionParams.push_back(pair<eFlameMotionParam, T>(param, val));
|
||||
motion.m_MotionParams.push_back(MotionParam<T>(param, val));
|
||||
r = true;
|
||||
} else {
|
||||
m_ErrorReport.push_back(string(loc) + " : Failed to parse float value for flame motion attribute \"" + string(CCX(att->name)) + "\" : " + string(attStr) + "");
|
||||
}
|
||||
else
|
||||
{
|
||||
m_ErrorReport.push_back(string(loc) + " : Failed to parse float value for flame motion attribute \"" + string(CCX(att->name)) + "\" : " + string(attStr));
|
||||
}
|
||||
|
||||
return r;
|
||||
|
@ -375,7 +375,7 @@ public:
|
||||
INITDOUBLEOPTION(OffsetX, Eod(OPT_USE_GENOME, OPT_OFFSETX, _T("--offsetx"), 0.0, SO_REQ_SEP, "\t--offsetx=<val> Amount to jitter each flame horizontally when applying genome tools [default: 0].\n"));
|
||||
INITDOUBLEOPTION(OffsetY, Eod(OPT_USE_GENOME, OPT_OFFSETY, _T("--offsety"), 0.0, SO_REQ_SEP, "\t--offsety=<val> Amount to jitter each flame vertically when applying genome tools [default: 0].\n"));
|
||||
INITDOUBLEOPTION(UseMem, Eod(OPT_USE_RENDER, OPT_USEMEM, _T("--use_mem"), 0.0, SO_REQ_SEP, "\t--use_mem=<val> Number of bytes of memory to use [default: max system memory].\n"));
|
||||
INITDOUBLEOPTION(Loops, Eod(OPT_USE_GENOME, OPT_LOOPS, _T("--loops"), 1, SO_REQ_SEP, "\t--loops=<val> Number of times to rotate each control point in sequence [default: 1].\n"));
|
||||
INITDOUBLEOPTION(Loops, Eod(OPT_USE_GENOME, OPT_LOOPS, _T("--loops"), 1.0, SO_REQ_SEP, "\t--loops=<val> Number of times to rotate each control point in sequence [default: 1].\n"));
|
||||
|
||||
//String.
|
||||
INITSTRINGOPTION(IsaacSeed, Eos(OPT_USE_ALL, OPT_ISAAC_SEED, _T("--isaac_seed"), "", SO_REQ_SEP, "\t--isaac_seed=<val> Character-based seed for the random number generator [default: random].\n"));
|
||||
|
@ -395,14 +395,14 @@ bool EmberGenome(EmberOptions& opt)
|
||||
if (i < embers.size() - 1)
|
||||
{
|
||||
vector<Ember<T>> interpEmbers;
|
||||
|
||||
interpEmbers.push_back(embers[i]);
|
||||
interpEmbers.push_back(embers[i + 1]);
|
||||
|
||||
if (opt.Loops() > 0)
|
||||
{
|
||||
// we might have looped a non-integral number of times, so store the last result as our flame to interpolate from
|
||||
|
||||
interpEmbers[i] = result;
|
||||
//We might have looped a non-integral number of times, so store the last result as our flame to interpolate from.
|
||||
interpEmbers[i] = result;
|
||||
}
|
||||
|
||||
for (frame = 0; frame < opt.Frames(); frame++)
|
||||
|
Loading…
Reference in New Issue
Block a user