About Store Forum Documentation Contact



Post Reply 
[SOLVED]Can not render my world
Author Message
Otolone Offline
Member

Post: #1
[SOLVED]Can not render my world
Hi,
I have a small demo with a a racing tract and a car objects.I copied the code in the world tutorials.I dragged and dropped my world into the UID and also dragged and dropped the race track object into the setObjectType(chr,=====)
When I run my game I get the following
errors C2065:"items":undeclared identifier
and
error C2228:left of setObjectType must have class/struct/union.
Please help.
Thanks in advance.
(This post was last modified: 10-12-2015 07:36 PM by Otolone.)
10-11-2015 08:14 AM
Find all posts by this user Quote this message in a reply
Tottel Offline
Member

Post: #2
RE: Can not render my world
Hi there,

Could you should us some code? Specifically what you would put in main (InitPre + world containers)
10-11-2015 08:34 AM
Find all posts by this user Quote this message in a reply
Otolone Offline
Member

Post: #3
RE: Can not render my world
This is my code
/******************************************************************************/
Game.ObjMap<Game.Item>items; // container for item objects
Game.ObjMap<Game.Chr > Chrs; // container for character objects
/******************************************************************************/
void InitPre()
{
EE_INIT();
App.flag=APP_MS_EXCLUSIVE;

Cam.dist =10;
Cam.yaw =-PI_4;
Cam.pitch=-0.5;
Cam.at.set(16, 0, 16);
}
/******************************************************************************/
bool Init()
{
Physics.create(EE_PHYSX_DLL_PATH);

// set world active range to match the view range
Game.World.activeRange(D.viewRange());

// we need to tell the world 'which class handles which object type'
// this is done by assigning memory containers to certain Object Types
Game.World.setObjType(Items, OBJ_ITEM) // set 'Items' memory container for 'OBJ_ITEM' objects
.setObjType(Chrs, OBJ_CHR); // set 'Chrs' memory container for 'OBJ_CHR' objects

// now when the engine is set up properly we can start a 'new game' with a builded world
Game.World.New(UID(1897616802, 1297798754, 1855197886, 2782623339)); // create the world by giving path to world

if(Game.World.settings().environment) // if the world has environment settings (like sun, ambient, sky, ..)
Game.World.settings().environment->set(); // then set them

// when the world is set it doesn't actually load all the terrain and objects into memory
// it loads only information about them
// you need to tell the world which terrain and objects you need to use at the moment
// to do that call:
Game.World.update(Cam.at); // which updates world to use only terrain and objects at given position, here camera position is used

return true;
}
/******************************************************************************/
void Shut()
{
}
/******************************************************************************/
bool Update()
{
if(Kb.bp(KB_ESC))return false;
Cam.transformByMouse(0.1, 100, CAMH_ZOOM|(Ms.b(1)?CAMH_MOVE:CAMH_ROT));

Game.World.update(Cam.at); // update the world to given position

return true;
}
/******************************************************************************/
void Render()
{
Game.World.draw(); // draw world (this is done outside of 'switch(Renderer())' because world automatically detects active rendering mode)
}
void Draw()
{
Renderer(Render);
}
/******************************************************************************/

PS: In my object editor "OBJ_CHR" I have the racing track and my car, "OBJ_ITEM" is empty.
(This post was last modified: 10-11-2015 06:14 PM by Otolone.)
10-11-2015 06:04 PM
Find all posts by this user Quote this message in a reply
krokodilcapa Offline
Member

Post: #4
RE: Can not render my world
Hi!

Inside your Init function you're using Items with capital "I" letter, but the container's real name is "items".
10-11-2015 10:01 PM
Find all posts by this user Quote this message in a reply
Otolone Offline
Member

Post: #5
RE: Can not render my world
1 succeeded 0 failed blah blah blah.
Thanks to all .
P:s How do you mark this as solved?
10-12-2015 05:41 PM
Find all posts by this user Quote this message in a reply
Zervox Offline
Member

Post: #6
RE: Can not render my world
Just edit the first post I think then you can alter the topic title and add [SOLVED] before it.
10-12-2015 05:56 PM
Find all posts by this user Quote this message in a reply
Post Reply