Vulcan Posted July 9, 2014 Share Posted July 9, 2014 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! Quote Link to comment Share on other sites More sharing options...
Vulcan Posted July 9, 2014 Author Share Posted July 9, 2014 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); Quote Link to comment Share on other sites More sharing options...
tjheldna Posted July 9, 2014 Share Posted July 9, 2014 Yeah Character physics is special and rotation is added as a parameter in the SetInput function. http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/entity/entitysetinput-r706 Cheers Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.