Click here to Skip to main content
16,005,169 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: C2143 Pin
CPallini4-Jun-08 22:48
mveCPallini4-Jun-08 22:48 
QuestionRe: C2143 Pin
T.RATHA KRISHNAN4-Jun-08 22:56
T.RATHA KRISHNAN4-Jun-08 22:56 
QuestionRe: C2143 Pin
CPallini4-Jun-08 23:16
mveCPallini4-Jun-08 23:16 
AnswerRe: C2143 Pin
T.RATHA KRISHNAN4-Jun-08 23:44
T.RATHA KRISHNAN4-Jun-08 23:44 
GeneralRe: C2143 Pin
CPallini5-Jun-08 0:04
mveCPallini5-Jun-08 0:04 
GeneralRe: C2143 Pin
super_ttd14-Jun-08 23:26
super_ttd14-Jun-08 23:26 
AnswerRe: C2143 Pin
Cedric Moonen4-Jun-08 22:50
Cedric Moonen4-Jun-08 22:50 
QuestionRe: C2143 Pin
T.RATHA KRISHNAN4-Jun-08 22:55
T.RATHA KRISHNAN4-Jun-08 22:55 
Here is the complete listing.

#include "HelloWorld.h"
#include <dtCore/globals.h>
#include <dtCore/object.h>
#include <dtCore/orbitmotionmodel.h>
#include <dtCore/scene.h>
#include <osgDB/FileUtils>
#include <dtCore/dt.h>
#include <dtABC/application.h>
#include <dtCore/deltawin.h>

HelloWorld::HelloWorld(const std::string& configFilename):dtABC::Application(configFilename),mText(0),mOrbitMotionModel(0)
{
   // Generating a default config file if the one passed in is not there.
	
	if(osgDB::findDataFile(configFilename).empty())
   {
      GenerateDefaultConfigFile();
   }
}
HelloWorld::~HelloWorld()
{
}

void HelloWorld::Config()
{
 // Allocate a dtCore::Object. This class will be your basic container
// for 3D meshes.
 mText = new dtCore::Object("Text");
// Load the model file, in this case a OpenFligth model (.flt)
 mText->LoadFile("HelloWorld.flt");
// Add the Object to the scene. Since mText is a RefPtr, we must
// pull the internal point out to pass it to the Scene.
 GetScene()->AddDrawable( mText.get() );
 // Adjust the Camera position by instantiating a transform object to
// store the camera position and attitude.
dtCore:: Transform camPos;
camPos.SetLookAt( 0.0f, -100.0f, 20.0f, // Position
                  0.0f, 0.0f, 0.0f,     // Look At
                  0.0f, 0.0f, 1.0f);    // Up Vector
GetCamera()->SetTransform(camPos);
// Setting a motion model for the camera

mOrbitMotionModel = new dtCore::OrbitMotionModel(GetKeyboard(),GetMouse());

// Setting the camera as a target for the motion model. The object (the hello
// world 3D text) will be static at 0,0,0 and the camera will move using 
// the right clicked mouse.
mOrbitMotionModel->SetTarget(GetCamera());
}

int main()
{
   // Setup the data file search paths for the config file and the models files.
   // This is best done in main prior to configuring app. That way the paths
   // are ensured to be correct when loading data.
   dtCore::SetDataFilePathList( ".;" + dtCore::GetDeltaDataPathList());

   // Instantiate the application and look for the config file
   // You do not have to call delete on this.
   dtCore::RefPtr<HelloWorld> app = new HelloWorld( "config.xml" );
   // Configure the application
   app->Config();
   // Run the simulation loop
   app->Run();

	return 0;
}

QuestionRe: C2143 Pin
David Crow5-Jun-08 2:54
David Crow5-Jun-08 2:54 
Questionconstructor failed??? [modified] Pin
dealon4-Jun-08 21:05
dealon4-Jun-08 21:05 
AnswerRe: constructor failed??? Pin
Cedric Moonen4-Jun-08 21:12
Cedric Moonen4-Jun-08 21:12 
GeneralRe: constructor failed??? Pin
CPallini4-Jun-08 21:19
mveCPallini4-Jun-08 21:19 
AnswerRe: constructor failed??? Pin
toxcct4-Jun-08 21:13
toxcct4-Jun-08 21:13 
GeneralRe: constructor failed??? Pin
CPallini4-Jun-08 21:21
mveCPallini4-Jun-08 21:21 
GeneralRe: constructor failed??? Pin
toxcct4-Jun-08 21:22
toxcct4-Jun-08 21:22 
GeneralRe: constructor failed??? Pin
CPallini4-Jun-08 21:36
mveCPallini4-Jun-08 21:36 
GeneralRe: constructor failed??? Pin
Hamid_RT4-Jun-08 23:52
Hamid_RT4-Jun-08 23:52 
GeneralRe: constructor failed??? Pin
CPallini4-Jun-08 23:55
mveCPallini4-Jun-08 23:55 
AnswerRe: constructor failed??? Pin
CPallini4-Jun-08 21:16
mveCPallini4-Jun-08 21:16 
GeneralRe: constructor failed??? Pin
dealon4-Jun-08 21:36
dealon4-Jun-08 21:36 
GeneralRe: constructor failed??? Pin
toxcct4-Jun-08 21:38
toxcct4-Jun-08 21:38 
GeneralRe: constructor failed??? Pin
CPallini4-Jun-08 21:46
mveCPallini4-Jun-08 21:46 
AnswerRe: constructor failed??? [modified] Pin
ShilpiP4-Jun-08 21:32
ShilpiP4-Jun-08 21:32 
GeneralRe: constructor failed??? Pin
toxcct4-Jun-08 21:37
toxcct4-Jun-08 21:37 
GeneralRe: constructor failed??? Pin
dealon4-Jun-08 21:43
dealon4-Jun-08 21:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.