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

Added AddConstraint, RemoveConstraint, ClearConstraints, GetConstraints to bhkRigidBody

parent fc6bf0d4
No related branches found
No related tags found
No related merge requests found
...@@ -290,6 +290,26 @@ public: ...@@ -290,6 +290,26 @@ public:
// \param[in] value The new value. // \param[in] value The new value.
NIFLIB_API void SetSolverDeactivation( const SolverDeactivation & value ); NIFLIB_API void SetSolverDeactivation( const SolverDeactivation & value );
/*!
* Adds a constraint to this bhkRigidBody.
*/
NIFLIB_API void AddConstraint( bhkSerializable * obj );
/*!
* Removes a constraint from this bhkRigidBody.
*/
NIFLIB_API void RemoveConstraint( bhkSerializable * obj );
/*!
* Removes all constraints from this bhkRigidBody.
*/
NIFLIB_API void ClearConstraints();
/*!
* Retrieves all the constraints attached to this bhkRigidBody.
*/
NIFLIB_API vector< Ref<bhkSerializable> > GetConstraints() const;
// Apply scale factor <scale> on data. // Apply scale factor <scale> on data.
// \param[in] scale Factor to scale by // \param[in] scale Factor to scale by
NIFLIB_API void ApplyScale(float scale); NIFLIB_API void ApplyScale(float scale);
......
...@@ -447,6 +447,28 @@ void bhkRigidBody::SetSolverDeactivation( const SolverDeactivation & value ) { ...@@ -447,6 +447,28 @@ void bhkRigidBody::SetSolverDeactivation( const SolverDeactivation & value ) {
solverDeactivation = value; solverDeactivation = value;
} }
void bhkRigidBody::AddConstraint( bhkSerializable * obj ) {
constraints.push_back( obj );
}
void bhkRigidBody::RemoveConstraint( bhkSerializable * obj ) {
//Search Effect list for the one to remove
for ( vector< bhkSerializableRef >::iterator it = constraints.begin(); it != constraints.end(); ) {
if ( *it == obj ) {
it = constraints.erase( it );
} else {
++it;
}
}
}
void bhkRigidBody::ClearConstraints() {
constraints.clear();
}
vector< Ref<bhkSerializable> > bhkRigidBody::GetConstraints() const {
return constraints;
}
// Apply scale factor <scale> on data. // Apply scale factor <scale> on data.
......
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