Pixel Perfect
Member
|
[SOLVED] Question on object creation
I'm not entirely sure what's going on here. Are different conditions required depending on whether objCreate() or objCreateNear() are used?
The reason I ask is because if the following is placed at the start of the update loop then it works:
Code:
Game::ObjParamsPtr obj=Game::Objs.ptrRequire(UID(235184133, 1276344003, 2280509360, 3125416058));
obj->type(true,UID(3387464413, 1205019976, 2378094473, 973698012));
// Create new object at position and use objects default scaling
Game::World.objCreate(*obj, Matrix(obj->scale3(), Vec(-379.5, 4.0, 93.6)));
but this doesn't, the function returns a NULL obj pointer
Code:
Game::ObjParamsPtr obj=Game::Objs.ptrRequire(UID(235184133, 1276344003, 2280509360, 3125416058));
obj->type(true, UID(3387464413, 1205019976, 2378094473, 973698012));
// Create new object at position and use objects default scaling
Game::Obj* myObj = Game::World.objCreateNear(*obj, Matrix(obj->scale(), Vec(-379.5, 4.0, 93.6)));
However, introduce a slight delay and the second function works! What exactly is the objCreateNear() function intended for and why does it appear to take longer than objCreate to work after first entering the Update loop? What is its successful operation dependent on?
(This post was last modified: 08-20-2013 07:06 PM by Pixel Perfect.)
|
|
08-18-2013 07:51 PM |
|
Esenthel
Administrator
|
RE: Question on object creation
Hi,
That's in the method comments:
Quote:method fails if 'matrix' is out of active range
Hope this helps!
|
|
08-20-2013 04:12 AM |
|