Tutorial#2 - Custom model doesn't respond to touch input
2 posters
Tutorial#2 - Custom model doesn't respond to touch input
Hey guys. I've just gotten started with SIO2 and I decided to see how easy it would be to input a custom model into the game. I chose the template for tutorial2 and compiled it. Great, works just like it should. I then created a simple model and followed the instructions on adding it to tutorial2. It imported without any problems, however it would not respond to the touch input. I figure I simply forgot a small step. I checked over the code and didn't see anything that indicated specific naming of the model be required, other than tutorial02.sio2. Assistance much appreciated.
teh1ghool- Posts : 5
Join date : 2009-10-27
Re: Tutorial#2 - Custom model doesn't respond to touch input
Check in template.cc inside the touch move event callback:
- Code:
void templateScreenTouchMove( void *_ptr )
{
if( sio2->_SIO2window->n_touch )
{
float d = sio2->_SIO2window->touch[ 0 ]->x - start.x;
// Get the object name "Suzanne" located inside our resources.
// Please take note that there is similar funtion for all
// type of resources that SIO2 support ex: GetImage, GetMaterial
// etc... So you can get access directly to any type
// of handle within an SIO2resource.
SIO2object *_SIO2object = ( SIO2object * )sio2ResourceGetObject( sio2->_SIO2resource,
"object/Suzanne" );
// Check if we get a pointer.
if( _SIO2object )
{
// Apply a rotation based on the
// touch movement. (basic)
if( d > 5.0f || d < -5.0f )
{ _SIO2object->_SIO2transform->rot->z += ( d * 0.025f ); }
// Update the OpenGL matrix and apply the
// new rotation specified above.
sio2TransformBindMatrix( _SIO2object->_SIO2transform );
}
}
}
Re: Tutorial#2 - Custom model doesn't respond to touch input
Much thanks. That was rather obvious.
teh1ghool- Posts : 5
Join date : 2009-10-27
Similar topics
» Tutorial 4 with custom model, lighting not right
» Problem in tutorial 02 using my own model
» Placing emitter at touch location - viewport size smaller than screen - tutorial 12
» Custom resources
» Help With Custom Function in sio2_physic.cc
» Problem in tutorial 02 using my own model
» Placing emitter at touch location - viewport size smaller than screen - tutorial 12
» Custom resources
» Help With Custom Function in sio2_physic.cc
Permissions in this forum:
You cannot reply to topics in this forum
|
|