FORUM CLOSED, PLEASE REGISTER AT FORUM.SIO2INTERACTIVE.COM
Would you like to react to this message? Create an account in a few clicks or log in to continue.

sio2ObjectDuplicate only works for Physic object ?

3 posters

Go down

sio2ObjectDuplicate  only works for Physic object ? Empty sio2ObjectDuplicate only works for Physic object ?

Post  sw Sun Feb 01, 2009 9:20 pm

in sio2ObjectDuplicate :

sio2PhysicAddObject( sio2->_SIO2physic,
dup );


does really need to add physic attribute ?
sw
sw

Posts : 73
Join date : 2008-10-12

Back to top Go down

sio2ObjectDuplicate  only works for Physic object ? Empty Re: sio2ObjectDuplicate only works for Physic object ?

Post  exavi Mon Feb 02, 2009 6:51 am

the project I'm currently working on, does not need any physics feature so I am using this one, is the old sio2ObjectDuplicate(). works fine.

Code:
SIO2object *oldObjectDuplicate( SIO2object *_SIO2object,char *_name )
{
   SIO2object *dup = sio2ObjectInit( _name );
   memcpy( dup->_SIO2transform->loc, _SIO2object->_SIO2transform->loc, 12 );
   memcpy( dup->_SIO2transform->rot, _SIO2object->_SIO2transform->rot, 12 );
   memcpy( dup->_SIO2transform->scl, _SIO2object->_SIO2transform->scl, 12 );
   memcpy( dup->dim, _SIO2object->dim, 12 );
   
   dup->rad    = _SIO2object->rad;
   dup->flags  = _SIO2object->flags;
   dup->bounds  = _SIO2object->bounds;
   dup->mass    = _SIO2object->mass;
   dup->damp    = _SIO2object->damp;
   dup->rotdamp = _SIO2object->rotdamp;
   
   sio2StringCpy( dup->instname, _SIO2object->name );
   
   dup->_SIO2instance = _SIO2object;
   
   return dup;
}

exavi

Posts : 37
Join date : 2008-10-21

Back to top Go down

sio2ObjectDuplicate  only works for Physic object ? Empty Re: sio2ObjectDuplicate only works for Physic object ?

Post  sio2interactive Mon Feb 02, 2009 10:04 am

sw: You do have a point, I change the function prototype to receive a 1 or 0 to copy or not the physic attributes... I already commit it so you can find the MOD in the latest SVN rev.

Cheers,
sio2interactive
sio2interactive

Posts : 1526
Join date : 2008-08-26
Age : 44
Location : Shanghai

http://sio2interactive.com

Back to top Go down

sio2ObjectDuplicate  only works for Physic object ? Empty Re: sio2ObjectDuplicate only works for Physic object ?

Post  Sponsored content


Sponsored content


Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum