About Store Forum Documentation Contact



Post Reply 
Game::World.objCreate
Author Message
DNS Offline
Member

Post: #1
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
Find all posts by this user Quote this message in a reply
krokodilcapa Offline
Member

Post: #2
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.wink
07-20-2012 01:00 AM
Find all posts by this user Quote this message in a reply
Harry Offline
Member

Post: #3
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
Visit this user's website Find all posts by this user Quote this message in a reply
DNS Offline
Member

Post: #4
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
Find all posts by this user Quote this message in a reply
krokodilcapa Offline
Member

Post: #5
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
Find all posts by this user Quote this message in a reply
PsychoBoy Offline
Member

Post: #6
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
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply