mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-20 07:23:51 +00:00
Updating the rest of mwclass
This commit is contained in:
parent
62d8d1add2
commit
c7dadec840
34 changed files with 369 additions and 351 deletions
|
@ -11,23 +11,36 @@
|
||||||
|
|
||||||
namespace MWClass
|
namespace MWClass
|
||||||
{
|
{
|
||||||
void Activator::insertObj (const MWWorld::Ptr& ptr, MWRender::CellRenderImp& cellRender,
|
void Activator::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const
|
||||||
MWWorld::Environment& environment) const
|
|
||||||
{
|
{
|
||||||
ESMS::LiveCellRef<ESM::Activator, MWWorld::RefData> *ref =
|
ESMS::LiveCellRef<ESM::Activator, MWWorld::RefData> *ref =
|
||||||
ptr.get<ESM::Activator>();
|
ptr.get<ESM::Activator>();
|
||||||
|
|
||||||
assert (ref->base != NULL);
|
assert (ref->base != NULL);
|
||||||
const std::string &model = ref->base->model;
|
const std::string &model = ref->base->model;
|
||||||
|
|
||||||
if (!model.empty())
|
if (!model.empty())
|
||||||
{
|
{
|
||||||
MWRender::Rendering rendering (cellRender, ref->ref, ref->mData);
|
MWRender::Objects objects = renderingInterface.getObjects();
|
||||||
cellRender.insertMesh ("meshes\\" + model);
|
objects.insertBegin(ptr, ptr.getRefData().isEnabled(), false);
|
||||||
cellRender.insertObjectPhysics();
|
objects.insertMesh(ptr, "meshes\\" + model);
|
||||||
ref->mData.setHandle (rendering.end (ref->mData.isEnabled()));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Activator::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics, MWWorld::Environment& environment) const
|
||||||
|
{
|
||||||
|
ESMS::LiveCellRef<ESM::Activator, MWWorld::RefData> *ref =
|
||||||
|
ptr.get<ESM::Activator>();
|
||||||
|
|
||||||
|
|
||||||
|
const std::string &model = ref->base->model;
|
||||||
|
assert (ref->base != NULL);
|
||||||
|
if(!model.empty()){
|
||||||
|
physics.insertObjectPhysics(ptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
std::string Activator::getName (const MWWorld::Ptr& ptr) const
|
std::string Activator::getName (const MWWorld::Ptr& ptr) const
|
||||||
{
|
{
|
||||||
ESMS::LiveCellRef<ESM::Activator, MWWorld::RefData> *ref =
|
ESMS::LiveCellRef<ESM::Activator, MWWorld::RefData> *ref =
|
||||||
|
|
|
@ -9,10 +9,11 @@ namespace MWClass
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
virtual void insertObj (const MWWorld::Ptr& ptr, MWRender::CellRenderImp& cellRender,
|
virtual void insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const;
|
||||||
MWWorld::Environment& environment) const;
|
|
||||||
///< Add reference into a cell for rendering
|
///< Add reference into a cell for rendering
|
||||||
|
|
||||||
|
virtual void insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics, MWWorld::Environment& environment) const;
|
||||||
|
|
||||||
virtual std::string getName (const MWWorld::Ptr& ptr) const;
|
virtual std::string getName (const MWWorld::Ptr& ptr) const;
|
||||||
///< \return name (the one that is to be presented to the user; not the internal one);
|
///< \return name (the one that is to be presented to the user; not the internal one);
|
||||||
/// can return an empty string.
|
/// can return an empty string.
|
||||||
|
|
|
@ -14,23 +14,36 @@
|
||||||
|
|
||||||
namespace MWClass
|
namespace MWClass
|
||||||
{
|
{
|
||||||
void Apparatus::insertObj (const MWWorld::Ptr& ptr, MWRender::CellRenderImp& cellRender,
|
void Apparatus::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const
|
||||||
MWWorld::Environment& environment) const
|
|
||||||
{
|
{
|
||||||
ESMS::LiveCellRef<ESM::Apparatus, MWWorld::RefData> *ref =
|
ESMS::LiveCellRef<ESM::Apparatus, MWWorld::RefData> *ref =
|
||||||
ptr.get<ESM::Apparatus>();
|
ptr.get<ESM::Apparatus>();
|
||||||
|
|
||||||
assert (ref->base != NULL);
|
assert (ref->base != NULL);
|
||||||
const std::string &model = ref->base->model;
|
const std::string &model = ref->base->model;
|
||||||
|
|
||||||
if (!model.empty())
|
if (!model.empty())
|
||||||
{
|
{
|
||||||
MWRender::Rendering rendering (cellRender, ref->ref, ref->mData);
|
MWRender::Objects objects = renderingInterface.getObjects();
|
||||||
cellRender.insertMesh ("meshes\\" + model);
|
objects.insertBegin(ptr, ptr.getRefData().isEnabled(), false);
|
||||||
cellRender.insertObjectPhysics();
|
objects.insertMesh(ptr, "meshes\\" + model);
|
||||||
ref->mData.setHandle (rendering.end (ref->mData.isEnabled()));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Apparatus::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics, MWWorld::Environment& environment) const
|
||||||
|
{
|
||||||
|
ESMS::LiveCellRef<ESM::Apparatus, MWWorld::RefData> *ref =
|
||||||
|
ptr.get<ESM::Apparatus>();
|
||||||
|
|
||||||
|
|
||||||
|
const std::string &model = ref->base->model;
|
||||||
|
assert (ref->base != NULL);
|
||||||
|
if(!model.empty()){
|
||||||
|
physics.insertObjectPhysics(ptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
std::string Apparatus::getName (const MWWorld::Ptr& ptr) const
|
std::string Apparatus::getName (const MWWorld::Ptr& ptr) const
|
||||||
{
|
{
|
||||||
ESMS::LiveCellRef<ESM::Apparatus, MWWorld::RefData> *ref =
|
ESMS::LiveCellRef<ESM::Apparatus, MWWorld::RefData> *ref =
|
||||||
|
|
|
@ -9,10 +9,11 @@ namespace MWClass
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
virtual void insertObj (const MWWorld::Ptr& ptr, MWRender::CellRenderImp& cellRender,
|
virtual void insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const;
|
||||||
MWWorld::Environment& environment) const;
|
|
||||||
///< Add reference into a cell for rendering
|
///< Add reference into a cell for rendering
|
||||||
|
|
||||||
|
virtual void insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics, MWWorld::Environment& environment) const;
|
||||||
|
|
||||||
virtual std::string getName (const MWWorld::Ptr& ptr) const;
|
virtual std::string getName (const MWWorld::Ptr& ptr) const;
|
||||||
///< \return name (the one that is to be presented to the user; not the internal one);
|
///< \return name (the one that is to be presented to the user; not the internal one);
|
||||||
/// can return an empty string.
|
/// can return an empty string.
|
||||||
|
|
|
@ -14,23 +14,35 @@
|
||||||
|
|
||||||
namespace MWClass
|
namespace MWClass
|
||||||
{
|
{
|
||||||
void Armor::insertObj (const MWWorld::Ptr& ptr, MWRender::CellRenderImp& cellRender,
|
void Armor::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const
|
||||||
MWWorld::Environment& environment) const
|
|
||||||
{
|
{
|
||||||
ESMS::LiveCellRef<ESM::Armor, MWWorld::RefData> *ref =
|
ESMS::LiveCellRef<ESM::Armor, MWWorld::RefData> *ref =
|
||||||
ptr.get<ESM::Armor>();
|
ptr.get<ESM::Armor>();
|
||||||
|
|
||||||
assert (ref->base != NULL);
|
assert (ref->base != NULL);
|
||||||
const std::string &model = ref->base->model;
|
const std::string &model = ref->base->model;
|
||||||
|
|
||||||
if (!model.empty())
|
if (!model.empty())
|
||||||
{
|
{
|
||||||
MWRender::Rendering rendering (cellRender, ref->ref, ref->mData);
|
MWRender::Objects objects = renderingInterface.getObjects();
|
||||||
cellRender.insertMesh ("meshes\\" + model);
|
objects.insertBegin(ptr, ptr.getRefData().isEnabled(), false);
|
||||||
cellRender.insertObjectPhysics();
|
objects.insertMesh(ptr, "meshes\\" + model);
|
||||||
ref->mData.setHandle (rendering.end (ref->mData.isEnabled()));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Armor::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics, MWWorld::Environment& environment) const
|
||||||
|
{
|
||||||
|
ESMS::LiveCellRef<ESM::Armor, MWWorld::RefData> *ref =
|
||||||
|
ptr.get<ESM::Armor>();
|
||||||
|
|
||||||
|
const std::string &model = ref->base->model;
|
||||||
|
assert (ref->base != NULL);
|
||||||
|
if(!model.empty()){
|
||||||
|
physics.insertObjectPhysics(ptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
std::string Armor::getName (const MWWorld::Ptr& ptr) const
|
std::string Armor::getName (const MWWorld::Ptr& ptr) const
|
||||||
{
|
{
|
||||||
ESMS::LiveCellRef<ESM::Armor, MWWorld::RefData> *ref =
|
ESMS::LiveCellRef<ESM::Armor, MWWorld::RefData> *ref =
|
||||||
|
|
|
@ -9,10 +9,11 @@ namespace MWClass
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
virtual void insertObj (const MWWorld::Ptr& ptr, MWRender::CellRenderImp& cellRender,
|
virtual void insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const;
|
||||||
MWWorld::Environment& environment) const;
|
|
||||||
///< Add reference into a cell for rendering
|
///< Add reference into a cell for rendering
|
||||||
|
|
||||||
|
virtual void insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics, MWWorld::Environment& environment) const;
|
||||||
|
|
||||||
virtual std::string getName (const MWWorld::Ptr& ptr) const;
|
virtual std::string getName (const MWWorld::Ptr& ptr) const;
|
||||||
///< \return name (the one that is to be presented to the user; not the internal one);
|
///< \return name (the one that is to be presented to the user; not the internal one);
|
||||||
/// can return an empty string.
|
/// can return an empty string.
|
||||||
|
|
|
@ -14,23 +14,36 @@
|
||||||
|
|
||||||
namespace MWClass
|
namespace MWClass
|
||||||
{
|
{
|
||||||
void Book::insertObj (const MWWorld::Ptr& ptr, MWRender::CellRenderImp& cellRender,
|
void Book::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const
|
||||||
MWWorld::Environment& environment) const
|
|
||||||
{
|
{
|
||||||
ESMS::LiveCellRef<ESM::Book, MWWorld::RefData> *ref =
|
ESMS::LiveCellRef<ESM::Book, MWWorld::RefData> *ref =
|
||||||
ptr.get<ESM::Book>();
|
ptr.get<ESM::Book>();
|
||||||
|
|
||||||
assert (ref->base != NULL);
|
assert (ref->base != NULL);
|
||||||
const std::string &model = ref->base->model;
|
const std::string &model = ref->base->model;
|
||||||
|
|
||||||
if (!model.empty())
|
if (!model.empty())
|
||||||
{
|
{
|
||||||
MWRender::Rendering rendering (cellRender, ref->ref, ref->mData);
|
MWRender::Objects objects = renderingInterface.getObjects();
|
||||||
cellRender.insertMesh ("meshes\\" + model);
|
objects.insertBegin(ptr, ptr.getRefData().isEnabled(), false);
|
||||||
cellRender.insertObjectPhysics();
|
objects.insertMesh(ptr, "meshes\\" + model);
|
||||||
ref->mData.setHandle (rendering.end (ref->mData.isEnabled()));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Book::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics, MWWorld::Environment& environment) const
|
||||||
|
{
|
||||||
|
ESMS::LiveCellRef<ESM::Book, MWWorld::RefData> *ref =
|
||||||
|
ptr.get<ESM::Book>();
|
||||||
|
|
||||||
|
|
||||||
|
const std::string &model = ref->base->model;
|
||||||
|
assert (ref->base != NULL);
|
||||||
|
if(!model.empty()){
|
||||||
|
physics.insertObjectPhysics(ptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
std::string Book::getName (const MWWorld::Ptr& ptr) const
|
std::string Book::getName (const MWWorld::Ptr& ptr) const
|
||||||
{
|
{
|
||||||
ESMS::LiveCellRef<ESM::Book, MWWorld::RefData> *ref =
|
ESMS::LiveCellRef<ESM::Book, MWWorld::RefData> *ref =
|
||||||
|
|
|
@ -9,10 +9,11 @@ namespace MWClass
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
virtual void insertObj (const MWWorld::Ptr& ptr, MWRender::CellRenderImp& cellRender,
|
virtual void insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const;
|
||||||
MWWorld::Environment& environment) const;
|
|
||||||
///< Add reference into a cell for rendering
|
///< Add reference into a cell for rendering
|
||||||
|
|
||||||
|
virtual void insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics, MWWorld::Environment& environment) const;
|
||||||
|
|
||||||
virtual std::string getName (const MWWorld::Ptr& ptr) const;
|
virtual std::string getName (const MWWorld::Ptr& ptr) const;
|
||||||
///< \return name (the one that is to be presented to the user; not the internal one);
|
///< \return name (the one that is to be presented to the user; not the internal one);
|
||||||
/// can return an empty string.
|
/// can return an empty string.
|
||||||
|
|
|
@ -14,23 +14,36 @@
|
||||||
|
|
||||||
namespace MWClass
|
namespace MWClass
|
||||||
{
|
{
|
||||||
void Clothing::insertObj (const MWWorld::Ptr& ptr, MWRender::CellRenderImp& cellRender,
|
void Clothing::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const
|
||||||
MWWorld::Environment& environment) const
|
|
||||||
{
|
{
|
||||||
ESMS::LiveCellRef<ESM::Clothing, MWWorld::RefData> *ref =
|
ESMS::LiveCellRef<ESM::Clothing, MWWorld::RefData> *ref =
|
||||||
ptr.get<ESM::Clothing>();
|
ptr.get<ESM::Clothing>();
|
||||||
|
|
||||||
assert (ref->base != NULL);
|
assert (ref->base != NULL);
|
||||||
const std::string &model = ref->base->model;
|
const std::string &model = ref->base->model;
|
||||||
|
|
||||||
if (!model.empty())
|
if (!model.empty())
|
||||||
{
|
{
|
||||||
MWRender::Rendering rendering (cellRender, ref->ref, ref->mData);
|
MWRender::Objects objects = renderingInterface.getObjects();
|
||||||
cellRender.insertMesh ("meshes\\" + model);
|
objects.insertBegin(ptr, ptr.getRefData().isEnabled(), false);
|
||||||
cellRender.insertObjectPhysics();
|
objects.insertMesh(ptr, "meshes\\" + model);
|
||||||
ref->mData.setHandle (rendering.end (ref->mData.isEnabled()));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Clothing::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics, MWWorld::Environment& environment) const
|
||||||
|
{
|
||||||
|
ESMS::LiveCellRef<ESM::Clothing, MWWorld::RefData> *ref =
|
||||||
|
ptr.get<ESM::Clothing>();
|
||||||
|
|
||||||
|
|
||||||
|
const std::string &model = ref->base->model;
|
||||||
|
assert (ref->base != NULL);
|
||||||
|
if(!model.empty()){
|
||||||
|
physics.insertObjectPhysics(ptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
std::string Clothing::getName (const MWWorld::Ptr& ptr) const
|
std::string Clothing::getName (const MWWorld::Ptr& ptr) const
|
||||||
{
|
{
|
||||||
ESMS::LiveCellRef<ESM::Clothing, MWWorld::RefData> *ref =
|
ESMS::LiveCellRef<ESM::Clothing, MWWorld::RefData> *ref =
|
||||||
|
|
|
@ -9,10 +9,11 @@ namespace MWClass
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
virtual void insertObj (const MWWorld::Ptr& ptr, MWRender::CellRenderImp& cellRender,
|
virtual void insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const;
|
||||||
MWWorld::Environment& environment) const;
|
|
||||||
///< Add reference into a cell for rendering
|
///< Add reference into a cell for rendering
|
||||||
|
|
||||||
|
virtual void insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics, MWWorld::Environment& environment) const;
|
||||||
|
|
||||||
virtual std::string getName (const MWWorld::Ptr& ptr) const;
|
virtual std::string getName (const MWWorld::Ptr& ptr) const;
|
||||||
///< \return name (the one that is to be presented to the user; not the internal one);
|
///< \return name (the one that is to be presented to the user; not the internal one);
|
||||||
/// can return an empty string.
|
/// can return an empty string.
|
||||||
|
|
|
@ -11,23 +11,36 @@
|
||||||
|
|
||||||
namespace MWClass
|
namespace MWClass
|
||||||
{
|
{
|
||||||
void Container::insertObj (const MWWorld::Ptr& ptr, MWRender::CellRenderImp& cellRender,
|
void Container::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const
|
||||||
MWWorld::Environment& environment) const
|
|
||||||
{
|
{
|
||||||
ESMS::LiveCellRef<ESM::Container, MWWorld::RefData> *ref =
|
ESMS::LiveCellRef<ESM::Container, MWWorld::RefData> *ref =
|
||||||
ptr.get<ESM::Container>();
|
ptr.get<ESM::Container>();
|
||||||
|
|
||||||
assert (ref->base != NULL);
|
assert (ref->base != NULL);
|
||||||
const std::string &model = ref->base->model;
|
const std::string &model = ref->base->model;
|
||||||
|
|
||||||
if (!model.empty())
|
if (!model.empty())
|
||||||
{
|
{
|
||||||
MWRender::Rendering rendering (cellRender, ref->ref, ref->mData);
|
MWRender::Objects objects = renderingInterface.getObjects();
|
||||||
cellRender.insertMesh ("meshes\\" + model);
|
objects.insertBegin(ptr, ptr.getRefData().isEnabled(), false);
|
||||||
cellRender.insertObjectPhysics();
|
objects.insertMesh(ptr, "meshes\\" + model);
|
||||||
ref->mData.setHandle (rendering.end (ref->mData.isEnabled()));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Container::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics, MWWorld::Environment& environment) const
|
||||||
|
{
|
||||||
|
ESMS::LiveCellRef<ESM::Container, MWWorld::RefData> *ref =
|
||||||
|
ptr.get<ESM::Container>();
|
||||||
|
|
||||||
|
|
||||||
|
const std::string &model = ref->base->model;
|
||||||
|
assert (ref->base != NULL);
|
||||||
|
if(!model.empty()){
|
||||||
|
physics.insertObjectPhysics(ptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
std::string Container::getName (const MWWorld::Ptr& ptr) const
|
std::string Container::getName (const MWWorld::Ptr& ptr) const
|
||||||
{
|
{
|
||||||
ESMS::LiveCellRef<ESM::Container, MWWorld::RefData> *ref =
|
ESMS::LiveCellRef<ESM::Container, MWWorld::RefData> *ref =
|
||||||
|
|
|
@ -9,10 +9,11 @@ namespace MWClass
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
virtual void insertObj (const MWWorld::Ptr& ptr, MWRender::CellRenderImp& cellRender,
|
virtual void insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const;
|
||||||
MWWorld::Environment& environment) const;
|
|
||||||
///< Add reference into a cell for rendering
|
///< Add reference into a cell for rendering
|
||||||
|
|
||||||
|
virtual void insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics, MWWorld::Environment& environment) const;
|
||||||
|
|
||||||
virtual std::string getName (const MWWorld::Ptr& ptr) const;
|
virtual std::string getName (const MWWorld::Ptr& ptr) const;
|
||||||
///< \return name (the one that is to be presented to the user; not the internal one);
|
///< \return name (the one that is to be presented to the user; not the internal one);
|
||||||
/// can return an empty string.
|
/// can return an empty string.
|
||||||
|
|
|
@ -23,23 +23,36 @@ namespace MWClass
|
||||||
return ref->base->mId;
|
return ref->base->mId;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Creature::insertObj (const MWWorld::Ptr& ptr, MWRender::CellRenderImp& cellRender,
|
void Creature::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const
|
||||||
MWWorld::Environment& environment) const
|
|
||||||
{
|
{
|
||||||
ESMS::LiveCellRef<ESM::Creature, MWWorld::RefData> *ref =
|
ESMS::LiveCellRef<ESM::Creature, MWWorld::RefData> *ref =
|
||||||
ptr.get<ESM::Creature>();
|
ptr.get<ESM::Creature>();
|
||||||
|
|
||||||
assert (ref->base != NULL);
|
assert (ref->base != NULL);
|
||||||
const std::string &model = ref->base->model;
|
const std::string &model = ref->base->model;
|
||||||
|
|
||||||
if (!model.empty())
|
if (!model.empty())
|
||||||
{
|
{
|
||||||
MWRender::Rendering rendering (cellRender, ref->ref, ref->mData);
|
MWRender::Objects objects = renderingInterface.getObjects();
|
||||||
cellRender.insertMesh("meshes\\" + model);
|
objects.insertBegin(ptr, ptr.getRefData().isEnabled(), false);
|
||||||
cellRender.insertActorPhysics();
|
objects.insertMesh(ptr, "meshes\\" + model);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Creature::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics, MWWorld::Environment& environment) const
|
||||||
|
{
|
||||||
|
ESMS::LiveCellRef<ESM::Creature, MWWorld::RefData> *ref =
|
||||||
|
ptr.get<ESM::Creature>();
|
||||||
|
|
||||||
|
|
||||||
|
const std::string &model = ref->base->model;
|
||||||
|
assert (ref->base != NULL);
|
||||||
|
if(!model.empty()){
|
||||||
|
physics.insertActorPhysics(ptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
void Creature::enable (const MWWorld::Ptr& ptr, MWWorld::Environment& environment) const
|
void Creature::enable (const MWWorld::Ptr& ptr, MWWorld::Environment& environment) const
|
||||||
{
|
{
|
||||||
environment.mMechanicsManager->addActor (ptr);
|
environment.mMechanicsManager->addActor (ptr);
|
||||||
|
|
|
@ -12,10 +12,11 @@ namespace MWClass
|
||||||
virtual std::string getId (const MWWorld::Ptr& ptr) const;
|
virtual std::string getId (const MWWorld::Ptr& ptr) const;
|
||||||
///< Return ID of \a ptr
|
///< Return ID of \a ptr
|
||||||
|
|
||||||
virtual void insertObj (const MWWorld::Ptr& ptr, MWRender::CellRenderImp& cellRender,
|
virtual void insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const;
|
||||||
MWWorld::Environment& environment) const;
|
|
||||||
///< Add reference into a cell for rendering
|
///< Add reference into a cell for rendering
|
||||||
|
|
||||||
|
virtual void insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics, MWWorld::Environment& environment) const;
|
||||||
|
|
||||||
virtual void enable (const MWWorld::Ptr& ptr, MWWorld::Environment& environment) const;
|
virtual void enable (const MWWorld::Ptr& ptr, MWWorld::Environment& environment) const;
|
||||||
///< Enable reference; only does the non-rendering part
|
///< Enable reference; only does the non-rendering part
|
||||||
|
|
||||||
|
|
|
@ -18,23 +18,36 @@
|
||||||
|
|
||||||
namespace MWClass
|
namespace MWClass
|
||||||
{
|
{
|
||||||
void Door::insertObj (const MWWorld::Ptr& ptr, MWRender::CellRenderImp& cellRender,
|
void Door::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const
|
||||||
MWWorld::Environment& environment) const
|
|
||||||
{
|
{
|
||||||
ESMS::LiveCellRef<ESM::Door, MWWorld::RefData> *ref =
|
ESMS::LiveCellRef<ESM::Door, MWWorld::RefData> *ref =
|
||||||
ptr.get<ESM::Door>();
|
ptr.get<ESM::Door>();
|
||||||
|
|
||||||
assert (ref->base != NULL);
|
assert (ref->base != NULL);
|
||||||
const std::string &model = ref->base->model;
|
const std::string &model = ref->base->model;
|
||||||
|
|
||||||
if (!model.empty())
|
if (!model.empty())
|
||||||
{
|
{
|
||||||
MWRender::Rendering rendering (cellRender, ref->ref, ref->mData);
|
MWRender::Objects objects = renderingInterface.getObjects();
|
||||||
cellRender.insertMesh ("meshes\\" + model);
|
objects.insertBegin(ptr, ptr.getRefData().isEnabled(), false);
|
||||||
cellRender.insertObjectPhysics();
|
objects.insertMesh(ptr, "meshes\\" + model);
|
||||||
ref->mData.setHandle (rendering.end (ref->mData.isEnabled()));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Door::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics, MWWorld::Environment& environment) const
|
||||||
|
{
|
||||||
|
ESMS::LiveCellRef<ESM::Door, MWWorld::RefData> *ref =
|
||||||
|
ptr.get<ESM::Door>();
|
||||||
|
|
||||||
|
|
||||||
|
const std::string &model = ref->base->model;
|
||||||
|
assert (ref->base != NULL);
|
||||||
|
if(!model.empty()){
|
||||||
|
physics.insertObjectPhysics(ptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
std::string Door::getName (const MWWorld::Ptr& ptr) const
|
std::string Door::getName (const MWWorld::Ptr& ptr) const
|
||||||
{
|
{
|
||||||
ESMS::LiveCellRef<ESM::Door, MWWorld::RefData> *ref =
|
ESMS::LiveCellRef<ESM::Door, MWWorld::RefData> *ref =
|
||||||
|
|
|
@ -9,10 +9,11 @@ namespace MWClass
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
virtual void insertObj (const MWWorld::Ptr& ptr, MWRender::CellRenderImp& cellRender,
|
virtual void insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const;
|
||||||
MWWorld::Environment& environment) const;
|
|
||||||
///< Add reference into a cell for rendering
|
///< Add reference into a cell for rendering
|
||||||
|
|
||||||
|
virtual void insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics, MWWorld::Environment& environment) const;
|
||||||
|
|
||||||
virtual std::string getName (const MWWorld::Ptr& ptr) const;
|
virtual std::string getName (const MWWorld::Ptr& ptr) const;
|
||||||
///< \return name (the one that is to be presented to the user; not the internal one);
|
///< \return name (the one that is to be presented to the user; not the internal one);
|
||||||
/// can return an empty string.
|
/// can return an empty string.
|
||||||
|
|
|
@ -14,23 +14,37 @@
|
||||||
|
|
||||||
namespace MWClass
|
namespace MWClass
|
||||||
{
|
{
|
||||||
void Ingredient::insertObj (const MWWorld::Ptr& ptr, MWRender::CellRenderImp& cellRender,
|
void Ingredient::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const
|
||||||
MWWorld::Environment& environment) const
|
|
||||||
{
|
{
|
||||||
ESMS::LiveCellRef<ESM::Ingredient, MWWorld::RefData> *ref =
|
ESMS::LiveCellRef<ESM::Ingredient, MWWorld::RefData> *ref =
|
||||||
ptr.get<ESM::Ingredient>();
|
ptr.get<ESM::Ingredient>();
|
||||||
|
|
||||||
assert (ref->base != NULL);
|
assert (ref->base != NULL);
|
||||||
const std::string &model = ref->base->model;
|
const std::string &model = ref->base->model;
|
||||||
|
|
||||||
if (!model.empty())
|
if (!model.empty())
|
||||||
{
|
{
|
||||||
MWRender::Rendering rendering (cellRender, ref->ref, ref->mData);
|
MWRender::Objects objects = renderingInterface.getObjects();
|
||||||
cellRender.insertMesh ("meshes\\" + model);
|
objects.insertBegin(ptr, ptr.getRefData().isEnabled(), false);
|
||||||
cellRender.insertObjectPhysics();
|
objects.insertMesh(ptr, "meshes\\" + model);
|
||||||
ref->mData.setHandle (rendering.end (ref->mData.isEnabled()));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Ingredient::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics, MWWorld::Environment& environment) const
|
||||||
|
{
|
||||||
|
ESMS::LiveCellRef<ESM::Ingredient, MWWorld::RefData> *ref =
|
||||||
|
ptr.get<ESM::Ingredient>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
const std::string &model = ref->base->model;
|
||||||
|
assert (ref->base != NULL);
|
||||||
|
if(!model.empty()){
|
||||||
|
physics.insertObjectPhysics(ptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
std::string Ingredient::getName (const MWWorld::Ptr& ptr) const
|
std::string Ingredient::getName (const MWWorld::Ptr& ptr) const
|
||||||
{
|
{
|
||||||
ESMS::LiveCellRef<ESM::Ingredient, MWWorld::RefData> *ref =
|
ESMS::LiveCellRef<ESM::Ingredient, MWWorld::RefData> *ref =
|
||||||
|
|
|
@ -9,10 +9,11 @@ namespace MWClass
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
virtual void insertObj (const MWWorld::Ptr& ptr, MWRender::CellRenderImp& cellRender,
|
virtual void insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const;
|
||||||
MWWorld::Environment& environment) const;
|
|
||||||
///< Add reference into a cell for rendering
|
///< Add reference into a cell for rendering
|
||||||
|
|
||||||
|
virtual void insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics, MWWorld::Environment& environment) const;
|
||||||
|
|
||||||
virtual std::string getName (const MWWorld::Ptr& ptr) const;
|
virtual std::string getName (const MWWorld::Ptr& ptr) const;
|
||||||
///< \return name (the one that is to be presented to the user; not the internal one);
|
///< \return name (the one that is to be presented to the user; not the internal one);
|
||||||
/// can return an empty string.
|
/// can return an empty string.
|
||||||
|
|
|
@ -18,33 +18,42 @@
|
||||||
|
|
||||||
namespace MWClass
|
namespace MWClass
|
||||||
{
|
{
|
||||||
void Light::insertObj (const MWWorld::Ptr& ptr, MWRender::CellRenderImp& cellRender,
|
void Light::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const
|
||||||
MWWorld::Environment& environment) const
|
|
||||||
{
|
{
|
||||||
ESMS::LiveCellRef<ESM::Light, MWWorld::RefData> *ref =
|
ESMS::LiveCellRef<ESM::Light, MWWorld::RefData> *ref =
|
||||||
ptr.get<ESM::Light>();
|
ptr.get<ESM::Light>();
|
||||||
|
|
||||||
assert (ref->base != NULL);
|
assert (ref->base != NULL);
|
||||||
const std::string &model = ref->base->model;
|
const std::string &model = ref->base->model;
|
||||||
|
|
||||||
if (!model.empty())
|
if (!model.empty())
|
||||||
{
|
{
|
||||||
MWRender::Rendering rendering (cellRender, ref->ref, ref->mData);
|
MWRender::Objects objects = renderingInterface.getObjects();
|
||||||
|
objects.insertBegin(ptr, ptr.getRefData().isEnabled(), false);
|
||||||
cellRender.insertMesh ("meshes\\" + model);
|
objects.insertMesh(ptr, "meshes\\" + model);
|
||||||
cellRender.insertObjectPhysics();
|
|
||||||
|
|
||||||
// Extract the color and convert to floating point
|
|
||||||
const int color = ref->base->data.color;
|
const int color = ref->base->data.color;
|
||||||
const float r = ((color >> 0) & 0xFF) / 255.0f;
|
const float r = ((color >> 0) & 0xFF) / 255.0f;
|
||||||
const float g = ((color >> 8) & 0xFF) / 255.0f;
|
const float g = ((color >> 8) & 0xFF) / 255.0f;
|
||||||
const float b = ((color >> 16) & 0xFF) / 255.0f;
|
const float b = ((color >> 16) & 0xFF) / 255.0f;
|
||||||
const float radius = float (ref->base->data.radius);
|
const float radius = float (ref->base->data.radius);
|
||||||
cellRender.insertLight (r, g, b, radius);
|
objects.insertLight (r, g, b, radius);
|
||||||
|
|
||||||
ref->mData.setHandle (rendering.end (ref->mData.isEnabled()));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Light::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics, MWWorld::Environment& environment) const
|
||||||
|
{
|
||||||
|
ESMS::LiveCellRef<ESM::Light, MWWorld::RefData> *ref =
|
||||||
|
ptr.get<ESM::Light>();
|
||||||
|
|
||||||
|
|
||||||
|
const std::string &model = ref->base->model;
|
||||||
|
assert (ref->base != NULL);
|
||||||
|
if(!model.empty()){
|
||||||
|
physics.insertObjectPhysics(ptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
void Light::enable (const MWWorld::Ptr& ptr, MWWorld::Environment& environment) const
|
void Light::enable (const MWWorld::Ptr& ptr, MWWorld::Environment& environment) const
|
||||||
{
|
{
|
||||||
ESMS::LiveCellRef<ESM::Light, MWWorld::RefData> *ref =
|
ESMS::LiveCellRef<ESM::Light, MWWorld::RefData> *ref =
|
||||||
|
|
|
@ -9,10 +9,11 @@ namespace MWClass
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
virtual void insertObj (const MWWorld::Ptr& ptr, MWRender::CellRenderImp& cellRender,
|
virtual void insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const;
|
||||||
MWWorld::Environment& environment) const;
|
|
||||||
///< Add reference into a cell for rendering
|
///< Add reference into a cell for rendering
|
||||||
|
|
||||||
|
virtual void insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics, MWWorld::Environment& environment) const;
|
||||||
|
|
||||||
virtual void enable (const MWWorld::Ptr& ptr, MWWorld::Environment& environment) const;
|
virtual void enable (const MWWorld::Ptr& ptr, MWWorld::Environment& environment) const;
|
||||||
///< Enable reference; only does the non-rendering part
|
///< Enable reference; only does the non-rendering part
|
||||||
/// \attention This is not the same as the script instruction with the same name. References
|
/// \attention This is not the same as the script instruction with the same name. References
|
||||||
|
|
|
@ -14,23 +14,36 @@
|
||||||
|
|
||||||
namespace MWClass
|
namespace MWClass
|
||||||
{
|
{
|
||||||
void Miscellaneous::insertObj (const MWWorld::Ptr& ptr, MWRender::CellRenderImp& cellRender,
|
void Miscellaneous::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const
|
||||||
MWWorld::Environment& environment) const
|
|
||||||
{
|
{
|
||||||
ESMS::LiveCellRef<ESM::Miscellaneous, MWWorld::RefData> *ref =
|
ESMS::LiveCellRef<ESM::Miscellaneous, MWWorld::RefData> *ref =
|
||||||
ptr.get<ESM::Miscellaneous>();
|
ptr.get<ESM::Miscellaneous>();
|
||||||
|
|
||||||
assert (ref->base != NULL);
|
assert (ref->base != NULL);
|
||||||
const std::string &model = ref->base->model;
|
const std::string &model = ref->base->model;
|
||||||
|
|
||||||
if (!model.empty())
|
if (!model.empty())
|
||||||
{
|
{
|
||||||
MWRender::Rendering rendering (cellRender, ref->ref, ref->mData);
|
MWRender::Objects objects = renderingInterface.getObjects();
|
||||||
cellRender.insertMesh ("meshes\\" + model);
|
objects.insertBegin(ptr, ptr.getRefData().isEnabled(), false);
|
||||||
cellRender.insertObjectPhysics();
|
objects.insertMesh(ptr, "meshes\\" + model);
|
||||||
ref->mData.setHandle (rendering.end (ref->mData.isEnabled()));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Miscellaneous::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics, MWWorld::Environment& environment) const
|
||||||
|
{
|
||||||
|
ESMS::LiveCellRef<ESM::Miscellaneous, MWWorld::RefData> *ref =
|
||||||
|
ptr.get<ESM::Miscellaneous>();
|
||||||
|
|
||||||
|
|
||||||
|
const std::string &model = ref->base->model;
|
||||||
|
assert (ref->base != NULL);
|
||||||
|
if(!model.empty()){
|
||||||
|
physics.insertObjectPhysics(ptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
std::string Miscellaneous::getName (const MWWorld::Ptr& ptr) const
|
std::string Miscellaneous::getName (const MWWorld::Ptr& ptr) const
|
||||||
{
|
{
|
||||||
ESMS::LiveCellRef<ESM::Miscellaneous, MWWorld::RefData> *ref =
|
ESMS::LiveCellRef<ESM::Miscellaneous, MWWorld::RefData> *ref =
|
||||||
|
|
|
@ -9,10 +9,11 @@ namespace MWClass
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
virtual void insertObj (const MWWorld::Ptr& ptr, MWRender::CellRenderImp& cellRender,
|
virtual void insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const;
|
||||||
MWWorld::Environment& environment) const;
|
|
||||||
///< Add reference into a cell for rendering
|
///< Add reference into a cell for rendering
|
||||||
|
|
||||||
|
virtual void insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics, MWWorld::Environment& environment) const;
|
||||||
|
|
||||||
virtual std::string getName (const MWWorld::Ptr& ptr) const;
|
virtual std::string getName (const MWWorld::Ptr& ptr) const;
|
||||||
///< \return name (the one that is to be presented to the user; not the internal one);
|
///< \return name (the one that is to be presented to the user; not the internal one);
|
||||||
/// can return an empty string.
|
/// can return an empty string.
|
||||||
|
|
|
@ -32,229 +32,34 @@ namespace MWClass
|
||||||
return ref->base->mId;
|
return ref->base->mId;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Npc::insertObj (const MWWorld::Ptr& ptr, MWRender::CellRenderImp& cellRender,
|
void Npc::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const
|
||||||
MWWorld::Environment& environment) const
|
|
||||||
{
|
{
|
||||||
//Ogre::SceneNode *chest;
|
|
||||||
ESMS::LiveCellRef<ESM::NPC, MWWorld::RefData> *ref =
|
ESMS::LiveCellRef<ESM::NPC, MWWorld::RefData> *ref =
|
||||||
ptr.get<ESM::NPC>();
|
ptr.get<ESM::NPC>();
|
||||||
|
|
||||||
//Store scenenodes by npc's name + bodypart [0] , npc's name + bodypart [1]
|
|
||||||
//Ex. Fargothchest , Fargothneck
|
|
||||||
|
|
||||||
assert (ref->base != NULL);
|
assert (ref->base != NULL);
|
||||||
|
const std::string &model = ref->base->model;
|
||||||
std::string hairID = ref->base->hair;
|
|
||||||
std::string headID = ref->base->head;
|
if (!model.empty())
|
||||||
|
|
||||||
// very ugly workaround to stop OGRE from chocking on non-unique scene node handles
|
|
||||||
static int uniqueId = 0;
|
|
||||||
|
|
||||||
std::ostringstream stream;
|
|
||||||
stream << "npc$" << uniqueId++;
|
|
||||||
|
|
||||||
std::string npcName = stream.str(); // ref->base->name;
|
|
||||||
//std::cout << "NPC: " << npcName << "\n";
|
|
||||||
|
|
||||||
//get the part of the bodypart id which describes the race and the gender
|
|
||||||
std::string bodyRaceID = headID.substr(0, headID.find_last_of("head_") - 4);
|
|
||||||
std::string headModel = "meshes\\" +
|
|
||||||
environment.mWorld->getStore().bodyParts.find(headID)->model;
|
|
||||||
|
|
||||||
std::string hairModel = "meshes\\" +
|
|
||||||
environment.mWorld->getStore().bodyParts.find(hairID)->model;
|
|
||||||
|
|
||||||
MWRender::Rendering rendering (cellRender, ref->ref, ref->mData);
|
|
||||||
|
|
||||||
|
|
||||||
//TODO: define consts for each bodypart e.g. chest, foot, wrist... and put the parts in the
|
|
||||||
// right place
|
|
||||||
const ESM::BodyPart *bodyPart =
|
|
||||||
environment.mWorld->getStore().bodyParts.search (bodyRaceID + "chest");
|
|
||||||
|
|
||||||
//bodyPart->model->
|
|
||||||
Ogre::Vector3 pos = Ogre::Vector3( 20, 20, 20);
|
|
||||||
Ogre::Vector3 axis = Ogre::Vector3( 0, 0, 1);
|
|
||||||
Ogre::Radian angle = Ogre::Radian(0);
|
|
||||||
|
|
||||||
std::string addresses[6] = {"", "", "", "","", ""};
|
|
||||||
std::string addresses2[6] = {"", "", "", "", "", ""};
|
|
||||||
std::string upperleft[5] = {"", "", "", "", ""};
|
|
||||||
std::string upperright[5] = {"", "", "", "", ""};
|
|
||||||
std::string neckandup[5] = {"", "", "","",""};
|
|
||||||
int numbers = 0;
|
|
||||||
int uppernumbers = 0;
|
|
||||||
int neckNumbers = 0;
|
|
||||||
|
|
||||||
if (bodyPart){
|
|
||||||
|
|
||||||
cellRender.insertMesh("meshes\\" + bodyPart->model, pos, axis, angle, npcName + "chest", addresses, numbers, true); //2 0
|
|
||||||
addresses2[numbers] = npcName + "chest";
|
|
||||||
addresses[numbers++] = npcName + "chest";
|
|
||||||
upperleft[uppernumbers] = npcName + "chest";
|
|
||||||
upperright[uppernumbers++] = npcName + "chest";
|
|
||||||
neckandup[neckNumbers++] = npcName + "chest";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const ESM::BodyPart *upperleg = environment.mWorld->getStore().bodyParts.search (bodyRaceID + "upper leg");
|
|
||||||
const ESM::BodyPart *groin = environment.mWorld->getStore().bodyParts.search (bodyRaceID + "groin");
|
|
||||||
const ESM::BodyPart *arm = environment.mWorld->getStore().bodyParts.search (bodyRaceID + "upper arm");
|
|
||||||
const ESM::BodyPart *neck = environment.mWorld->getStore().bodyParts.search (bodyRaceID + "neck");
|
|
||||||
const ESM::BodyPart *knee = environment.mWorld->getStore().bodyParts.search (bodyRaceID + "knee");
|
|
||||||
const ESM::BodyPart *ankle = environment.mWorld->getStore().bodyParts.search (bodyRaceID + "ankle");
|
|
||||||
const ESM::BodyPart *foot = environment.mWorld->getStore().bodyParts.search (bodyRaceID + "foot");
|
|
||||||
const ESM::BodyPart *feet = environment.mWorld->getStore().bodyParts.search (bodyRaceID + "feet");
|
|
||||||
const ESM::BodyPart *tail = environment.mWorld->getStore().bodyParts.search (bodyRaceID + "tail");
|
|
||||||
const ESM::BodyPart *wrist = environment.mWorld->getStore().bodyParts.search (bodyRaceID + "wrist");
|
|
||||||
const ESM::BodyPart *forearm = environment.mWorld->getStore().bodyParts.search (bodyRaceID + "forearm");
|
|
||||||
const ESM::BodyPart *hand = environment.mWorld->getStore().bodyParts.search (bodyRaceID + "hand.1st");
|
|
||||||
const ESM::BodyPart *hands = environment.mWorld->getStore().bodyParts.search (bodyRaceID + "hands.1st");
|
|
||||||
|
|
||||||
|
|
||||||
Ogre::Vector3 pos2 = Ogre::Vector3( 0, .5, 75);
|
|
||||||
|
|
||||||
if (groin){
|
|
||||||
cellRender.insertMesh("meshes\\" + groin->model, pos2, axis, kOgrePi, npcName + "groin", addresses, numbers);
|
|
||||||
addresses2[numbers] = npcName + "groin";
|
|
||||||
addresses[numbers++] = npcName + "groin";
|
|
||||||
}
|
|
||||||
if (tail) {
|
|
||||||
cellRender.insertMesh("tail\\" + tail->model, Ogre::Vector3(0 , 0, -76), axis, kOgrePi, npcName + "tail", addresses, numbers, "tail");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if(upperleg){
|
|
||||||
cellRender.insertMesh ("meshes\\" + upperleg->model, Ogre::Vector3( 6, 0, -16), axis, kOgrePi, npcName + "upper leg", addresses, numbers); //-18
|
|
||||||
cellRender.insertMesh ("meshes\\" + upperleg->model, Ogre::Vector3( -6, 0, -16), axis, Ogre::Radian(0), npcName + "upper leg2", addresses2, numbers);
|
|
||||||
addresses2[numbers] = npcName + "upper leg2";
|
|
||||||
addresses[numbers++] = npcName + "upper leg";
|
|
||||||
cellRender.scaleMesh(Ogre::Vector3(1, -1, 1), addresses, numbers);
|
|
||||||
}
|
|
||||||
if(knee)
|
|
||||||
{
|
{
|
||||||
cellRender.insertMesh ("meshes\\" + knee->model, Ogre::Vector3( 0, -1, -23), axis, Ogre::Radian(0), npcName + "knee", addresses, numbers);
|
MWRender::Objects objects = renderingInterface.getObjects();
|
||||||
//cellRender.rotateMesh(Ogre::Vector3(0, 1, 0), Ogre::Radian (1), npcName + "upper arm");
|
objects.insertBegin(ptr, ptr.getRefData().isEnabled(), false);
|
||||||
cellRender.insertMesh ("meshes\\" + knee->model, Ogre::Vector3( 0, -1, -23), axis, Ogre::Radian(0), npcName + "knee2", addresses2, numbers);
|
objects.insertMesh(ptr, "meshes\\" + model);
|
||||||
|
|
||||||
addresses2[numbers] = npcName + "knee2";
|
|
||||||
addresses[numbers++] = npcName + "knee";
|
|
||||||
}
|
}
|
||||||
if(ankle){
|
}
|
||||||
|
|
||||||
cellRender.insertMesh ("meshes\\" + ankle->model, Ogre::Vector3( 0, 0, -20), axis, Ogre::Radian(0), npcName + "ankle", addresses, numbers); //-1
|
void Npc::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics, MWWorld::Environment& environment) const
|
||||||
cellRender.insertMesh ("meshes\\" + ankle->model, Ogre::Vector3( 0,0, -20), axis, Ogre::Radian(0), npcName + "ankle2", addresses2, numbers); //-1
|
{
|
||||||
|
ESMS::LiveCellRef<ESM::NPC, MWWorld::RefData> *ref =
|
||||||
|
ptr.get<ESM::NPC>();
|
||||||
|
|
||||||
addresses2[numbers] = npcName + "ankle2";
|
|
||||||
addresses[numbers++] = npcName + "ankle";
|
|
||||||
}
|
|
||||||
if(foot){
|
|
||||||
if(bodyRaceID.compare("b_n_khajiit_m_") == 0)
|
|
||||||
{
|
|
||||||
feet = foot;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
cellRender.insertMesh ("meshes\\" + foot->model, Ogre::Vector3( 0, -4, -15), axis, Ogre::Radian(0), npcName + "foot", addresses, numbers);
|
|
||||||
|
|
||||||
cellRender.insertMesh ("meshes\\" + foot->model, Ogre::Vector3( 0, -4, -15), axis, Ogre::Radian(0), npcName + "foot2", addresses2, numbers);
|
const std::string &model = ref->base->model;
|
||||||
addresses2[numbers] = npcName + "foot2";
|
assert (ref->base != NULL);
|
||||||
addresses[numbers++] = npcName + "foot";
|
if(!model.empty()){
|
||||||
}
|
physics.insertActorPhysics(ptr);
|
||||||
//cellRender.scaleMesh(Ogre::Vector3(1, -1, 1), addresses, numbers);
|
|
||||||
}
|
|
||||||
if(feet){
|
|
||||||
|
|
||||||
cellRender.insertMesh ("foot\\" + feet->model, Ogre::Vector3( 7, 4, -16), axis, kOgrePi, npcName + "foot", addresses, numbers); //9, 0, -14
|
|
||||||
|
|
||||||
cellRender.insertMesh ("foot\\" + feet->model, Ogre::Vector3( 7, 4, -16), axis, kOgrePi, npcName + "foot2", addresses2, numbers);
|
|
||||||
addresses2[numbers] = npcName + "foot2";
|
|
||||||
addresses[numbers++] = npcName + "foot";
|
|
||||||
//cellRender.scaleMesh(Ogre::Vector3(1, -1, 1), addresses, numbers);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (arm){
|
|
||||||
//010
|
|
||||||
cellRender.insertMesh("meshes\\" + arm->model, Ogre::Vector3(-12.5, 0, 104), Ogre::Vector3(0, 1, 0), -kOgrePiOverTwo, npcName + "upper arm", upperleft, uppernumbers); //1, 0,.75
|
|
||||||
//cellRender.rotateMesh(Ogre::Vector3(1, 0, 0), Ogre::Radian (.45), upperarmpath, 2); //-.5, 0, -.75
|
|
||||||
cellRender.insertMesh("meshes\\" + arm->model, Ogre::Vector3(12.5, 0, 105), Ogre::Vector3(-.5, 0, -.75), kOgrePi, npcName + "upper arm2", upperright, uppernumbers);
|
|
||||||
upperleft[uppernumbers] = npcName + "upper arm";
|
|
||||||
upperright[uppernumbers++] = npcName + "upper arm2";
|
|
||||||
cellRender.scaleMesh(Ogre::Vector3(1, -1, 1), upperleft, uppernumbers); //1 -1 1
|
|
||||||
cellRender.rotateMesh(Ogre::Vector3(0, .1, 0), kOgrePiOverTwo, upperleft, uppernumbers);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (forearm)
|
|
||||||
{
|
|
||||||
//addresses[1] = npcName + "upper arm";
|
|
||||||
cellRender.insertMesh("meshes\\" + forearm->model, Ogre::Vector3(-12.5, 0, 0), Ogre::Vector3(0, 0, 0), kOgrePi, npcName + "forearm", upperleft, uppernumbers);
|
|
||||||
cellRender.insertMesh("meshes\\" + forearm->model, Ogre::Vector3(-12.5, 0, 0), Ogre::Vector3(0, 0, 0), kOgrePi, npcName + "forearm2", upperright, uppernumbers);
|
|
||||||
upperleft[uppernumbers] = npcName + "forearm";
|
|
||||||
upperright[uppernumbers++] = npcName + "forearm2";
|
|
||||||
}
|
|
||||||
//else
|
|
||||||
// std::cout << npcName << "has no forearm";
|
|
||||||
if (wrist)
|
|
||||||
{
|
|
||||||
if(upperleft[uppernumbers - 1].compare(npcName + "upper arm") == 0)
|
|
||||||
{
|
|
||||||
cellRender.insertMesh("meshes\\b\\B_N_Argonian_M_Forearm.nif", Ogre::Vector3(-12.5, 0, 0), Ogre::Vector3(0, 0, 0), kOgrePi, npcName + "forearm", upperleft, uppernumbers);
|
|
||||||
cellRender.insertMesh("meshes\\b\\B_N_Argonian_M_Forearm.nif", Ogre::Vector3(-12.5, 0, 0), Ogre::Vector3(0, 0, 0), kOgrePi, npcName + "forearm2", upperright, uppernumbers);
|
|
||||||
upperleft[uppernumbers] = npcName + "forearm";
|
|
||||||
upperright[uppernumbers++] = npcName + "forearm2";
|
|
||||||
|
|
||||||
}
|
|
||||||
cellRender.insertMesh("meshes\\" + wrist->model, Ogre::Vector3(-9.5, 0, 0), Ogre::Vector3(0, 0, 0), kOgrePi, npcName + "wrist", upperleft, uppernumbers);
|
|
||||||
cellRender.insertMesh("meshes\\" + wrist->model, Ogre::Vector3(-9.5, 0, 0), Ogre::Vector3(0, 0, 0), kOgrePi, npcName + "wrist2", upperright, uppernumbers);
|
|
||||||
upperleft[uppernumbers] = npcName + "wrist";
|
|
||||||
upperright[uppernumbers++] = npcName + "wrist2";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if(hand)
|
|
||||||
{
|
|
||||||
std::string pass;
|
|
||||||
if(hand->model.compare("b\\B_N_Dark Elf_F_Hands.1st.NIF")==0 && bodyRaceID.compare("b_n_dark elf_m_") == 0)
|
|
||||||
pass = "b\\B_N_Dark Elf_M_Hands.1st.NIF";
|
|
||||||
else
|
|
||||||
pass = hand->model;
|
|
||||||
cellRender.insertMesh("meshes\\" + pass, Ogre::Vector3(42, 1, -110), Ogre::Vector3(0, 0, 0), kOgrePi, npcName + "hand", upperleft, uppernumbers,false); //0, 100, -100 0,0,120
|
|
||||||
cellRender.insertMesh("meshes\\" + pass, Ogre::Vector3(42, 1, -110), Ogre::Vector3(0, 0,0), kOgrePi, npcName + "hand2", upperright, uppernumbers, false); //0, 100, -100 0,0,120
|
|
||||||
upperleft[uppernumbers] = npcName + "hand";
|
|
||||||
upperright[uppernumbers++] = npcName + "hand2";
|
|
||||||
cellRender.scaleMesh(Ogre::Vector3(1, -1, 1), upperleft, uppernumbers);
|
|
||||||
cellRender.scaleMesh(Ogre::Vector3(1, -1, 1), upperright, uppernumbers);
|
|
||||||
}
|
|
||||||
if(hands)
|
|
||||||
{
|
|
||||||
std::string pass;
|
|
||||||
if(hands->model.compare("b\\B_N_Redguard_F_Hands.1st.nif")==0 && bodyRaceID.compare("b_n_redguard_m_") == 0)
|
|
||||||
pass = "b\\B_N_Redguard_M_Hands.1st.nif";
|
|
||||||
else if(hands->model.compare("b\\B_N_Imperial_M_Hands.1st.nif") == 0 && bodyRaceID.compare("b_n_nord_m_") == 0)
|
|
||||||
pass = "b\\B_N_Nord_M_Hands.1st.nif";
|
|
||||||
else
|
|
||||||
pass =hands->model; //-50, 0, -120
|
|
||||||
cellRender.insertMesh("meshes\\" + pass, Ogre::Vector3(42, 1,-110), Ogre::Vector3(0, 0, 0), kOgrePi, npcName + "hand", upperleft, uppernumbers, false); //0, 100, -100 42, 0, -110
|
|
||||||
cellRender.insertMesh("meshes\\" + pass, Ogre::Vector3(42, 1, -110), Ogre::Vector3(0, 0, 0), kOgrePi, npcName + "hand2", upperright, uppernumbers, false); //0, 100, -100 0,0,120
|
|
||||||
upperleft[uppernumbers] = npcName + "hand";
|
|
||||||
upperright[uppernumbers++] = npcName + "hand2";
|
|
||||||
cellRender.scaleMesh(Ogre::Vector3(1, -1, 1), upperleft, uppernumbers);
|
|
||||||
cellRender.scaleMesh(Ogre::Vector3(1, -1, 1), upperright, uppernumbers);
|
|
||||||
}
|
|
||||||
|
|
||||||
//neck will reset chest counter
|
|
||||||
if(neck)
|
|
||||||
{
|
|
||||||
cellRender.insertMesh ("meshes\\" + neck->model, Ogre::Vector3( 0, 0, 120), axis, kOgrePi, npcName + "neck", neckandup, neckNumbers);
|
|
||||||
neckandup[neckNumbers++] = npcName + "neck";
|
|
||||||
}
|
|
||||||
cellRender.insertMesh (headModel, Ogre::Vector3( 0, 0, 5), axis, Ogre::Radian(0), npcName + "head", neckandup, neckNumbers);
|
|
||||||
neckandup[neckNumbers++] = npcName + "head";
|
|
||||||
cellRender.insertMesh (hairModel, Ogre::Vector3( 0, -1, 0), axis, Ogre::Radian(0), npcName + "hair", neckandup, neckNumbers);
|
|
||||||
|
|
||||||
cellRender.insertActorPhysics();
|
|
||||||
ref->mData.setHandle (rendering.end (ref->mData.isEnabled()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Npc::enable (const MWWorld::Ptr& ptr, MWWorld::Environment& environment) const
|
void Npc::enable (const MWWorld::Ptr& ptr, MWWorld::Environment& environment) const
|
||||||
|
|
|
@ -12,10 +12,11 @@ namespace MWClass
|
||||||
virtual std::string getId (const MWWorld::Ptr& ptr) const;
|
virtual std::string getId (const MWWorld::Ptr& ptr) const;
|
||||||
///< Return ID of \a ptr
|
///< Return ID of \a ptr
|
||||||
|
|
||||||
virtual void insertObj (const MWWorld::Ptr& ptr, MWRender::CellRenderImp& cellRender,
|
virtual void insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const;
|
||||||
MWWorld::Environment& environment) const;
|
|
||||||
///< Add reference into a cell for rendering
|
///< Add reference into a cell for rendering
|
||||||
|
|
||||||
|
virtual void insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics, MWWorld::Environment& environment) const;
|
||||||
|
|
||||||
virtual void enable (const MWWorld::Ptr& ptr, MWWorld::Environment& environment) const;
|
virtual void enable (const MWWorld::Ptr& ptr, MWWorld::Environment& environment) const;
|
||||||
///< Enable reference; only does the non-rendering part
|
///< Enable reference; only does the non-rendering part
|
||||||
|
|
||||||
|
|
|
@ -14,23 +14,36 @@
|
||||||
|
|
||||||
namespace MWClass
|
namespace MWClass
|
||||||
{
|
{
|
||||||
void Potion::insertObj (const MWWorld::Ptr& ptr, MWRender::CellRenderImp& cellRender,
|
void Potion::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const
|
||||||
MWWorld::Environment& environment) const
|
|
||||||
{
|
{
|
||||||
ESMS::LiveCellRef<ESM::Potion, MWWorld::RefData> *ref =
|
ESMS::LiveCellRef<ESM::Potion, MWWorld::RefData> *ref =
|
||||||
ptr.get<ESM::Potion>();
|
ptr.get<ESM::Potion>();
|
||||||
|
|
||||||
assert (ref->base != NULL);
|
assert (ref->base != NULL);
|
||||||
const std::string &model = ref->base->model;
|
const std::string &model = ref->base->model;
|
||||||
|
|
||||||
if (!model.empty())
|
if (!model.empty())
|
||||||
{
|
{
|
||||||
MWRender::Rendering rendering (cellRender, ref->ref, ref->mData);
|
MWRender::Objects objects = renderingInterface.getObjects();
|
||||||
cellRender.insertMesh ("meshes\\" + model);
|
objects.insertBegin(ptr, ptr.getRefData().isEnabled(), false);
|
||||||
cellRender.insertObjectPhysics();
|
objects.insertMesh(ptr, "meshes\\" + model);
|
||||||
ref->mData.setHandle (rendering.end (ref->mData.isEnabled()));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Potion::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics, MWWorld::Environment& environment) const
|
||||||
|
{
|
||||||
|
ESMS::LiveCellRef<ESM::Potion, MWWorld::RefData> *ref =
|
||||||
|
ptr.get<ESM::Potion>();
|
||||||
|
|
||||||
|
|
||||||
|
const std::string &model = ref->base->model;
|
||||||
|
assert (ref->base != NULL);
|
||||||
|
if(!model.empty()){
|
||||||
|
physics.insertObjectPhysics(ptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
std::string Potion::getName (const MWWorld::Ptr& ptr) const
|
std::string Potion::getName (const MWWorld::Ptr& ptr) const
|
||||||
{
|
{
|
||||||
ESMS::LiveCellRef<ESM::Potion, MWWorld::RefData> *ref =
|
ESMS::LiveCellRef<ESM::Potion, MWWorld::RefData> *ref =
|
||||||
|
|
|
@ -9,10 +9,11 @@ namespace MWClass
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
virtual void insertObj (const MWWorld::Ptr& ptr, MWRender::CellRenderImp& cellRender,
|
virtual void insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const;
|
||||||
MWWorld::Environment& environment) const;
|
|
||||||
///< Add reference into a cell for rendering
|
///< Add reference into a cell for rendering
|
||||||
|
|
||||||
|
virtual void insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics, MWWorld::Environment& environment) const;
|
||||||
|
|
||||||
virtual std::string getName (const MWWorld::Ptr& ptr) const;
|
virtual std::string getName (const MWWorld::Ptr& ptr) const;
|
||||||
///< \return name (the one that is to be presented to the user; not the internal one);
|
///< \return name (the one that is to be presented to the user; not the internal one);
|
||||||
/// can return an empty string.
|
/// can return an empty string.
|
||||||
|
|
|
@ -14,29 +14,34 @@
|
||||||
|
|
||||||
namespace MWClass
|
namespace MWClass
|
||||||
{
|
{
|
||||||
void Probe::insertObj (const MWWorld::Ptr& ptr, MWRender::CellRenderImp& cellRender,
|
void Probe::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const
|
||||||
MWWorld::Environment& environment) const
|
|
||||||
{
|
{
|
||||||
ESMS::LiveCellRef<ESM::Probe, MWWorld::RefData> *ref =
|
ESMS::LiveCellRef<ESM::Probe, MWWorld::RefData> *ref =
|
||||||
ptr.get<ESM::Probe>();
|
ptr.get<ESM::Probe>();
|
||||||
|
|
||||||
assert (ref->base != NULL);
|
assert (ref->base != NULL);
|
||||||
const std::string &model = ref->base->model;
|
const std::string &model = ref->base->model;
|
||||||
|
|
||||||
if (!model.empty())
|
if (!model.empty())
|
||||||
{
|
{
|
||||||
MWRender::Rendering rendering (cellRender, ref->ref, ref->mData);
|
MWRender::Objects objects = renderingInterface.getObjects();
|
||||||
cellRender.insertMesh ("meshes\\" + model);
|
objects.insertBegin(ptr, ptr.getRefData().isEnabled(), false);
|
||||||
cellRender.insertObjectPhysics();
|
objects.insertMesh(ptr, "meshes\\" + model);
|
||||||
ref->mData.setHandle (rendering.end (ref->mData.isEnabled()));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string Probe::getName (const MWWorld::Ptr& ptr) const
|
void Probe::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics, MWWorld::Environment& environment) const
|
||||||
{
|
{
|
||||||
ESMS::LiveCellRef<ESM::Probe, MWWorld::RefData> *ref =
|
ESMS::LiveCellRef<ESM::Probe, MWWorld::RefData> *ref =
|
||||||
ptr.get<ESM::Probe>();
|
ptr.get<ESM::Probe>();
|
||||||
|
|
||||||
return ref->base->name;
|
|
||||||
|
const std::string &model = ref->base->model;
|
||||||
|
assert (ref->base != NULL);
|
||||||
|
if(!model.empty()){
|
||||||
|
physics.insertObjectPhysics(ptr);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
boost::shared_ptr<MWWorld::Action> Probe::activate (const MWWorld::Ptr& ptr,
|
boost::shared_ptr<MWWorld::Action> Probe::activate (const MWWorld::Ptr& ptr,
|
||||||
|
|
|
@ -9,10 +9,11 @@ namespace MWClass
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
virtual void insertObj (const MWWorld::Ptr& ptr, MWRender::CellRenderImp& cellRender,
|
virtual void insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const;
|
||||||
MWWorld::Environment& environment) const;
|
|
||||||
///< Add reference into a cell for rendering
|
///< Add reference into a cell for rendering
|
||||||
|
|
||||||
|
virtual void insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics, MWWorld::Environment& environment) const;
|
||||||
|
|
||||||
virtual std::string getName (const MWWorld::Ptr& ptr) const;
|
virtual std::string getName (const MWWorld::Ptr& ptr) const;
|
||||||
///< \return name (the one that is to be presented to the user; not the internal one);
|
///< \return name (the one that is to be presented to the user; not the internal one);
|
||||||
/// can return an empty string.
|
/// can return an empty string.
|
||||||
|
|
|
@ -14,23 +14,36 @@
|
||||||
|
|
||||||
namespace MWClass
|
namespace MWClass
|
||||||
{
|
{
|
||||||
void Repair::insertObj (const MWWorld::Ptr& ptr, MWRender::CellRenderImp& cellRender,
|
void Repair::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const
|
||||||
MWWorld::Environment& environment) const
|
|
||||||
{
|
{
|
||||||
ESMS::LiveCellRef<ESM::Repair, MWWorld::RefData> *ref =
|
ESMS::LiveCellRef<ESM::Repair, MWWorld::RefData> *ref =
|
||||||
ptr.get<ESM::Repair>();
|
ptr.get<ESM::Repair>();
|
||||||
|
|
||||||
assert (ref->base != NULL);
|
assert (ref->base != NULL);
|
||||||
const std::string &model = ref->base->model;
|
const std::string &model = ref->base->model;
|
||||||
|
|
||||||
if (!model.empty())
|
if (!model.empty())
|
||||||
{
|
{
|
||||||
MWRender::Rendering rendering (cellRender, ref->ref, ref->mData);
|
MWRender::Objects objects = renderingInterface.getObjects();
|
||||||
cellRender.insertMesh ("meshes\\" + model);
|
objects.insertBegin(ptr, ptr.getRefData().isEnabled(), false);
|
||||||
cellRender.insertObjectPhysics();
|
objects.insertMesh(ptr, "meshes\\" + model);
|
||||||
ref->mData.setHandle (rendering.end (ref->mData.isEnabled()));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Repair::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics, MWWorld::Environment& environment) const
|
||||||
|
{
|
||||||
|
ESMS::LiveCellRef<ESM::Repair, MWWorld::RefData> *ref =
|
||||||
|
ptr.get<ESM::Repair>();
|
||||||
|
|
||||||
|
|
||||||
|
const std::string &model = ref->base->model;
|
||||||
|
assert (ref->base != NULL);
|
||||||
|
if(!model.empty()){
|
||||||
|
physics.insertObjectPhysics(ptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
std::string Repair::getName (const MWWorld::Ptr& ptr) const
|
std::string Repair::getName (const MWWorld::Ptr& ptr) const
|
||||||
{
|
{
|
||||||
ESMS::LiveCellRef<ESM::Repair, MWWorld::RefData> *ref =
|
ESMS::LiveCellRef<ESM::Repair, MWWorld::RefData> *ref =
|
||||||
|
|
|
@ -9,10 +9,11 @@ namespace MWClass
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
virtual void insertObj (const MWWorld::Ptr& ptr, MWRender::CellRenderImp& cellRender,
|
virtual void insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const;
|
||||||
MWWorld::Environment& environment) const;
|
|
||||||
///< Add reference into a cell for rendering
|
///< Add reference into a cell for rendering
|
||||||
|
|
||||||
|
virtual void insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics, MWWorld::Environment& environment) const;
|
||||||
|
|
||||||
virtual std::string getName (const MWWorld::Ptr& ptr) const;
|
virtual std::string getName (const MWWorld::Ptr& ptr) const;
|
||||||
///< \return name (the one that is to be presented to the user; not the internal one);
|
///< \return name (the one that is to be presented to the user; not the internal one);
|
||||||
/// can return an empty string.
|
/// can return an empty string.
|
||||||
|
|
|
@ -9,23 +9,36 @@
|
||||||
|
|
||||||
namespace MWClass
|
namespace MWClass
|
||||||
{
|
{
|
||||||
void Static::insertObj (const MWWorld::Ptr& ptr, MWRender::CellRenderImp& cellRender,
|
void Static::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const
|
||||||
MWWorld::Environment& environment) const
|
|
||||||
{
|
{
|
||||||
ESMS::LiveCellRef<ESM::Static, MWWorld::RefData> *ref =
|
ESMS::LiveCellRef<ESM::Static, MWWorld::RefData> *ref =
|
||||||
ptr.get<ESM::Static>();
|
ptr.get<ESM::Static>();
|
||||||
|
|
||||||
assert (ref->base != NULL);
|
assert (ref->base != NULL);
|
||||||
const std::string &model = ref->base->model;
|
const std::string &model = ref->base->model;
|
||||||
|
|
||||||
if (!model.empty())
|
if (!model.empty())
|
||||||
{
|
{
|
||||||
MWRender::Rendering rendering (cellRender, ref->ref, ref->mData, true);
|
MWRender::Objects objects = renderingInterface.getObjects();
|
||||||
cellRender.insertMesh ("meshes\\" + model);
|
objects.insertBegin(ptr, ptr.getRefData().isEnabled(), false);
|
||||||
cellRender.insertObjectPhysics();
|
objects.insertMesh(ptr, "meshes\\" + model);
|
||||||
ref->mData.setHandle (rendering.end (ref->mData.isEnabled()));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Static::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics, MWWorld::Environment& environment) const
|
||||||
|
{
|
||||||
|
ESMS::LiveCellRef<ESM::Static, MWWorld::RefData> *ref =
|
||||||
|
ptr.get<ESM::Static>();
|
||||||
|
|
||||||
|
|
||||||
|
const std::string &model = ref->base->model;
|
||||||
|
assert (ref->base != NULL);
|
||||||
|
if(!model.empty()){
|
||||||
|
physics.insertObjectPhysics(ptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
std::string Static::getName (const MWWorld::Ptr& ptr) const
|
std::string Static::getName (const MWWorld::Ptr& ptr) const
|
||||||
{
|
{
|
||||||
return "";
|
return "";
|
||||||
|
|
|
@ -9,10 +9,11 @@ namespace MWClass
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
virtual void insertObj (const MWWorld::Ptr& ptr, MWRender::CellRenderImp& cellRender,
|
virtual void insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const;
|
||||||
MWWorld::Environment& environment) const;
|
|
||||||
///< Add reference into a cell for rendering
|
///< Add reference into a cell for rendering
|
||||||
|
|
||||||
|
virtual void insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics, MWWorld::Environment& environment) const;
|
||||||
|
|
||||||
virtual std::string getName (const MWWorld::Ptr& ptr) const;
|
virtual std::string getName (const MWWorld::Ptr& ptr) const;
|
||||||
///< \return name (the one that is to be presented to the user; not the internal one);
|
///< \return name (the one that is to be presented to the user; not the internal one);
|
||||||
/// can return an empty string.
|
/// can return an empty string.
|
||||||
|
|
|
@ -14,23 +14,36 @@
|
||||||
|
|
||||||
namespace MWClass
|
namespace MWClass
|
||||||
{
|
{
|
||||||
void Weapon::insertObj (const MWWorld::Ptr& ptr, MWRender::CellRenderImp& cellRender,
|
void Weapon::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const
|
||||||
MWWorld::Environment& environment) const
|
|
||||||
{
|
{
|
||||||
ESMS::LiveCellRef<ESM::Weapon, MWWorld::RefData> *ref =
|
ESMS::LiveCellRef<ESM::Weapon, MWWorld::RefData> *ref =
|
||||||
ptr.get<ESM::Weapon>();
|
ptr.get<ESM::Weapon>();
|
||||||
|
|
||||||
assert (ref->base != NULL);
|
assert (ref->base != NULL);
|
||||||
const std::string &model = ref->base->model;
|
const std::string &model = ref->base->model;
|
||||||
|
|
||||||
if (!model.empty())
|
if (!model.empty())
|
||||||
{
|
{
|
||||||
MWRender::Rendering rendering (cellRender, ref->ref, ref->mData);
|
MWRender::Objects objects = renderingInterface.getObjects();
|
||||||
cellRender.insertMesh ("meshes\\" + model);
|
objects.insertBegin(ptr, ptr.getRefData().isEnabled(), false);
|
||||||
cellRender.insertObjectPhysics();
|
objects.insertMesh(ptr, "meshes\\" + model);
|
||||||
ref->mData.setHandle (rendering.end (ref->mData.isEnabled()));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Weapon::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics, MWWorld::Environment& environment) const
|
||||||
|
{
|
||||||
|
ESMS::LiveCellRef<ESM::Weapon, MWWorld::RefData> *ref =
|
||||||
|
ptr.get<ESM::Weapon>();
|
||||||
|
|
||||||
|
|
||||||
|
const std::string &model = ref->base->model;
|
||||||
|
assert (ref->base != NULL);
|
||||||
|
if(!model.empty()){
|
||||||
|
physics.insertObjectPhysics(ptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
std::string Weapon::getName (const MWWorld::Ptr& ptr) const
|
std::string Weapon::getName (const MWWorld::Ptr& ptr) const
|
||||||
{
|
{
|
||||||
ESMS::LiveCellRef<ESM::Weapon, MWWorld::RefData> *ref =
|
ESMS::LiveCellRef<ESM::Weapon, MWWorld::RefData> *ref =
|
||||||
|
|
|
@ -9,10 +9,11 @@ namespace MWClass
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
virtual void insertObj (const MWWorld::Ptr& ptr, MWRender::CellRenderImp& cellRender,
|
virtual void insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const;
|
||||||
MWWorld::Environment& environment) const;
|
|
||||||
///< Add reference into a cell for rendering
|
///< Add reference into a cell for rendering
|
||||||
|
|
||||||
|
virtual void insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics, MWWorld::Environment& environment) const;
|
||||||
|
|
||||||
virtual std::string getName (const MWWorld::Ptr& ptr) const;
|
virtual std::string getName (const MWWorld::Ptr& ptr) const;
|
||||||
///< \return name (the one that is to be presented to the user; not the internal one);
|
///< \return name (the one that is to be presented to the user; not the internal one);
|
||||||
/// can return an empty string.
|
/// can return an empty string.
|
||||||
|
|
Loading…
Reference in a new issue