sio2ObjectDuplicate only works for Physic object ?

View previous topic View next topic Go down

sio2ObjectDuplicate only works for Physic object ?

Post  sw on Sun Feb 01, 2009 9:20 pm

in sio2ObjectDuplicate :

sio2PhysicAddObject( sio2->_SIO2physic,
dup );


does really need to add physic attribute ?
avatar
sw

Posts : 73
Join date : 2008-10-12

View user profile

Back to top Go down

Re: sio2ObjectDuplicate only works for Physic object ?

Post  exavi on 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

View user profile

Back to top Go down

Re: sio2ObjectDuplicate only works for Physic object ?

Post  sio2interactive on 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,
avatar
sio2interactive

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

View user profile http://sio2interactive.com

Back to top Go down

Re: sio2ObjectDuplicate only works for Physic object ?

Post  Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

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