From c6c67a1bb49d22d93f6c9f6bf5859ddc4c5629f2 Mon Sep 17 00:00:00 2001
From: Chris Robinson <chris.kcat@gmail.com>
Date: Sun, 7 Apr 2013 18:15:23 -0700
Subject: [PATCH] Read NiGravity fields

---
 components/nif/controlled.hpp | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/components/nif/controlled.hpp b/components/nif/controlled.hpp
index 08c47defee..6acb8ff201 100644
--- a/components/nif/controlled.hpp
+++ b/components/nif/controlled.hpp
@@ -98,12 +98,23 @@ public:
 class NiGravity : public Controlled
 {
 public:
+    float mForce;
+    /* 0 - Wind (fixed direction)
+     * 1 - Point (fixed origin)
+     */
+    int mType;
+    Ogre::Vector3 mPosition;
+    Ogre::Vector3 mDirection;
+
     void read(NIFStream *nif)
     {
         Controlled::read(nif);
 
-        // two floats, one int, six floats
-        nif->skip(9*4);
+        /*unknown*/nif->getFloat();
+        mForce = nif->getFloat();
+        mType = nif->getUInt();
+        mPosition = nif->getVector3();
+        mDirection = nif->getVector3();
     }
 };