3DCoat Core API
The 3DCoat API documentation.
Loading...
Searching...
No Matches
coat::utils Class Reference

Static Public Member Functions

static vec4 dwordToVec4 (unsigned int d)
 convert DWORD (unsigned int) to vec4
 
static unsigned vec4ToDword (const vec4 &v)
 convert vec4 to DWORD (unsigned int)
 
static void randomize (int seed)
 set the random seed for all further random value generation
 
static float random01 ()
 get the random value 0..1
 
static float random (float min, float max)
 get the random value in range
 
static vec3 randomNormal ()
 get the normalized random vector
 
static vec3 perlin3d (vec3 p, float seed=0)
 returns the perlin noise 3d vector
 
static float perlin (vec3 p, float seed=0)
 generate the perlin noise value
 
static const char * getEnumValueByIndex (const char *enumID, int index)
 get the value from the global strings list by index. That lists used in dropdown boxes in UI
 
static int getEnumValue (const char *enumID, const char *key)
 get the integer value that corresponds to the string value from the global strings list.
 
static int getEnumValueIndex (const char *enumID, const char *key)
 get the index of the value in the global strings list. That lists used in dropdown boxes in UI
 
static int getEnumValuesCount (const char *enumID)
 get the count of the values in the global strings list. That lists used in dropdown boxes in UI
 
static void clearEnum (const char *enumID)
 clear the global strings list.
 
static void addEnumValue (const char *enumID, const char *key, int value=- 1)
 add the value to the global strings list.
 
static void quit ()
 exit the 3DCoat
 
static void testSuccessful ()
 report that the test was successful. In this case the file "InstallFolder/.installer/test_success.txt created
 
static void testFailed (const char *message)
 report that the test was successful. In this case the file "InstallFolder/.installer/test_failed.txt created
 
static void signal (const char *message)
 send some message to 3DCoat (usually used for internal purposes)
 
static std::vector< std::string > & last_signals ()
 get the list of last signals sent to 3DCoat
 
static float getFPS ()
 get the current FPS
 
static float getFrameTimeMs ()
 get the frame time in milliseconds
 
static bool inRenderProcess ()
 check if the viewport is in render process in render room
 
static void set (const char *key, const char *value)
 Globally set the value for the key, it is even stored between sessions of the 3DCoat.
 
static const char * get (const char *key)
 Get previously stored value by the key.
 

Member Function Documentation

◆ addEnumValue()

static void coat::utils::addEnumValue ( const char * enumID,
const char * key,
int value = - 1 )
static

add the value to the global strings list.

Parameters
enumIDthe enumerator ID
keythe string to add
valuethe integer value that corresponds to the string, -1 means that the value will be the index of the string in the list, it is default value

◆ clearEnum()

static void coat::utils::clearEnum ( const char * enumID)
static

clear the global strings list.

Parameters
enumIDthe enumerator ID

◆ dwordToVec4()

static vec4 coat::utils::dwordToVec4 ( unsigned int d)
static

convert DWORD (unsigned int) to vec4

Parameters
dthe DWORD (unsigned int)
Returns
the 4d vector

◆ get()

static const char * coat::utils::get ( const char * key)
static

Get previously stored value by the key.

Parameters
keythe key
Returns
the value as string, empty string if not found

◆ getEnumValue()

static int coat::utils::getEnumValue ( const char * enumID,
const char * key )
static

get the integer value that corresponds to the string value from the global strings list.

Parameters
enumIDthe enumerator ID
keythe string value fo find
Returns
the integer value that corresponds to the string

◆ getEnumValueByIndex()

static const char * coat::utils::getEnumValueByIndex ( const char * enumID,
int index )
static

get the value from the global strings list by index. That lists used in dropdown boxes in UI

Parameters
enumIDthe enumerator ID
indexthe index of the value
Returns
the string

◆ getEnumValueIndex()

static int coat::utils::getEnumValueIndex ( const char * enumID,
const char * key )
static

get the index of the value in the global strings list. That lists used in dropdown boxes in UI

Parameters
enumIDthe enumerator ID
keythe value to find
Returns
the index of the value, -1 means that value not found

◆ getEnumValuesCount()

static int coat::utils::getEnumValuesCount ( const char * enumID)
static

get the count of the values in the global strings list. That lists used in dropdown boxes in UI

Parameters
enumIDthe enumerator ID
Returns
the count of the values

◆ getFPS()

static float coat::utils::getFPS ( )
static

get the current FPS

Returns
the fps value (averaged)

◆ getFrameTimeMs()

static float coat::utils::getFrameTimeMs ( )
static

get the frame time in milliseconds

Returns
the milliseconds amount

◆ inRenderProcess()

static bool coat::utils::inRenderProcess ( )
static

check if the viewport is in render process in render room

Returns
true if in render

◆ last_signals()

static std::vector< std::string > & coat::utils::last_signals ( )
static

get the list of last signals sent to 3DCoat

Returns
the list reference

◆ perlin()

static float coat::utils::perlin ( vec3 p,
float seed = 0 )
static

generate the perlin noise value

Parameters
pthe value in 3d space
seedthe seed
Returns
the perlin noise value

◆ perlin3d()

static vec3 coat::utils::perlin3d ( vec3 p,
float seed = 0 )
static

returns the perlin noise 3d vector

Parameters
pthe value in 3d space
seedthe seed
Returns
the perlin noise value

◆ random()

static float coat::utils::random ( float min,
float max )
static

get the random value in range

Parameters
minlow bound
maxhigh bound
Returns
the random value

◆ random01()

static float coat::utils::random01 ( )
static

get the random value 0..1

Returns
the random value

◆ randomize()

static void coat::utils::randomize ( int seed)
static

set the random seed for all further random value generation

Parameters
seedthe seed

◆ randomNormal()

static vec3 coat::utils::randomNormal ( )
static

get the normalized random vector

Returns
the 3d random vector

◆ set()

static void coat::utils::set ( const char * key,
const char * value )
static

Globally set the value for the key, it is even stored between sessions of the 3DCoat.

Parameters
keythe key
valuethe value to store

◆ signal()

static void coat::utils::signal ( const char * message)
static

send some message to 3DCoat (usually used for internal purposes)

Parameters
messagethe message

◆ testFailed()

static void coat::utils::testFailed ( const char * message)
static

report that the test was successful. In this case the file "InstallFolder/.installer/test_failed.txt created

Parameters
messagethe message to put into that file

◆ vec4ToDword()

static unsigned coat::utils::vec4ToDword ( const vec4 & v)
static

convert vec4 to DWORD (unsigned int)

Parameters
vthe 4d vector
Returns
the DWORD (unsigned int)

The documentation for this class was generated from the following file: