Pyrogenesis  13997
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Macros | Functions | Variables
CommonConvert.h File Reference
#include <exception>
#include <string>
#include <memory>
#include <vector>

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

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

Throws a ColladaException unless the value is true.

Definition at line 119 of file CommonConvert.h.

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

Throws a ColladaException unless the status is successful.

Definition at line 122 of file CommonConvert.h.

#define STRINGIFY (   x)    #x

Definition at line 123 of file CommonConvert.h.

Function Documentation

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

Definition at line 265 of file CommonConvert.cpp.

const Skeleton& FindSkeleton ( const FCDControllerInstance &  controllerInstance)

Finds the skeleton definition which best matches the given controller.

Exceptions
ColladaExceptionif none is found.

Definition at line 381 of file CommonConvert.cpp.

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.

Definition at line 363 of file CommonConvert.cpp.

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

Definition at line 34 of file CommonConvert.cpp.

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.

Definition at line 303 of file CommonConvert.cpp.

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.

Definition at line 397 of file CommonConvert.cpp.

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

Outputs a structure, using sizeof to get the size.

Definition at line 128 of file CommonConvert.h.

Variable Documentation

FMMatrix44 FMMatrix44_Identity