|
Pyrogenesis
13997
|
#include "precompiled.h"#include "CommonConvert.h"#include "StdSkeletons.h"#include "XMLFix.h"#include "FCollada.h"#include "FCDocument/FCDSceneNode.h"#include "FCDocument/FCDSkinController.h"#include "FUtils/FUDaeSyntax.h"#include "FUtils/FUFileManager.h"#include <cassert>#include <algorithm>Go to the source code of this file.
Classes | |
| struct | FoundInstance |
Functions | |
| void | require_ (int line, bool value, const char *type, const char *message) |
| void | errorHandler (void *ctx, const char *msg,...) |
| Error handler for libxml2. More... | |
| const FMVector3 | FMVector3_XAxis (1.0f, 0.0f, 0.0f) |
| FMMatrix44 | FMMatrix44_Identity (identity) |
| static bool | IsVisible_XSI (FCDSceneNode *node, bool &visible) |
| static bool | IsVisible (FCDSceneNode *node) |
| static void | FindInstances (FCDSceneNode *node, std::vector< FoundInstance > &instances, const FMMatrix44 &transform, bool onlyMarked) |
| Recursively finds all entities under the current node. More... | |
| bool | FindSingleInstance (FCDSceneNode *node, FCDEntityInstance *&instance, FMMatrix44 &transform) |
| Tries to find a single suitable entity instance in the scene. More... | |
| static bool | ReverseSortWeight (const FCDJointWeightPair &a, const FCDJointWeightPair &b) |
| 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 Skeleton & | FindSkeleton (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 | |
| static float | identity [] = { 1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,1 } |
| void errorHandler | ( | void * | ctx, |
| const char * | msg, | ||
| ... | |||
| ) |
Error handler for libxml2.
Definition at line 43 of file CommonConvert.cpp.
|
static |
Recursively finds all entities under the current node.
If onlyMarked is set, only matches entities where the user-defined property was set to "export" in the modelling program.
| node | root of subtree to search |
| instances | output - appends matching entities |
| transform | transform matrix of current subtree |
| onlyMarked | only match entities with "export" property |
Definition at line 232 of file CommonConvert.cpp.
| 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.
| node | root scene node to search under |
| instance | output - the found entity instance (if any) |
| transform | - the world-space transform of the found entity |
Definition at line 265 of file CommonConvert.cpp.
| const Skeleton& FindSkeleton | ( | const FCDControllerInstance & | controllerInstance | ) |
Finds the skeleton definition which best matches the given controller.
| ColladaException | if 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.
| FMMatrix44 FMMatrix44_Identity | ( | identity | ) |
| const FMVector3 FMVector3_XAxis | ( | 1. | 0f, |
| 0. | 0f, | ||
| 0. | 0f | ||
| ) |
|
static |
Definition at line 209 of file CommonConvert.cpp.
|
static |
Definition at line 183 of file CommonConvert.cpp.
| void require_ | ( | int | line, |
| bool | value, | ||
| const char * | type, | ||
| const char * | message | ||
| ) |
Definition at line 34 of file CommonConvert.cpp.
|
static |
Definition at line 298 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.
|
static |
Definition at line 174 of file CommonConvert.cpp.
1.8.5