reformat with the help of AStyle reformat tool (codeblocks)
This commit is contained in:
parent
6530b16fc7
commit
6e79ce348d
@ -29,7 +29,8 @@ namespace osgAnimation
|
||||
|
||||
public:
|
||||
|
||||
enum Method {
|
||||
enum Method
|
||||
{
|
||||
NORMALIZED,
|
||||
RELATIVE
|
||||
};
|
||||
@ -108,20 +109,30 @@ namespace osgAnimation
|
||||
* @param weight The weight to be added to the \c MorphGeometry.
|
||||
* @return \c true for success; \c false otherwise.
|
||||
*/
|
||||
virtual void addMorphTarget( osg::Geometry *morphTarget, float weight = 1.0 ) { _morphTargets.push_back(MorphTarget(morphTarget, weight)); _dirty = true; }
|
||||
virtual void addMorphTarget( osg::Geometry *morphTarget, float weight = 1.0 )
|
||||
{
|
||||
_morphTargets.push_back(MorphTarget(morphTarget, weight));
|
||||
_dirty = true;
|
||||
}
|
||||
|
||||
virtual void removeMorphTarget( osg::Geometry *morphTarget ) {
|
||||
for(MorphTargetList::iterator iterator = _morphTargets.begin() ; iterator != _morphTargets.end() ; ++ iterator) {
|
||||
if(iterator->getGeometry() == morphTarget) {
|
||||
virtual void removeMorphTarget( osg::Geometry *morphTarget )
|
||||
{
|
||||
for(MorphTargetList::iterator iterator = _morphTargets.begin() ; iterator != _morphTargets.end() ; ++ iterator)
|
||||
{
|
||||
if(iterator->getGeometry() == morphTarget)
|
||||
{
|
||||
_morphTargets.erase(iterator);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
virtual void removeMorphTarget( const std::string& name ) {
|
||||
for(MorphTargetList::iterator iterator = _morphTargets.begin() ; iterator != _morphTargets.end() ; ++ iterator) {
|
||||
if(iterator->getGeometry() && iterator->getGeometry()->getName() == name) {
|
||||
virtual void removeMorphTarget( const std::string& name )
|
||||
{
|
||||
for(MorphTargetList::iterator iterator = _morphTargets.begin() ; iterator != _morphTargets.end() ; ++ iterator)
|
||||
{
|
||||
if(iterator->getGeometry() && iterator->getGeometry()->getName() == name)
|
||||
{
|
||||
_morphTargets.erase(iterator);
|
||||
break;
|
||||
}
|
||||
@ -175,7 +186,8 @@ namespace osgAnimation
|
||||
void addTarget(const std::string& name) { _targetNames.push_back(name); }
|
||||
unsigned int getNumTarget() const { return _targetNames.size(); }
|
||||
const std::string& getTargetName(unsigned int index) { return _targetNames[index]; }
|
||||
void removeTarget(const std::string& name) {
|
||||
void removeTarget(const std::string& name)
|
||||
{
|
||||
TargetNames::iterator found = std::find(_targetNames.begin(), _targetNames.end(), name);
|
||||
if(found != _targetNames.end())
|
||||
_targetNames.erase(found);
|
||||
@ -185,9 +197,7 @@ namespace osgAnimation
|
||||
const std::vector<std::string>& getTargetNames() const { return _targetNames; }
|
||||
std::vector<std::string>& getTargetNames() { return _targetNames; }
|
||||
|
||||
void setTargetNames(const TargetNames& targetNames) {
|
||||
_targetNames.assign(targetNames.begin(), targetNames.end());
|
||||
}
|
||||
void setTargetNames(const TargetNames& targetNames) { _targetNames.assign(targetNames.begin(), targetNames.end()); }
|
||||
|
||||
/** Callback method called by the NodeVisitor when visiting a node.*/
|
||||
virtual void operator()(osg::Node* node, osg::NodeVisitor* nv);
|
||||
@ -226,8 +236,6 @@ namespace osgAnimation
|
||||
(implementation)(*geom);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -54,7 +54,6 @@ namespace osgAnimation
|
||||
|
||||
bool init(MorphGeometry&);
|
||||
|
||||
|
||||
osg::ref_ptr<osg::Uniform> _uniformTargetsWeight;
|
||||
osg::ref_ptr<osg::Shader> _shader;
|
||||
|
||||
|
@ -23,7 +23,6 @@
|
||||
|
||||
namespace osgAnimation
|
||||
{
|
||||
|
||||
// The idea is to compute a bounding box with a factor x of the first step we compute the bounding box
|
||||
class OSGANIMATION_EXPORT RigComputeBoundingBoxCallback : public osg::Drawable::ComputeBoundingBoxCallback
|
||||
{
|
||||
@ -37,8 +36,8 @@ namespace osgAnimation
|
||||
|
||||
META_Object(osgAnimation, RigComputeBoundingBoxCallback);
|
||||
|
||||
|
||||
void reset() { _computed = false; }
|
||||
|
||||
virtual osg::BoundingBox computeBound(const osg::Drawable& drawable) const;
|
||||
protected:
|
||||
mutable bool _computed;
|
||||
@ -81,6 +80,7 @@ namespace osgAnimation
|
||||
void buildVertexInfluenceSet() { _rigTransformImplementation->prepareData(*this); }
|
||||
|
||||
const osg::Matrix& getMatrixFromSkeletonToGeometry() const;
|
||||
|
||||
const osg::Matrix& getInvMatrixFromSkeletonToGeometry() const;
|
||||
|
||||
inline osg::Geometry* getSourceGeometry() { return _geometry.get(); }
|
||||
@ -106,7 +106,6 @@ namespace osgAnimation
|
||||
|
||||
osg::ref_ptr<osg::Geometry> _geometry;
|
||||
osg::ref_ptr<RigTransform> _rigTransformImplementation;
|
||||
|
||||
osg::ref_ptr<VertexInfluenceMap> _vertexInfluenceMap;
|
||||
|
||||
osg::Matrix _matrixFromSkeletonToGeometry;
|
||||
@ -114,7 +113,6 @@ namespace osgAnimation
|
||||
osg::observer_ptr<Skeleton> _root;
|
||||
bool _needToComputeMatrix;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
@ -129,7 +127,8 @@ namespace osgAnimation
|
||||
|
||||
META_Object(osgAnimation, UpdateRigGeometry);
|
||||
|
||||
virtual void update(osg::NodeVisitor* nv, osg::Drawable* drw) {
|
||||
virtual void update(osg::NodeVisitor* nv, osg::Drawable* drw)
|
||||
{
|
||||
RigGeometry* geom = dynamic_cast<RigGeometry*>(drw);
|
||||
if(!geom)
|
||||
return;
|
||||
@ -155,7 +154,8 @@ namespace osgAnimation
|
||||
if(geom->getNeedToComputeMatrix())
|
||||
geom->computeMatrixFromRootSkeleton();
|
||||
|
||||
if(geom->getSourceGeometry()) {
|
||||
if(geom->getSourceGeometry())
|
||||
{
|
||||
osg::Drawable::UpdateCallback * up = dynamic_cast<osg::Drawable::UpdateCallback*>(geom->getSourceGeometry()->getUpdateCallback());
|
||||
if(up)
|
||||
up->update(nv, geom->getSourceGeometry());
|
||||
|
@ -43,7 +43,6 @@ namespace osgAnimation
|
||||
public:
|
||||
const std::string& getName() const { return _name; }
|
||||
void setName(const std::string& name) { _name = name; }
|
||||
|
||||
protected:
|
||||
// the name is the bone to link to
|
||||
std::string _name;
|
||||
@ -57,8 +56,8 @@ namespace osgAnimation
|
||||
VertexInfluenceMap() {}
|
||||
VertexInfluenceMap(const osgAnimation::VertexInfluenceMap& org, const osg::CopyOp& copyop):
|
||||
std::map<std::string, VertexInfluence>(org),
|
||||
osg::Object(org, copyop)
|
||||
{}
|
||||
osg::Object(org, copyop) {}
|
||||
|
||||
///normalize per vertex weights given numvert of the attached mesh
|
||||
void normalize(unsigned int numvert);
|
||||
|
||||
@ -83,7 +82,6 @@ namespace osgAnimation
|
||||
//Experimental removal of unexpressed bone from the skeleton
|
||||
void removeUnexpressedBones(Skeleton &skel) const;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user