MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / setFloatVariable

Function setFloatVariable

Engine/source/console/console.cpp:908–925  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

906}
907
908void setFloatVariable(const char *varName, F32 value)
909{
910 SimObject *obj = NULL;
911 const char *objField = NULL;
912
913 if (getVariableObjectField(varName, &obj, &objField))
914 {
915 char varBuffer[32];
916 dSprintf(varBuffer, sizeof(varBuffer), "%g", value);
917 obj->setDataField(StringTable->insert(objField), 0, varBuffer);
918 }
919 else
920 {
921 varName = prependDollar(varName);
922 Dictionary::Entry *entry = getAddVariableEntry(varName);
923 entry->setFloatValue(value);
924 }
925}
926
927//---------------------------------------------------------------------------
928void addConsumer(ConsumerCallback consumer)

Callers 8

setTimeScaleMethod · 0.85
initMethod · 0.85
setTimeScaleMethod · 0.85
_setupConstantsMethod · 0.85
DefineNewEngineFunctionFunction · 0.85
processTimeEventFunction · 0.85
setFloatVariableMethod · 0.85
_updateThumbMethod · 0.85

Calls 7

getVariableObjectFieldFunction · 0.85
dSprintfFunction · 0.85
prependDollarFunction · 0.85
getAddVariableEntryFunction · 0.85
setDataFieldMethod · 0.45
insertMethod · 0.45
setFloatValueMethod · 0.45

Tested by

no test coverage detected