Skip to content
Snippets Groups Projects
Commit fc6bf0d4 authored by LogicDragon's avatar LogicDragon
Browse files

Added AddEntity, RemoveEntity, ClearEntities, GetEntities to bhkConstraint

parent dd61b979
No related branches found
No related tags found
No related merge requests found
......@@ -55,6 +55,27 @@ public:
NIFLIB_API virtual const Type & GetType() const;
//--BEGIN MISC CUSTOM CODE--//
/*!
* Adds an entity to this bhkConstraint.
*/
NIFLIB_API void AddEntity( bhkEntity * obj );
/*!
* Removes an entity from this bhkConstraint.
*/
NIFLIB_API void RemoveEntity( bhkEntity * obj );
/*!
* Removes all entities from this bhkConstraint.
*/
NIFLIB_API void ClearEntities();
/*!
* Retrieves all the entities attached to this bhkConstraint.
*/
NIFLIB_API vector< bhkEntity * > GetEntities() const;
//--END CUSTOM CODE--//
protected:
/*! Number of bodies affected by this constraint. */
......
......@@ -145,4 +145,28 @@ std::list<NiObject *> bhkConstraint::GetPtrs() const {
}
//--BEGIN MISC CUSTOM CODE--//
void bhkConstraint::AddEntity( bhkEntity * obj ) {
entities.push_back( obj );
}
void bhkConstraint::RemoveEntity( bhkEntity * obj ) {
//Search Effect list for the one to remove
for ( vector< bhkEntity * >::iterator it = entities.begin(); it != entities.end(); ) {
if ( *it == obj ) {
it = entities.erase( it );
} else {
++it;
}
}
}
void bhkConstraint::ClearEntities() {
entities.clear();
}
vector< bhkEntity * > bhkConstraint::GetEntities() const {
return entities;
}
//--END CUSTOM CODE--//
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment