Jump to content

Enttiy::SetInput doesn't rotate without movment


martyj
 Share

Recommended Posts

In my game I use SetInput for camera rotation and movement The problem is that the camera doesn't rotate if the player is standing still.

 

The code:


if(cameraMovement())
{
double camMovementX = ((window->KeyDown(Key:) ? 1 : 0) - (window->KeyDown(Key::A) ? 1 : 0)) * strafeMultiplier;
double camMovementZ = ((window->KeyDown(Key::W) ? 1 : 0) - (window->KeyDown(Key::S) ? 1 : 0)) * moveMultiplier * speedMultiplyer;

this->playerModel->SetInput(cameraRotationY, camMovementZ, camMovementX);
}
else
{
  	 this->playerModel->SetInput(cameraRotationY, 0.0, 0.0); // No movement if a menu is open
}

Link to comment
Share on other sites

The player is the camera or the camera is parented to the player? What is the code for 'cameraRotationY'? What determines if 'cameraMovement()' (is this right? is it supposed to be a function? how is the function being evaluated?) is true?

 

EDIT-- I thought I had read something similar about not being able to rotate the character when no strafe or movement: http://www.leadwerks.com/werkspace/topic/15442-setinput/

 

Are you in the Beta? Or has Josh not reverted this back yet?

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Link to comment
Share on other sites

@Maclkebee

 

Camera is a child of PlayerModel. PlayerModel is a Cylinder.

 

cameraMovement() is a function in this case to check whether the player can move the camera. Returns True or False

 

cameraRotationY is the rotation to be applied to the camera in the Y direction (left/right movement).

 

Your link describes the exact same logic.

 

I am NOT on beta.

Link to comment
Share on other sites

  • 2 weeks later...
Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...