Game Development Community

FxSceneWindow2D::setCameraInterpolationMode("SIGMOID")

by Hans Sjunnesson · in Torque Game Builder · 09/02/2005 (1:36 am) · 3 replies

Just a quick FYI, there's a typo in the T2D docs. The docs state that there are two modes which you can insert into setCameraInterpolationMode, and those are "LINEAR" and "SIGMOID", but a quick look at fxSceneWindow2D.cc shows that...

//-----------------------------------------------------------------------------
// Interpolation Mode Table.
//-----------------------------------------------------------------------------
static EnumTable::Enums interpolationModeLookup[] =
				{
				{ fxSceneWindow2D::LINEAR,	"LINEAR" },
				{ fxSceneWindow2D::SIGMOID,	"SLERP" },
				};

static EnumTable interpolationModeTable(2, &interpolationModeLookup[0]);

//-----------------------------------------------------------------------------
// Interpolation Mode Script-Enumerator.
//-----------------------------------------------------------------------------
static fxSceneWindow2D::eCameraInterpolationMode getInterpolationMode(const char* label)
{
	// Search for Mnemonic.
	for(U32 i = 0; i < (sizeof(interpolationModeLookup) / sizeof(interpolationModeLookup[0])); i++)
		if( dStricmp(interpolationModeLookup[i].label, label) == 0)
			return((fxSceneWindow2D::eCameraInterpolationMode)interpolationModeLookup[i].index);

	// Invalid Interpolation Mode!
	AssertFatal(false, "fxSceneWindow2D::getInterpolationMode() - Invalid Interpolation Mode!");
	// Bah!
	return fxSceneWindow2D::SIGMOID;
}

the string you need to use is actually "SLERP", not "SIGMOID".

--
Hans

#1
09/02/2005 (1:44 am)
Thanks Hans, that one is still in the latest build so I just changed it to "SIGMOID". I guess people didn't use it much.

- Melv.
#2
09/02/2005 (1:46 am)
That's odd, I distinctly remember using "SIGMOID" in the 1.0 release.
#3
09/02/2005 (2:32 am)
Maybe for some unknown reason it got changed in v1.0.2. Ghosts in the machine. ;)

- Melv.