by the way my car assembler looks like this:
Code: Select all
namespace veedub
{
class carModel
{
public:
//load the carChassis 3d model: path to 3d model, parent node, position, rotation
void loadCarChassis(path filenameModel, ISceneNode* parent = vw_node, vector3df pos = vector3df(0,0,0), vector3df rot = vector3df(0,0,0))
{
car_chassis = smgr->getMesh(filenameModel);
car_chassis_node = smgr->addAnimatedMeshSceneNode(car_chassis, parent, -1, pos, rot);
}
//load the carBody 3d model: path to 3d model, parent node, position, rotation
void loadCarBody(path filenameModel, ISceneNode* parent = vw_node, vector3df pos = vector3df(0,0,0), vector3df rot = vector3df(0,0,0))
{
car_body = smgr->getMesh(filenameModel);
car_body_node = smgr->addAnimatedMeshSceneNode( car_body, parent, -1, pos, rot);
}
//load the hood 3d model: path to 3d model, parent node, position, rotation
void loadHood(path filenameModel, ISceneNode* parent = vw_node, vector3df pos = vector3df(0,0,0), vector3df rot = vector3df(0,0,0))
{
hood = smgr->getMesh(filenameModel);
hood_node = smgr->addAnimatedMeshSceneNode(hood, parent, -1, pos, rot);
}
//load the grille 3d model: path to 3d model, parent node, position, rotation
void loadGrille(path filenameModel, ISceneNode* parent = vw_node, vector3df pos = vector3df(0,0,0), vector3df rot = vector3df(0,0,0))
{
front_grille = smgr->getMesh(filenameModel);
front_grille_node = smgr->addAnimatedMeshSceneNode(front_grille, parent, -1, pos, rot);
}
and in event receiver:
Code: Select all
if(checkbox_mk1golf->isChecked())
{
//load models
car->initParentNodes();
car->loadCarBody("data/models/mk1golf/car_body.3ds");
car->loadCarChassis("data/models/mk1golf/chassis.3ds");
car->loadHood("data/models/mk1golf/hood.3ds");
car->loadGrille("data/models/mk1golf/2L_F_grille.3ds");
car->loadGrilleEdge("data/models/mk1golf/grille_edge.3ds");
car->loadAntenna("data/models/mk1golf/antenna.3ds");
car->loadBrakeDiscs("data/models/mk1golf/brake_discs.3ds");
car->loadCalipers("data/models/mk1golf/calipers.3ds");
car->loadControlArms("data/models/mk1golf/control_arms.3ds");
car->loadEmblem("data/models/mk1golf/emblem.3ds");
car->loadExhaust("data/models/mk1golf/exhaust_0.3ds");
car->loadFenders("data/models/mk1golf/fenders_1.3ds");
car->loadFrontBumper("data/models/mk1golf/f_bumper_1.3ds");
car->loadRearBumper("data/models/mk1golf/r_bumper_1.3ds");
car->loadFrontLights("data/models/mk1golf/2F_lights.3ds",
"data/models/mk1golf/2F_lights_glass.3ds");
car->loadGTIBadge("data/models/mk1golf/gti_badge.3ds");
car->loadGTILip("data/models/mk1golf/gti_lip.3ds");
car->loadShockAbsorbers("data/models/mk1golf/shock_absorbers.3ds");
car->loadSprings("data/models/mk1golf/springs.3ds");
car->loadSteeringWheel("data/models/mk1golf/steering_wheel.3ds");
car->loadTailLights("data/models/mk1golf/tail_lights.3ds",
"data/models/mk1golf/tail_lights_glass.3ds");
car->loadVWBadge("data/models/mk1golf/vw_badge.3ds");
car->loadWhipers("data/models/mk1golf/whipers.3ds");
car->loadWindows("data/models/mk1golf/wind_shield.3ds",
"data/models/mk1golf/windows.3ds");
car->loadDoorHandlers("data/models/mk1golf/door_handlers.3ds");
car->loadRails("data/models/mk1golf/rails.3ds");
car->loadSideMirrors("data/models/mk1golf/mirrors_body.3ds",
"data/models/mk1golf/mirrors_glass.3ds");
car->loadWindowsEdges("data/models/mk1golf/window_edges.3ds");
car->loadFuelCap("data/models/mk1golf/fuel_cap.3ds");
car->loadWheels("data/models/wheels/ats_classic/ATSC_F_L.3ds",
"data/models/wheels/ats_classic/ATSC_F_R.3ds",
"data/models/wheels/ats_classic/ATSC_R_L.3ds",
"data/models/wheels/ats_classic/ATSC_R_R.3ds");
//workaround
car->loadSideSkirts("data/models/mk1golf/side_skirt_1.3ds");
car->partIsVisible(side_skirt_node, false);
car->loadSpoilers("data/models/mk1golf/spoiler_1.3ds");
car->partIsVisible(spoiler_node,false);
car->loadModelTexture(car_body_node,"data/textures/mk1golf/colors/red/chassis3.jpg");
car->loadModelTexture(car_chassis_node,"data/textures/mk1golf/colors/red/chassis.jpg");
car->loadModelTexture(fenders_node,"data/textures/mk1golf/colors/red/fenders.jpg");
car->loadModelTexture(hood_node,"data/textures/mk1golf/colors/red/hood.jpg");
car->loadModelTexture(antenna_node,"data/textures/mk1golf/antenna_chrome.jpg");
car->loadModelTexture(front_bumper_node,"data/textures/mk1golf/chrome_bumpers.jpg");
car->loadModelTexture(rear_bumper_node,"data/textures/mk1golf/chrome_bumpers.jpg");
car->loadModelTexture(gti_lip_node,"data/textures/mk1golf/gti_lip.jpg");
car->loadModelTexture(grille_edge_node,"data/textures/mk1golf/grille_edge.jpg");
car->loadModelTexture(whipers_node,"data/textures/mk1golf/whipers.jpg");
car->loadModelTexture(front_grille_node,"data/textures/mk1golf/grille.jpg");
car->loadModelTexture(exhaust_node,"data/textures/mk1golf/exhaust.jpg");
car->loadModelTexture(windows_node,"data/textures/mk1golf/windows/windows_glass.jpg",0,EMT_TRANSPARENT_ADD_COLOR);
car->loadModelTexture(wind_shield_node,"data/textures/mk1golf/windows/windshield_glass.jpg",0,EMT_TRANSPARENT_ADD_COLOR);
car->loadModelTexture(front_lights_glass_node,"data/textures/mk1golf/front_lights/stoc/front_light_glass.jpg",0,EMT_TRANSPARENT_ADD_COLOR);
car->loadModelTexture(front_lights_node,"data/textures/mk1golf/front_lights/stoc/front_light_body.jpg",0,EMT_SOLID, EMF_LIGHTING, true);
car->loadModelTexture(tail_lights_glass_node,"data/textures/mk1golf/tail_lights/taillights.jpg");
car->loadModelTexture(windows_edges_node,"data/textures/mk1golf/windows_edges.jpg");
car->loadModelTexture(door_handlers_node,"data/textures/mk1golf/door_handlers.jpg");
car->loadModelTexture(side_mirrors_node,"data/textures/mk1golf/side_mirrors.jpg");
car->loadModelTexture(side_mirrors_glass_node,"data/textures/mk1golf/side_mirrors_glass.jpg");
car->loadModelTexture(luggage_rails_node,"data/textures/mk1golf/rails.jpg");
car->loadModelTexture(control_arms_node,"data/textures/mk1golf/control_arms.jpg");
car->loadModelTexture(shock_absorbers_node,"data/textures/mk1golf/shocks.jpg");
car->loadModelTexture(steering_wheel_node,"data/textures/mk1golf/steering_wheel.jpg");
car->loadModelTexture(springs_node,"data/textures/mk1golf/springs.jpg");
car->loadModelTexture(emblem_node,"data/textures/mk1golf/emblems/emblem.jpg");
car->loadModelTexture(brake_discs_node,"data/textures/mk1golf/brake_discs/brakedisc.jpg");
car->loadModelTexture(calipers_node,"data/textures/mk1golf/calipers/calipers.jpg");
car->loadModelTexture(fuel_cap_node,"data/texture/mk1golf/fuel_cap.jpg");
car->loadModelTexture(vw_badge_node,"data/textures/mk1golf/badges.jpg");
car->loadModelTexture(gti_badge_node,"data/textures/mk1golf/badges.jpg");