Crystal Space
Welcome,
Guest
. Please
login
or
register
.
June 19, 2013, 08:36:39 pm
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Search:
Advanced search
9261
Posts in
2262
Topics by
5443
Members
Latest Member:
Michealclark
Crystal Space
Crystal Space Development
Support
how to get the mesh object's name?
« previous
next »
Pages:
[
1
]
Author
Topic: how to get the mesh object's name? (Read 2081 times)
Jr. Member
Posts: 81
how to get the mesh object's name?
«
on:
October 30, 2008, 08:41:28 am »
I am new in CS and CEL;
When I run the walktut in CEL , I found some questions, plesae help me !!
1. In "walktut_world" file it defines a lot of mesh objects like "cube.001, cube.002, ……" ,I don't know what are the meaning of them, are they mean rooms in the world or other things?
2. In "walktut_world" application , it mentions "region" and "zone" many times and when it create a player and put the player in a region ,it uses a region's name to put the player into the region, the code is followed:
csRef<iPcMesh> pcmesh = CEL_QUERY_PROPCLASS_ENT (player_entity, iPcMesh);
pcmesh->SetPath ("/cellib/objects");
pcmesh->SetMesh ("test", "cally.cal3d");
if (!pcmesh->GetMesh ())
return ReportError ("Error loading model!");
if (pczonemgr->PointMesh ("player", "main", "Camera"))
return ReportError ("Can't find region or start position in region!");
but in "walktut_world" file I can't found the region name "main" , I don't know how is it to get the region's name?
Please help me! Thank you very much!!!
Logged
jorrit
Administrator
Hero Member
Posts: 1703
Re: how to get the mesh object's name?
«
Reply #1 on:
October 30, 2008, 09:06:11 am »
Mesh objects are geometrical objects. i.e. things you can see and that have a triangle mesh.
Walktut uses the default region. That is not defined in the world file. It is created automatically inc code.
Greetings,
Logged
Jr. Member
Posts: 81
Re: how to get the mesh object's name?
«
Reply #2 on:
October 30, 2008, 09:52:13 am »
The game world is make up of many rooms, and they are named when they are builded. How can i get the name of the room using c++ code?
Logged
jorrit
Administrator
Hero Member
Posts: 1703
Re: how to get the mesh object's name?
«
Reply #3 on:
October 30, 2008, 09:53:16 am »
I suppose you mean sectors? For any CS object (sector, mesh object, factory, ...) you can always do object->QueryObject()->GetName() to get the name.
Greetings,
Logged
Jr. Member
Posts: 81
Re: how to get the mesh object's name?
«
Reply #4 on:
October 30, 2008, 10:02:07 am »
uh, Yes, it is!!! Thank you!!
In walktut application, it is using the code to build a zone and region with the name of "main", then loading the world of "walktut_world" for the game, Is the zone/region means "walktut_world" . or they are only the part of the world?!
The code to build the zone and region is follow:
csRef<iPcZoneManager> zonemgr = CEL_QUERY_PROPCLASS_ENT (level_entity,
iPcZoneManager);
iCelZone* zone = zonemgr->CreateZone ("main");
iCelRegion* region = zonemgr->CreateRegion ("main");
zone->LinkRegion (region);
Logged
Jr. Member
Posts: 81
Re: how to get the mesh object's name?
«
Reply #5 on:
October 30, 2008, 10:12:31 am »
Now i get a point which points to sector , if a want to get the name of the sector , can i do like this :
iSector* sector = pcmesh->GetMesh ()->GetMovable ()->GetSectors ()->Get (0);
char *name = sector->QueryObjec->GetName();
Logged
jorrit
Administrator
Hero Member
Posts: 1703
Re: how to get the mesh object's name?
«
Reply #6 on:
October 30, 2008, 11:28:07 am »
yes almost. Use QueryObject(). Not QueryObjec
Greetings,
Logged
Pages:
[
1
]
« previous
next »
Jump to:
Please select a destination:
-----------------------------
Crystal Space Development
-----------------------------
=> General Crystal Space Discussion
=> Support
-----------------------------
Crystal Space Project Development
-----------------------------
=> Feature Requests
=> Plugins
=> Bug Reports
-----------------------------
Crystal Space Development
-----------------------------
=> Game Content Creation
-----------------------------
Miscellaneous
-----------------------------
=> Article/Tutorial Requests
=> Article/Tutorial Discussion
-----------------------------
Crystal Space Project Development
-----------------------------
=> Development Discussion
-----------------------------
Crystal Space Projects
-----------------------------
=> Project Discussion
=> WIP Projects
=> Finished Projects
-----------------------------
Associate Projects
-----------------------------
=> CEL Discussion
=> Crystal Core Discussion
=> CrystalBlend Discussion
-----------------------------
Crystal Space Project Development
-----------------------------
=> Google Summer of Code
-----------------------------
Associate Projects
-----------------------------
=> Apricot (Open Game)
=> Ares Project
Loading...