model disappears when doing sio2ObjectSoftCopy
2 posters
model disappears when doing sio2ObjectSoftCopy
So I integrated tutorial 61's example code for sio2ObjectSoftCopy. I'm copying a cube that resides in the .sio2 file and adjusting its x/y before displaying the copy. Most of the time this works fine, but quite often the original cube randomly disappears (and the new one doesn't appear either). I tried sio2ObjectHardCopy and the same behavior occurred.
Here's the relevant code:
Here's the relevant code:
- Code:
SIO2object *_original = ( SIO2object * )sio2ResourceGet( sio2->_SIO2resource, SIO2_OBJECT, "object/Cube" );
if (_original) {
//NSLog ( @"found obj to duplicate %");
static unsigned int i = 0;
char tmp_name[ SIO2_MAX_CHAR ] = {""};
sprintf( tmp_name, "%s%d", _original->name, i );
SIO2object *_new = sio2ObjectHardCopy(_original, tmp_name);
_original->_SIO2transform->loc->x = x;
_original->_SIO2transform->loc->y = y;
_original->_SIO2transform->loc->z = 0.0f;
sio2TransformCopy( _new->_SIO2transform,
_original->_SIO2transform );
sio2TransformBindMatrix( _new->_SIO2transform );
}
bwalker- Posts : 10
Join date : 2009-07-28
Similar topics
» Using Md5 model format
» Problem in tutorial 02 using my own model
» Added a physics capable model on the fly.
» Character Model and Collisions
» Crash when rendering model as well as font
» Problem in tutorial 02 using my own model
» Added a physics capable model on the fly.
» Character Model and Collisions
» Crash when rendering model as well as font
Permissions in this forum:
You cannot reply to topics in this forum