1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-02-04 10:45:32 +00:00
openmw-tes3mp/apps/opencs/view/render/pathgridpoint.cpp

38 lines
1,011 B
C++

#include "pathgridpoint.hpp"
#include <iostream> // FIXME
#include <OgreSceneManager.h>
#include <OgreSceneNode.h>
//#include "../../model/world/pathgrid.hpp"
#include "../world/physicssystem.hpp"
#include "elements.hpp"
namespace CSVRender
{
PathgridPoint::PathgridPoint(const std::string &name,
Ogre::SceneNode *cellNode, const Ogre::Vector3 &pos, CSVWorld::PhysicsSystem *physics)
: mBase(cellNode), mPhysics(physics)
{
mBase = cellNode->createChildSceneNode();
mPgPoint = NifOgre::Loader::createObjects(mBase, "pathgrid_pt.nif");
mPgPoint->setVisibilityFlags(Element_Pathgrid);
mBase->setPosition(pos);
physics->addObject("pathgrid_pt.nif",
mBase->getName(), name, 1, pos, Ogre::Quaternion::IDENTITY);
}
PathgridPoint::~PathgridPoint()
{
mPgPoint.setNull();
mPhysics->removeObject(mBase->getName());
if (mBase)
mBase->getCreator()->destroySceneNode(mBase);
}
}