Jump to content

[solved] Minimum - maximum rotation


AggrorJorn
 Share

Recommended Posts

I have set the minimum and maximum values for a rotation vector. However it is being ignored by the the program. Perhaps it is something really obvious:

 

part of the code

pivotRotation = Vec3(0)
--setting pitch minimum and maximum
pivotRotation.x = math.min(pivotRotation.x, 40)
pivotRotation.x = math.max(pivotRotation.x, -60)

while loop
UpdateAppTime()

--angle control
if KeyDown(KEY_W)==1 then
	pivotRotation.x = pivotRotation.x + (0.2 / AppSpeed())	
	object:SetRotation(pivotRotation,1)	

elseif KeyDown(KEY_S)==1 then
	pivotRotation.x = pivotRotation.x - (0.2 / AppSpeed())	
	object:SetRotation(pivotRotation,1)	
end

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...