You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
openmw-tes3mp/apps/openmw/mwclass/static.cpp

55 lines
1.4 KiB
C++

#include "static.hpp"
#include <components/esm/loadstat.hpp>
#include "../mwworld/ptr.hpp"
#include "../mwworld/physicssystem.hpp"
13 years ago
#include "../mwrender/objects.hpp"
#include "../mwrender/renderinginterface.hpp"
namespace MWClass
{
void Static::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const
{
MWWorld::LiveCellRef<ESM::Static> *ref =
ptr.get<ESM::Static>();
assert (ref->base != NULL);
const std::string &model = ref->base->model;
13 years ago
if (!model.empty())
{
MWRender::Objects& objects = renderingInterface.getObjects();
objects.insertBegin(ptr, ptr.getRefData().isEnabled(), true);
objects.insertMesh(ptr, "meshes\\" + model);
}
}
void Static::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics) const
{
MWWorld::LiveCellRef<ESM::Static> *ref =
ptr.get<ESM::Static>();
assert (ref->base != NULL);
const std::string &model = ref->base->model;
if(!model.empty()){
13 years ago
physics.insertObjectPhysics(ptr, "meshes\\" + model);
}
}
std::string Static::getName (const MWWorld::Ptr& ptr) const
{
return "";
}
void Static::registerSelf()
{
boost::shared_ptr<Class> instance (new Static);
registerClass (typeid (ESM::Static).name(), instance);
}
}