Congratulating the 1.3.1 version
4 posters
Congratulating the 1.3.1 version
first Congratulate sio2interactive released the new vesion. it is very cool to support softbody , and mix 2D and 3D screen.
the and sio2 physic bullet engine upgraded to 2.7.3 , i like it very much and helps us so much .
after upgrading our game project to the new version i found some burr in the new version
first ,
void sio2PhysicRemoveObject ( //....
{ //......
else if( _btSoftBody == _SIO2object->_btSoftBody ) /// this will crash, because NULL==NULL
//.....
}
the second , my Dynamic Object will NOT fall down to the earth , and I can't move it by setLinearVelocity , i did not know why , i will check it.
and , the new version did not support muilt-touch, I post some code i am using
and add the following code :
hope it is useful.
the and sio2 physic bullet engine upgraded to 2.7.3 , i like it very much and helps us so much .
after upgrading our game project to the new version i found some burr in the new version
first ,
void sio2PhysicRemoveObject ( //....
{ //......
else if( _btSoftBody == _SIO2object->_btSoftBody ) /// this will crash, because NULL==NULL
//.....
}
the second , my Dynamic Object will NOT fall down to the earth , and I can't move it by setLinearVelocity , i did not know why , i will check it.
and , the new version did not support muilt-touch, I post some code i am using
- Code:
[self setMultipleTouchEnabled:YES] ;
- Code:
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
UITouch *touch;
CGPoint pos;
//sio2WindowResetTouch( sio2->_SIO2window );
for( touch in touches )
{
pos = [ touch locationInView:self ];
sio2WindowAddTouch( sio2->_SIO2window,
pos.x,
pos.y );
}
sio2->_SIO2window->n_tap = [ [ touches anyObject ] tapCount ];
sio2ResourceDispatchEvents( sio2->_SIO2resource,
sio2->_SIO2window,
SIO2_WINDOW_TAP,
SIO2_WINDOW_TAP_DOWN );
}
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event //// hanzhicai add
{
UITouch *touch;
CGPoint pos;
//sio2WindowResetTouch( sio2->_SIO2window );
for( touch in touches )
{
pos = [ touch locationInView:self ];
sio2WindowMovingTouch ( sio2->_SIO2window,
pos.x,
pos.y );
//sio2WindowAddTouch( sio2->_SIO2window,
// pos.x,
// pos.y );
}
sio2ResourceDispatchEvents( sio2->_SIO2resource,
sio2->_SIO2window,
SIO2_WINDOW_TOUCH_MOVE,
SIO2_WINDOW_TAP_DOWN );
}
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event //// hanzhicai add
{
UITouch *touch;
CGPoint pos;
//sio2WindowResetTouch( sio2->_SIO2window );
for( touch in touches )
{
pos = [ touch locationInView:self ];
sio2WindowRemoveTouch ( sio2->_SIO2window,
pos.x,
pos.y );
}
sio2ResourceDispatchEvents( sio2->_SIO2resource,
sio2->_SIO2window,
SIO2_WINDOW_TAP,
SIO2_WINDOW_TAP_UP );
// sio2WindowResetTouch( sio2->_SIO2window );
sio2->_SIO2window->n_tap = [ [ touches anyObject ] tapCount ];
}
and add the following code :
- Code:
void sio2WindowRemoveTouch( SIO2window *_SIO2window,
float _x,
float _y )
{
float point2point =500;
int repoint ;
_y= _SIO2window->size->y - _y ;
for (int i=0; i< _SIO2window->n_touch ; i++ )
{
float tmp_x = _SIO2window->touch[ i ]->x - _x ;
float tmp_y = _SIO2window->touch[ i ]->y - _y ;
float tmp_dis = sqrt((double)(tmp_x*tmp_x + tmp_y*tmp_y ));
if ( tmp_dis < point2point && tmp_dis <20.0 ) /// the max moving speed set to 20.0 units
{
repoint=i;
point2point = tmp_dis;
}
}
for (int j = repoint+1 ; j < _SIO2window->n_touch ; j++)
{
_SIO2window->touch[ j - 1 ]->x = _SIO2window->touch[ j ]->x ;
_SIO2window->touch[ j - 1 ]->y = _SIO2window->touch[ j ]->y ;
}
_SIO2window->touch[ _SIO2window->n_touch-1 ] = sio2Vec2Free( _SIO2window->touch[ _SIO2window->n_touch -1 ] );
_SIO2window->n_touch--;
}
void sio2WindowMovingTouch( SIO2window *_SIO2window, //// hanzhicai add
float _x,
float _y )
{
float point2point =500;
int repoint =100 ;
_y= _SIO2window->size->y - _y ;
for (int i=0; i< _SIO2window->n_touch ; i++ )
{
float tmp_x = _SIO2window->touch[ i ]->x - _x ;
float tmp_y = _SIO2window->touch[ i ]->y - _y ;
float tmp_dis = sqrt((double)(tmp_x*tmp_x + tmp_y*tmp_y ));
if ( tmp_dis < point2point && tmp_dis <20.0 ) /// the max moving speed set to 20.0 units
{
repoint=i;
point2point = tmp_dis;
}
}
if (_SIO2window->n_touch > repoint)
{
_SIO2window->touch[ repoint ]->x = _x;
_SIO2window->touch[ repoint ]->y = _y ;
}
}
hope it is useful.
sw- Posts : 73
Join date : 2008-10-12
Re: Congratulating the 1.3.1 version
The multitouch code looks good. I have been meaning to write that for a long time but hadn't gotten around to it. Thanks.
uprise78- Posts : 228
Join date : 2008-10-31
Re: Congratulating the 1.3.1 version
Add this in the sio2PhysicRemoveObject function:
the new version did not support muilt-touch
>> Hummm dude check tutorial05... And by the way no need to remap the touches the array sequence will always be from first to last...
- Code:
if( !_SIO2object->_btRigidBody && !_SIO2object->_btSoftBody )
{ return; }
the new version did not support muilt-touch
>> Hummm dude check tutorial05... And by the way no need to remap the touches the array sequence will always be from first to last...
Object not moving after update
I´m having a problem with the new version.
I have an object and I apply an impulse to it with this code:
That was working with 1.2.1 but after the update the object keeps in place. I´ve been looking at the new examples but I don´t see any different.
Help appreciated. Thanks.
I have an object and I apply an impulse to it with this code:
- Code:
_Object->_btRigidBody->setActivationState(DISABLE_DEACTIVATION);
_Object->_btRigidBody->applyImpulse(_impulse, _rel_pos);
sio2ObjectBindMatrix(_Object);
That was working with 1.2.1 but after the update the object keeps in place. I´ve been looking at the new examples but I don´t see any different.
Help appreciated. Thanks.
jlperan- Posts : 41
Join date : 2008-10-10
Re: Congratulating the 1.3.1 version
- Code:
!_SIO2object->_btRigidBody->isStaticObject() &&
_SIO2object->_btRigidBody->getActivationState() == ACTIVE_TAG
This is the code that is evaluated in order to update the rigid body object matrix...
Similar topics
» Python version : 2.3 or 2.5?
» Rotations with the new SDK
» Memory problem in version 1.3.1?
» Animating and Parenting an SIO2Widget
» hi, how about the scene graph used in OGRE3D, and SIO2will support the feature in the futrue version
» Rotations with the new SDK
» Memory problem in version 1.3.1?
» Animating and Parenting an SIO2Widget
» hi, how about the scene graph used in OGRE3D, and SIO2will support the feature in the futrue version
Permissions in this forum:
You cannot reply to topics in this forum