Skip to content
This repository has been archived by the owner on Dec 3, 2022. It is now read-only.

Commit

Permalink
NxOgre Druha Special Edition.
Browse files Browse the repository at this point in the history
[Changed] const_iterator to iterator in erase functions in PtrMultiHashmap
[Added] destroyActor in Scene
  • Loading branch information
betajaen committed Dec 12, 2009
1 parent e563725 commit e260428
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
4 changes: 2 additions & 2 deletions build/source/NxOgrePtrMultiHashmap.h
Expand Up @@ -203,7 +203,7 @@ template<typename type> class ptr_multihashmap
// Erase a pointer from the multimap then delete it.
void erase(key_type& key)
{
multimap_type::const_iterator it = multimap.find(key);
multimap_type::iterator it = multimap.find(key);
if (it == multimap.end())
return;

Expand All @@ -215,7 +215,7 @@ template<typename type> class ptr_multihashmap
// Erase a pointer from the multimap then delete it.
void erase(const key_type& key)
{
multimap_type::const_iterator it = multimap.find(key);
multimap_type::iterator it = multimap.find(key);
if (it == multimap.end())
return;

Expand Down
14 changes: 14 additions & 0 deletions build/source/NxOgreScene.cpp
Expand Up @@ -188,6 +188,20 @@ Actor* Scene::createActor(const ShapeDescription& shape, const Matrix44& pose, c
return actor;
}

bool Scene::destroyActor(NxOgre::Actor* actor)
{

if (actor == 0)
return false;

if (actor->isDynamic() == false)
return false;

mActors.erase(mActor);

return true;
}

SceneGeometry* Scene::createSceneGeometry(const ShapeDescriptions& shapes, const Matrix44& pose, const RigidBodyDescription& description)
{
SceneGeometry* sg = NXOGRE_NEW_NXOGRE(SceneGeometry)(shapes, pose, description, this);
Expand Down
2 changes: 1 addition & 1 deletion build/source/NxOgreScene.h
Expand Up @@ -138,7 +138,7 @@ class NxOgrePublicClass Scene : public BigClassAllocatable, public TimeListener
desc.
*/
void destroyActor(Actor*);
bool destroyActor(Actor*);

/*! function. createSceneGeometry
desc.
Expand Down

0 comments on commit e260428

Please sign in to comment.