Pyrogenesis  trunk
Classes | Macros | Functions | Variables
CommonConvert.h File Reference
#include <exception>
#include <string>
#include <memory>
#include <vector>
Include dependency graph for CommonConvert.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  ColladaException
 
struct  OutputCB
 
class  FColladaErrorHandler
 Standard error handler - logs FCollada messages using Log(), and also maintains a list of XML parser errors. More...
 
class  FColladaDocument
 Standard document loader. More...
 
class  CommonConvert
 Wrapper for code shared between the PMD and PSA converters. More...
 
struct  BoneTransform
 Bone pose data. More...
 

Macros

#define REQUIRE(value, message)   require_(__LINE__, value, "Assertion not satisfied", "failed requirement \"" message "\"")
 Throws a ColladaException unless the value is true. More...
 
#define REQUIRE_SUCCESS(status)   require_(__LINE__, status, "FCollada error", "Line " STRINGIFY(__LINE__))
 Throws a ColladaException unless the status is successful. More...
 
#define STRINGIFY(x)   #x
 

Functions

void require_ (int line, bool value, const char *type, const char *message)
 
template<typename T >
void write (OutputCB &output, const T &data)
 Outputs a structure, using sizeof to get the size. More...
 
bool FindSingleInstance (FCDSceneNode *node, FCDEntityInstance *&instance, FMMatrix44 &transform)
 Tries to find a single suitable entity instance in the scene. More...
 
void SkinReduceInfluences (FCDSkinController *skin, size_t maxInfluenceCount, float minimumWeight)
 Like FCDSkinController::ReduceInfluences but works correctly. More...
 
void FixSkeletonRoots (FCDControllerInstance &controllerInstance)
 Fixes some occasional problems with the skeleton root definitions in a controller. More...
 
const SkeletonFindSkeleton (const FCDControllerInstance &controllerInstance)
 Finds the skeleton definition which best matches the given controller. More...
 
void TransformBones (std::vector< BoneTransform > &bones, const FMMatrix44 &scaleTransform, bool yUp)
 Performs the standard transformations on bones, applying a scale matrix and moving them into the game's coordinate space. More...
 

Variables

FMMatrix44 FMMatrix44_Identity
 

Macro Definition Documentation

◆ REQUIRE

#define REQUIRE (   value,
  message 
)    require_(__LINE__, value, "Assertion not satisfied", "failed requirement \"" message "\"")

Throws a ColladaException unless the value is true.

◆ REQUIRE_SUCCESS

#define REQUIRE_SUCCESS (   status)    require_(__LINE__, status, "FCollada error", "Line " STRINGIFY(__LINE__))

Throws a ColladaException unless the status is successful.

◆ STRINGIFY

#define STRINGIFY (   x)    #x

Function Documentation

◆ FindSingleInstance()

bool FindSingleInstance ( FCDSceneNode *  node,
FCDEntityInstance *&  instance,
FMMatrix44 &  transform 
)

Tries to find a single suitable entity instance in the scene.

Fails if there are none, or if there are too many and it's not clear which one should be converted.

Parameters
noderoot scene node to search under
instanceoutput - the found entity instance (if any)
transform- the world-space transform of the found entity
Returns
true if one was found

◆ FindSkeleton()

const Skeleton& FindSkeleton ( const FCDControllerInstance &  controllerInstance)

Finds the skeleton definition which best matches the given controller.

Exceptions
ColladaExceptionif none is found.

◆ FixSkeletonRoots()

void FixSkeletonRoots ( FCDControllerInstance &  controllerInstance)

Fixes some occasional problems with the skeleton root definitions in a controller.

(In particular, it's needed for models exported from XSI.) Should be called before extracting any joint information from the controller.

◆ require_()

void require_ ( int  line,
bool  value,
const char *  type,
const char *  message 
)

◆ SkinReduceInfluences()

void SkinReduceInfluences ( FCDSkinController *  skin,
size_t  maxInfluenceCount,
float  minimumWeight 
)

Like FCDSkinController::ReduceInfluences but works correctly.

Additionally, multiple influences for the same joint-vertex pair are collapsed into a single influence.

◆ TransformBones()

void TransformBones ( std::vector< BoneTransform > &  bones,
const FMMatrix44 &  scaleTransform,
bool  yUp 
)

Performs the standard transformations on bones, applying a scale matrix and moving them into the game's coordinate space.

◆ write()

template<typename T >
void write ( OutputCB output,
const T data 
)

Outputs a structure, using sizeof to get the size.

Variable Documentation

◆ FMMatrix44_Identity

FMMatrix44 FMMatrix44_Identity