Game Development Community

how to rotate items?

by Sam Jackson · in General Discussion · 03/06/2011 (1:24 am) · 4 replies

How do I rotate items (not static objects), in the editor?
I have tried the standard rotate tool, but it will only allow me to rotate around the "up"-axis.
Moving the items is also difficult, as they start to drop as soon as I start to move them (but I got around it by setting the "static"-flag during the positioning).
Is there a way to "freeze" the level, so I can make these adjustments?

About the author

Recent Threads


#1
03/06/2011 (6:15 am)
I animate them.
This is the best choice for complex rotations and works faster,because you're reading ready transformation compared to the runtime cpu rotation.
You don't even need to use bones.

About the positioning problem : check the datablock settings,I think there are several ones that control physics of items - gravityMod, maxVelocity, drag.
Zero all of them,this should zero the runtime velocity.

Good luck with T3D!
#2
03/07/2011 (12:13 am)
Thank you for replying.

Setting the gravityMod to zero does prevent it from dropping (makes sense).
As for the rotation, I was talking about rotating objects in the editor, not creating a rotating object "in game" (sorry for not being clear).

In my case I have a model of a book that I want to position on a shelf.
When I import the book it is lying down, but I want it to be in an upright position. Using the rotate-tool I can only rotate around the z-axis. I tried doing the same with the models from the demo (health-kits, weapons), and I cannot rotate these around the other axes either. The exception is the vehicle which seems to work just fine.

Could this be a limitation on objects using the ItemData datablock? And if so, what datablock should I be using?
#3
03/07/2011 (1:04 am)
This is a limitation of the item class,I think unpackupdate() directly zero xy rotations (may be for network optimization purpose).
You should use StaticShape for this book and animate the rotation.The pickup can be organized using oncollision() or even a trigger.

Of course if you get the code,you can change how things work and modify the item class.
#4
03/07/2011 (5:55 am)
I second Ivan's suggestions.

I recall reading about someone who tweaked Items to allow multiple axes of rotation just like you're wanting, or even a possible resource -- I remember thinking at the time "why not use static shapes... would be easier" -- but now I can't find any mention of the thread.