method to determine if an object is set to dynamic
Bool RigidBodyComponent.IsDynamic
built in rounding of vectors and quaternions for display purposes
Vector somevector;
somevector.Round(2);
method to determine if an object is set to dynamic
Bool RigidBodyComponent.IsDynamic
built in rounding of vectors and quaternions for display purposes
Vector somevector;
somevector.Round(2);
That's what Vector.ToString() is for. You can pass in a format argument.
Right now, the easiest way to determine if an object is dynamic is if there is a RigidBodyComponent available in the object.
string format doesn't seem as nice
-12.000600006f
.ToString("f2")
-12.00
Math.Round()
-12
Just having a physics volume doesn't mean 'is dynamic' is set
Yes, but you won't get a rigid body from a static object, despite it having a physics volume. You'll only get one if it's marked as dynamic.
There are some oddball cases where an object is dynamic but you don't see it as obviously such. Tyler recently discovered that a trigger volume, for example, can be moved using RigidBodyComponent.SetPosition() and .SetOrientation(). Curiously, though, it doesn't fall under gravity the way other dynamic objects do (by default).
But the short answer is: yes, if you can get get a rigid body for the object, you can presume it is dynamic. For now, at least.
try it out, tell me your results
Try what out? This technique is what most of my scripts use already.
Just use Vector.ToString("0.00") if you want to trim up the display
test if an object with a collision volume has a rigid body when it is not set to dynamic.
I get annoyed when people give me little brain teaser challenges instead of just showing what they have discovered with their own testing.
Okay, so to your point, I just discovered you are correct.I ran this test (after a little delay):
RigidBodyComponent Body = null;
ObjectPrivate.TryGetFirstComponent(out Body);
ScenePrivate.Chat.MessageAllUsers("Rigid body: " + (Body != null));
Sure enough, it reports that a static object has a rigid body. You could have just said that.
So, yeah. This is not a reliable way to determine if an object is dynamic. My mistake.