Game Development Community

T3DRigidComponent.GravityScale

by Trent · in Torque X 3D · 06/03/2009 (8:15 pm) · 5 replies

What's it mean? I'm reading John K's book, I set GravityScale to 1.5f and Mass to 10 and my cube drops like a rock and slides all over the ground like its coated in oil. I set GravityScale 9.8f and my cube just floats.

What does GravityScale mean / do ?

#1
06/11/2009 (10:46 pm)
As I recall, it's just a broad multiplier used in calculating forces in the scene. A force is the product of Gravity (in the RigidScene class), Mass (of the RigidBody), and the gravity scale (also of the RigidBody). I typically set Gravity to 9.8 and leave GravityScale at 1.0f, then set the mass of everything else.

John K.
www.envygames.com
#2
06/11/2009 (11:11 pm)
That's what I figured it would be based on it's name, except the problem is that I don't know how the physics system is put together, so I had no clue to look for this property anywhere but T3DRigidComponent (and assumed there was no such property after not finding it). After reading your post I still had to dig to find that the RigidCollisionManager has a RigidScene property, so now that will probably help me resolve other issues as I expand my knowledge of the various class relationships.

I don't mind some digging, but like with the GUI system, I don't have the basics on how it works, even after re-reading your gui chapter 10 times, I believe I understand how it works, but in practice I can't get a GUI happening.

So close, yet so far, but still persisting!
#3
06/11/2009 (11:28 pm)
Sorry to hear that, it sounds really frustrating. My 'Aha!' movement in figuring out the GUI system was realizing the 'folder' structure of the GUI system. That name was killing me, why not just call them 'containers' for child controls? There's a lot to the physics system and it seems a little more complicated with the 3D framework than the 2D framework - it uses a lot more oil coating ;)

John K.
www.envygames.com
#4
06/11/2009 (11:55 pm)
Yeah I had the moment of realising that the folders were containers (and I agree with you about the naming!), but that still hasn't quite helped me. Logically to me, I should be able to use a GUISceneview as a the root control, create a GUIText control, set it's folder to the sceneview, GUICanvas.Instance.SetControlControl(sceneview) and I should get text on top of a 3D view, but that doesn't seem to work, I just get my 3D view.

I realise 3D physics systems are pretty complex so I'm thankfully not looking to understand it in 5 minutes. I mostly want it just for collision detection, I want to do my own thing when I detect a collision.

#5
06/12/2009 (4:16 am)
Interestingly, I just got it going by pushing the sceneview as a dialog instead of trying to set the content control.