DNS
Member
|
Game::World.objCreate
I want create object with own id
like this:
Game::World.objCreate(*objPoint, Matrix(objPoint->scale(), Vec(1,1,1) ), (UID)999 );
I get response
error C2440: 'type cast' : cannot convert from 'int' to 'EE::UID'
So how do give id?
|
|
07-19-2012 10:18 PM |
|
krokodilcapa
Member
|
RE: Game::World.objCreate
Hi!
Take a look at UID.h, and you can see in the comments what form you can use in UID. If you don't want to use this kind of UID, just a simple int for example, you can still make your own extended object class with an int type ID.
|
|
07-20-2012 01:00 AM |
|
Harry
Member
|
RE: Game::World.objCreate
Shouldn't look like this?
Code:
UID uid(0,999);
Game::World.objCreate(*objPoint, Matrix(objPoint->scale(), Vec(1,1,1) ), &uid);
As I see the last parameter is a pointer to UID object.
(This post was last modified: 07-20-2012 10:48 AM by Harry.)
|
|
07-20-2012 10:47 AM |
|
DNS
Member
|
RE: Game::World.objCreate
I have another question.
How get id create object.
I create it like this:
Game::World.objCreate(*objPoint, Matrix(objPoint->scale(), Vec(1,1,1) ));
And i would like get id this object and use it in my struct.
Statics[CREATE_OBJECT_ID].pos(Vec(1,1,1));
|
|
07-20-2012 10:50 PM |
|
krokodilcapa
Member
|
RE: Game::World.objCreate
Maybe its not the best way, but:
Code:
FREP(Statics.elms())
if(Statics[i].id().asText() == "60C6AD018FA7028D4F39121493895D34")
Statics[i].pos(Vec(0,0,0));
(This post was last modified: 07-20-2012 11:20 PM by krokodilcapa.)
|
|
07-20-2012 11:16 PM |
|
PsychoBoy
Member
|
RE: Game::World.objCreate
If you want to use it on multiple objects maybe create map, ID as key and object as data.
|
|
07-20-2012 11:30 PM |
|