Jump to content

SetRotation not working


Vulcan
 Share

Recommended Posts

I got a problem with SetRotation and tried all tricks I got in my pocket. The initial rotation works but thats it. I tried to rotate a model after it is created but seems to ignore it. The funny things is that SetPosition is working.

 

This how I create it:

void GameObject::Create(Vec3 position, Vec3 rotation)
{
//Create the player
obj = Pivot::Create();
obj->SetPosition(position);
obj->SetRotation(rotation);
obj->SetMass(5);
obj->SetPhysicsMode(Entity::CharacterPhysics);
//Create a visible mesh
objMesh = Model::Cylinder(16, obj);
objMesh->SetPosition(0.0f, 1.0f, 0.0f);
objMesh->SetScale(1, 2, 1);
}

 

Another place in the project I try to rotate the object (1) like this:

vGameObject.at(1).obj->SetRotation( Vec3(0.0f, 45.0f, 0.0f) );

 

But this however works:

vGameObject.at(1).obj->SetPosition( Vec3(-10.0f, 1.0f, 0.0f));

 

Is it a bug with LE or is it me that aren't doing something right? This is driving me nuts!

Please help!

Link to comment
Share on other sites

Never mind! I got it to work by temporary adjusting the physics.

 

vGameObject.at(1).obj->SetPhysicsMode(Entity::RigidBodyPhysics);
vGameObject.at(1).obj->SetRotation(Vec3(0.0f, 45.0f, 0.0f));
vGameObject.at(1).obj->SetPhysicsMode(Entity::CharacterPhysics);

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...