.h
Code: Select all
class CreatureClass : public scene::ISceneNode
{
scene::IAnimatedMesh *mesh;
core::aabbox3d<f32> Box;
video::SMaterial Material;
public:
CreatureClass(scene::ISceneNode* parent, scene::ISceneManager* mgr, s32 id);// : scene::ISceneNode(parent, mgr, id){};
virtual void OnRegisterSceneNode();
virtual void render();
};
Code: Select all
CreatureClass::CreatureClass(scene::ISceneNode* parent, scene::ISceneManager* mgr, s32 id)
: scene::ISceneNode(parent, mgr, id)
{
mesh = SceneManager->getMesh("../models/cowshooter.obj");
Material.Lighting = true;
Material.Wireframe = false;
scene::ISceneNode::setAutomaticCulling(scene::EAC_OFF);
//Box = CreatureClass.getTransformedBoundingBox();
}
void CreatureClass::OnRegisterSceneNode()
{
if (IsVisible)
SceneManager->registerNodeForRendering(this);
ISceneNode::OnRegisterSceneNode();
}
void CreatureClass::render()
{
video::IVideoDriver* driver = SceneManager->getVideoDriver();
driver->setMaterial(Material);
driver->setTransform(video::ETS_WORLD, AbsoluteTransformation);
}
Code: Select all
CreatureClass* soldier;
soldier = new CreatureClass(smgr->getRootSceneNode(),smgr,1);
Help me please, i feel like im missing something really dumb as always but cant figure out what...(im trying to learn )
Also i have no idea on how to get the bounding box.