Pendulum bob rotation (physics problem)
#1

I got to rotate, but do not think it's an efficient way (see code below) here I show you a video of what I want to accomplish. You can see how at times the object have bad rotations, will understand when you see the code.

http://www.llewellyn.com/blog/wp-con...7/Pendulum.jpg

[ame="http://www.youtube.com/watch?v=BSvaQl4nkec"]http://www.youtube.com/watch?v=BSvaQl4nkec[/ame]

Rotation update code:
http://pastebin.com/0bbGMf3i

All code:
http://pastebin.com/3DbS763v
Reply
#2

bump
Reply
#3

That is because the position of the objects for the client is not the same for the server. When you SetObjectPos() this is snapping the object for the client to the expected position but you absolutely need to use SetObjectPos() for sync purposes.
Reply
#4

Quote:
Originally Posted by Pottus
Посмотреть сообщение
That is because the position of the objects for the client is not the same for the server. When you SetObjectPos() this is snapping the object for the client to the expected position but you absolutely need to use SetObjectPos() for sync purposes.
That's not the problem, the problem is in the object rotation, see:
Код:
SetObjectRot(MOVEBASE, -angle, 0.0, 0.0); //Pendulum angle
EDIT_OBJECT_RotateZ(MOVEBASE, RZ); //This is for rotateZ bob, function from UniversalObjectEditor by Stylock
I want rotate object like this

but not by the method previously shown, because first set angle rotationX of the pendulum and after rotate rotation Z with a function by stylock, it will look bad.
Reply
#5

bump
Reply
#6

Try using
Код:
SetTimer("Update", 30, 1);
Reply
#7

Quote:
Originally Posted by codectile
Посмотреть сообщение
Try using
Код:
SetTimer("Update", 30, 1);
That's not the problem
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)