Rotating an object that's an actor
3 posters
Rotating an object that's an actor
Hi:
I dont know how to rotate an actor with the code.
I have 2 objects and both are actors:
a. A Plataform that's a cube, and it's only an actor, not a rigid body. I use it because I want it to be a support for the ball.
b. And a Ball, that is a sphere that's a dinamic actor and a Rigid Body.
So the thing is: I want to rotate the Plataform, so the Ball can interact with it.
If in Blender I rotate de Plataform in some axis (like axis x), the ball falls and move over the Plataform. So, the phisics in blender are ok. But if I do the same (i mean,rotate the Plataform) but in sio2 with this code:
this produce a visual rotate, buy physically the plataform isn't rotated. I think, this could be because the Plataform it's only an actor and it hasn't physics, but I need to be like that because I need it as a support for the ball.
How can I do it?.
I dont know how to rotate an actor with the code.
I have 2 objects and both are actors:
a. A Plataform that's a cube, and it's only an actor, not a rigid body. I use it because I want it to be a support for the ball.
b. And a Ball, that is a sphere that's a dinamic actor and a Rigid Body.
So the thing is: I want to rotate the Plataform, so the Ball can interact with it.
If in Blender I rotate de Plataform in some axis (like axis x), the ball falls and move over the Plataform. So, the phisics in blender are ok. But if I do the same (i mean,rotate the Plataform) but in sio2 with this code:
- Code:
SIO2object *object_plataform = ( SIO2object * )sio2ResourceGet( sio2->_SIO2resource,
SIO2_OBJECT,
"object/plataform" );
if( object_plataform ){
object_plataform->rot->x = 15; // 15 is only an example, it's variable
sio2ObjectBindMatrix( object_plataform );
}
this produce a visual rotate, buy physically the plataform isn't rotated. I think, this could be because the Plataform it's only an actor and it hasn't physics, but I need to be like that because I need it as a support for the ball.
How can I do it?.
lolita- Posts : 5
Join date : 2008-10-22
Re: Rotating an object that's an actor
Google "terrain clamping"
Best,
-joshua
Best,
-joshua
meteors- Posts : 241
Join date : 2008-11-08
Location : Sunny Florida
Re: Rotating an object that's an actor
By the way, if you want something like gravity, then I think you are definitely going to need to use physics.
-j
-j
meteors- Posts : 241
Join date : 2008-11-08
Location : Sunny Florida
Re: Rotating an object that's an actor
meteors wrote:By the way, if you want something like gravity, then I think you are definitely going to need to use physics.
-j
They have physic and gravity. The ball fall over the plataform for the gravity.
If i put velocity to the ball.
object_ball->_btRigidBody->setLinearVelocity( btVector3( 0.0f, 1.0f, object_ball->_btRigidBody->getLinearVelocity()[2] ) );
it move and fall then the plataform is finish.
lolita- Posts : 5
Join date : 2008-10-22
Re: Rotating an object that's an actor
There's a slight difference between the way Blender is handling physic and SIO2, in SIO2 physic object have to be marked (check the video tutorial06 for more info). If an object is not tagged at least actor (which would result in static triangle mesh) it cannot interact with the physic simulation. This is done on purpose to be able to control the number of physic object in the world. In your case what I would do is set the plane as an actor, then using the bullet API I would rotate that plane with setAngularVelocity. You have to understand that as soon an object is tagged to be part of the physic sim. it have to be controlled by the Bullet API, so using like sio2ObjectBindMatrix will have no effect since Bullet is now controlling that object matrix.
Cheers,
Cheers,
Re: Rotating an object that's an actor
sio2interactive wrote:There's a slight difference between the way Blender is handling physic and SIO2, in SIO2 physic object have to be marked (check the video tutorial06 for more info). If an object is not tagged at least actor (which would result in static triangle mesh) it cannot interact with the physic simulation. This is done on purpose to be able to control the number of physic object in the world. In your case what I would do is set the plane as an actor, then using the bullet API I would rotate that plane with setAngularVelocity. You have to understand that as soon an object is tagged to be part of the physic sim. it have to be controlled by the Bullet API, so using like sio2ObjectBindMatrix will have no effect since Bullet is now controlling that object matrix.
Cheers,
Thanks a lot . I'll check the Bullet API.
lolita- Posts : 5
Join date : 2008-10-22
Similar topics
» Rotating SIO2Widget?
» rotating objects
» Rotating the Camera Around the Y-Axis
» Use object only for collision
» physics object inside another physics object
» rotating objects
» Rotating the Camera Around the Y-Axis
» Use object only for collision
» physics object inside another physics object
Permissions in this forum:
You cannot reply to topics in this forum