first of all, for those who noticed, few times i posted and then deleted my post, its just that i found the answers to my questions so if there is no answer yet, i just delete, sorry if it annoyed some, dunno, just telling.
anyway, i try to make my own class and since im not familiar with the whole process, im kinda stuck already.
here is my code :
ImyRagdollSceneNode.h
Code: Select all
#ifndef __I_MY_RAGDOLL_SCENE_NODE__H__
#define __I_MY_RAGDOLL_SCENE_NODE__H__
#include <irrlicht.h>
using namespace irr;
namespace irr
{
namespace scene
{
class ImyRagdollSceneNode : public ISceneNode
{
//defined by user
core::vector3df ragPosition;
core::vector3df ragRotation;
u32 ragState;
u32 ragID;
//calculated in .cpp
////////////////////////////////////////////////////////
/////////////// BODY PART ///////////////////
////////////////////////////////////////////////////////
//torso
core::vector3df torsoPos;
core::vector3df torsoRot;
u32 torsoID;
//belly
core::vector3df bellyPos;
core::vector3df bellyRot;
u32 bellyID;
//bottom
core::vector3df bottomPos;
core::vector3df bottomRot;
u32 bottomID;
//head
core::vector3df headPos;
core::vector3df headRot;
u32 headID;
//right upper arm
core::vector3df r_up_armPos;
core::vector3df r_up_armRot;
u32 r_up_armID;
//right lower arm
core::vector3df r_low_armPos;
core::vector3df r_low_armRot;
u32 r_low_armID;
//right hand
core::vector3df r_handPos;
core::vector3df r_handRot;
u32 r_handID;
//left upper arm
core::vector3df l_up_armPos;
core::vector3df l_up_armRot;
u32 l_up_armID;
//left lower arm
core::vector3df l_low_armPos;
core::vector3df l_low_armRot;
u32 l_low_armID;
//left hand
core::vector3df l_handPos;
core::vector3df l_handRot;
u32 l_handID;
//right upper leg
core::vector3df r_up_legPos;
core::vector3df r_up_legRot;
u32 r_up_legID;
//right lower arm
core::vector3df r_low_legPos;
core::vector3df r_low_legRot;
u32 r_low_legID;
//right feet
core::vector3df r_feetPos;
core::vector3df r_feetRot;
u32 r_feetID;
//left upper leg
core::vector3df l_up_legPos;
core::vector3df l_up_legRot;
u32 l_up_legID;
//left lower leg
core::vector3df l_low_legPos;
core::vector3df l_low_legRot;
u32 l_low_legID;
//left feet
core::vector3df l_feetPos;
core::vector3df l_feetRot;
u32 l_feetID;
////////////////////////////////////////////////////////
/////////////// BODY JOINT ///////////////////
////////////////////////////////////////////////////////
//torso_belly
core::vector3df torso_bellyPos;
core::vector3df torso_bellyRot;
//torso_neck
core::vector3df torso_neckPos;
core::vector3df torso_neckRot;
//belly_botom
core::vector3df belly_bottomPos;
core::vector3df belly_bottomRot;
//torso_right_upper_arm
core::vector3df torso_r_up_armPos;
core::vector3df torso_r_up_armRot;
//right_upper_arm_right_lower_arm
core::vector3df r_up_arm_r_low_armPos;
core::vector3df r_up_arm_r_low_armRot;
//right_lower_arm_right_hand
core::vector3df r_low_arm_r_handPos;
core::vector3df r_low_arm_r_handRot;
//torso_left_upper_arm
core::vector3df torso_l_up_armPos;
core::vector3df torso_l_up_armRot;
//left_upper_arm_left_lower_arm
core::vector3df l_up_arm_l_low_armPos;
core::vector3df l_up_arm_l_low_armRot;
//left_lower_arm_left_hand
core::vector3df l_low_arm_l_handPos;
core::vector3df l_low_arm_l_handRot;
//bottom_right_upper_leg
core::vector3df bottom_r_up_legPos;
core::vector3df bottom_r_up_legRot;
//right_upper_leg_righ_lower_leg
core::vector3df r_up_leg_r_low_legPos;
core::vector3df r_up_leg_r_low_legRot;
//right_lower_leg_right_feet
core::vector3df r_low_leg_r_feetPos;
core::vector3df r_low_leg_r_feetRot;
//bottom_left_upper_leg
core::vector3df bottom_l_up_legPos;
core::vector3df bottom_l_up_legRot;
//left_upper_leg_left_lower_leg
core::vector3df l_up_leg_l_low_legPos;
core::vector3df l_up_leg_l_low_legRot;
//left_lower_leg_left_feet
core::vector3df l_low_leg_l_feetPos;
core::vector3df l_low_leg_l_feetRot;
public:
//albator
ImyRagdollSceneNode
(
core::vector3df ragPosition, //ragdoll position
core::vector3df ragRotation, //ragdoll rotation
u32 ragState, //ragdoll state, animation
u32 ragID, //ragdoll ID
scene::ISceneManager* smgr, //pointer
scene::ISceneNode* parent = 0, //parent node
s32 id = -1 //ID
);
//minotaur
~ImyRagdollSceneNode();
//frame
virtual void OnRegisterSceneNode();
//render
virtual void render();
};
}
}
#endif
Code: Select all
#include <irrlicht.h>
#include "ImyRagdollSceneNode.h"
namespace irr
{
namespace scene
{
//albator
ImyRagdollSceneNode::ImyRagdollSceneNode
(
core::vector3df ragPosition, //ragdoll position
core::vector3df ragRotation, //ragdoll rotation
u32 ragState, //ragdoll state, animation
u32 ragID, //ragdoll ID
scene::ISceneManager* smgr, //pointer
scene::ISceneNode* parent = 0, //parent node
s32 id = -1 //ID
): ISceneNode(smgr->getRootSceneNode(), smgr, id)
{
//DO THE RAGDOLL
}
//minotaur
ImyRagdollSceneNode::~ImyRagdollSceneNode(){}
//frame
void ImyRagdollSceneNode::OnRegisterSceneNode()
{
if (IsVisible)SceneManager->registerNodeForRendering(this);
ISceneNode::OnRegisterSceneNode();
}
//render ragdoll
void ImyRagdollSceneNode::render()
{
video::IVideoDriver* driver = SceneManager->getVideoDriver();
if (!driver) return;
}
}
}
Code: Select all
//ragdoll test
scene::ImyRagdollSceneNode*myRagdoll = new scene::ImyRagdollSceneNode(
core::vector3df (0.0f,0.0f,0.0f), //ragdoll position
core::vector3df (0.0f,0.0f,0.0f), //ragdoll rotation
0, //ragdoll state, animation
0, //ragdoll ID
smgr, //pointer
0, //parent node
-1); //ID
on an irc channel someone told me that it could be a missing virtual void stuff()=0; but i dont really understand.object of abstract class type "irr::scene::ImyRagdollSceneNode" is not allowed
did i forgot something before trying to make any calculs and stuff ?
can someone help me fixing it ?