Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
762055a
commit 6fa340d
Showing
27 changed files
with
1,616 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
/* | ||
Copyright (c) 2008-2009 NetAllied Systems GmbH | ||
This file is part of COLLADAMaya. | ||
Portions of the code are: | ||
Copyright (c) 2005-2007 Feeling Software Inc. | ||
Copyright (c) 2005-2007 Sony Computer Entertainment America | ||
Copyright (c) 2004-2005 Alias Systems Corp. | ||
Licensed under the MIT Open Source License, | ||
for details please see LICENSE file or the website | ||
http://www.opensource.org/licenses/mit-license.php | ||
*/ | ||
|
||
#ifndef __COLLADA_MAYA_PHYSIC_SCENE_EXPORTER_H__ | ||
#define __COLLADA_MAYA_PHYSIC_SCENE_EXPORTER_H__ | ||
|
||
#include "COLLADAMayaStableHeaders.h" | ||
#include "COLLADASWLibraryPhysicsScenes.h" | ||
#include "COLLADASWStreamWriter.h" | ||
#include "COLLADASWInstanceRigidBody.h" | ||
|
||
#include "COLLADAMayaDocumentExporter.h" | ||
#include "COLLADAMayaSceneElement.h" | ||
|
||
#include "COLLADABUIDList.h" | ||
|
||
#include <maya/MDagPath.h> | ||
#include <maya/MFnTransform.h> | ||
#include <maya/MFnMesh.h> | ||
|
||
|
||
class DocumentExporter; | ||
|
||
namespace COLLADAMaya | ||
{ | ||
|
||
/** | ||
* Exports the transform data of the visual scene. | ||
* | ||
* All transform components with units will be in maya's internal units | ||
* (radians for rotations and centimeters for translations). | ||
* We have to translate them into the working units of the current scene! | ||
*/ | ||
class PhysicSceneExporter : public COLLADASW::LibraryPhysicsScenes | ||
{ | ||
|
||
private: | ||
|
||
/** The id of the current scene. */ | ||
String mSceneId; | ||
|
||
/** Pointer to the document exporter. */ | ||
DocumentExporter* mDocumentExporter; | ||
|
||
|
||
public: | ||
|
||
/** | ||
* Constructor | ||
* @param streamWriter Pointer to the collada stream writer. | ||
* @param documentExporter Pointer to the main document exporter. | ||
* @param sceneId Name of the current scene to export. Has an empty string as default value. | ||
*/ | ||
PhysicSceneExporter ( COLLADASW::StreamWriter* streamWriter, | ||
DocumentExporter* documentExporter, | ||
const String& sceneId = EMPTY_STRING ); | ||
/** | ||
* Destructor. | ||
*/ | ||
virtual ~PhysicSceneExporter() {}; | ||
|
||
/** | ||
* Exports the visual scene with the transforms of all included elements | ||
*/ | ||
bool exportPhysicScenes(); | ||
}; | ||
|
||
} | ||
|
||
#endif //__COLLADA_MAYA_VISUAL_SCENE_EXPORTER_H__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
/* | ||
Copyright (c) 2008-2009 NetAllied Systems GmbH | ||
This file is part of COLLADAMaya. | ||
Portions of the code are: | ||
Copyright (c) 2005-2007 Feeling Software Inc. | ||
Copyright (c) 2005-2007 Sony Computer Entertainment America | ||
Copyright (c) 2004-2005 Alias Systems Corp. | ||
Licensed under the MIT Open Source License, | ||
for details please see LICENSE file or the website | ||
http://www.opensource.org/licenses/mit-license.php | ||
*/ | ||
#ifndef __COLLADA_MAYA_PHYSICS_EXPORTER_H__ | ||
#define __COLLADA_MAYA_PHYSICS_EXPORTER_H__ | ||
|
||
#include "COLLADAMayaStableHeaders.h" | ||
#include "COLLADAMayaDocumentExporter.h" | ||
#include "COLLADAMayaSceneElement.h" | ||
#include <vector> | ||
#include <time.h> | ||
#include <maya/MFnMesh.h> | ||
#include <maya/MDagPath.h> | ||
#include "COLLADASWStreamWriter.h" | ||
#include "COLLADASWLibraryPhysicsModels.h" | ||
#include "COLLADABUIDList.h" | ||
|
||
|
||
namespace COLLADAMaya | ||
{ | ||
|
||
class DocumentExporter; | ||
class ElementWriter; | ||
|
||
|
||
|
||
/************************************************************************/ | ||
/* This class writes the <library_geometries>. */ | ||
/************************************************************************/ | ||
class PhysicsExporter : public COLLADASW::LibraryPhysicsModels | ||
{ | ||
|
||
private: | ||
|
||
/** | ||
* The list of the unique collada ids. | ||
*/ | ||
COLLADABU::IDList mPhysicsIdList; | ||
|
||
/** | ||
* Pointer to the document exporter. | ||
*/ | ||
DocumentExporter* mDocumentExporter; | ||
|
||
/** | ||
* A collada id for every maya id. | ||
*/ | ||
StringToStringMap mMayaIdColladaIdMap; | ||
|
||
|
||
public: | ||
|
||
typedef struct BodyTarget { | ||
String Body; | ||
String Target; | ||
} BodyTarget; | ||
|
||
typedef std::map<String, BodyTarget> RB_Map; | ||
|
||
/* @param streamWriter The stream the output will be written to */ | ||
PhysicsExporter ( COLLADASW::StreamWriter* streamWriter, DocumentExporter* documentExporter ); | ||
virtual ~PhysicsExporter(); | ||
|
||
/** Walk through the scene graph and export all geometries. */ | ||
void exportAllPhysics(); | ||
|
||
/** closes the physics tags in the collada document */ | ||
void endExport(); | ||
|
||
/** Generate the collada id, if not done before and stores it in the scene element. */ | ||
const String generateColladaMeshId ( const MDagPath dagPath ); | ||
|
||
/** export physic element */ | ||
void exportPhysics ( SceneElement* sceneElement ); | ||
|
||
/** Returns the collada geometry id of the current physics node. */ | ||
const String& getColladaPhysicsId ( MDagPath dagPath ); | ||
|
||
// static RB_Map& getRB_Map() { return myMap; } | ||
|
||
static RB_Map myMap; | ||
|
||
private: | ||
|
||
/** | ||
* A collada id for every maya id. | ||
*/ | ||
const String& findColladaPhysicsId ( const String& mayaPhysicsId ); | ||
|
||
/** Returns the tolerance value for double value comparison. */ | ||
const double getTolerance () const | ||
{ | ||
return mDocumentExporter->getTolerance (); | ||
} | ||
|
||
/** Exports the current scene element and all it's children. */ | ||
void exportAllPhysics ( SceneElement* sceneElement, bool isVisible ); | ||
|
||
/** export physic element */ | ||
bool exportPhysicsElement(SceneElement* sceneElement); | ||
|
||
/** Exports all physics data of the current mesh. */ | ||
bool exportPhysicModel(MDagPath& dagPath); | ||
|
||
void createShape(MDagPath& childDagPath); | ||
|
||
void exportDecomposedTransform(); | ||
void exportTranslation(const String name, const MPoint& translation); | ||
void exportTranslation(const String name, const MVector& translation); | ||
void exportRotation(const String name, const MEulerRotation& rotation); | ||
|
||
bool mIsJoint; | ||
bool mIsFirstRotation; | ||
MTransformationMatrix mTransformMatrix; | ||
MObject mTransformObject; | ||
}; | ||
} | ||
|
||
#endif //__COLLADA_MAYA_PHYSICS_EXPORTER_H__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#ifndef __COLLADAMAYA_VERSIONINFO_H__ | ||
#define __COLLADAMAYA_VERSIONINFO_H__ | ||
|
||
#include "COLLADAMayaPrerequisites.h" | ||
|
||
namespace COLLADAMaya | ||
{ | ||
const String CURRENT_REVISION = "3b4d80c"; | ||
const String CURRENT_PLATFORM = "x64"; | ||
const String CURRENT_CONFIGURATION = "DebugPlugin2015"; | ||
} | ||
|
||
#endif // __COLLADAMAYA_VERSIONINFO_H__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.