From ad463c0dea1fcf2d80816d999837d80f08712c6d Mon Sep 17 00:00:00 2001
From: Tazpn <tazpn@users.sourceforge.net>
Date: Sun, 6 Aug 2006 16:58:50 +0000
Subject: [PATCH] 1. Update Niflib based on recent xml changes and cleanup some
 of the entries added for the 3ds max Exporter. 2. Merged in changes required
 by 3ds Max Exporter as I try to remove the cloned copy of niflib completely
 from svn.

---
 gen/obj_defines.h         |  10 +--
 gen/obj_impl.cpp          |  24 +++----
 obj/NiAVObject.cpp        |  37 ++++++++--
 obj/NiAVObject.h          |  40 +++++++++--
 obj/NiCollisionObject.cpp |  24 ++++---
 obj/NiCollisionObject.h   |  14 +++-
 obj/NiTriStripsData.cpp   |   2 +
 obj/bhkBoxShape.cpp       |   8 +++
 obj/bhkBoxShape.h         |   6 ++
 obj/bhkCapsuleShape.cpp   |  40 +++++++++++
 obj/bhkCapsuleShape.h     |  30 +++++++++
 obj/bhkEntity.cpp         |  19 ++++--
 obj/bhkEntity.h           |  71 +++++++++++++++++++-
 obj/bhkNiTriStripsShape.h |   6 ++
 obj/bhkRigidBody.cpp      | 138 +++++++++++++++++++++++++++++++++++---
 obj/bhkRigidBody.h        | 122 ++++++++++++++++++++++++++++++++-
 obj/bhkSphereRepShape.cpp |  10 ++-
 obj/bhkSphereRepShape.h   |   6 +-
 obj/bhkSphereShape.cpp    |   8 +++
 obj/bhkSphereShape.h      |   6 ++
 20 files changed, 557 insertions(+), 64 deletions(-)

diff --git a/gen/obj_defines.h b/gen/obj_defines.h
index da28ac78..9bd8008d 100644
--- a/gen/obj_defines.h
+++ b/gen/obj_defines.h
@@ -1364,7 +1364,7 @@ return InternalGetRefs(); \
 #define BHK_RIGID_BODY_MEMBERS \
 array<float,5> unknownFloats1; \
 array<ushort,4> unknownShorts1; \
-uint layerCopy_; \
+uint layerCopy; \
 array<ushort,6> unknownShorts2; \
 Vector3 translation; \
 float unknownFloat00; \
@@ -1373,7 +1373,7 @@ Vector3 linearVelocity; \
 float unknownFloat01; \
 Vector3 angularVelocity; \
 float unknownFloat02; \
-array<float,12> transform_; \
+array<float,12> transform; \
 Vector3 center; \
 float unknownFloat03; \
 float mass; \
@@ -1383,8 +1383,8 @@ float friction; \
 float restitution; \
 float maxLinearVelocity; \
 float maxAngularVelocity; \
-float penDepth; \
-byte motionSystem_; \
+float penetrationDepth; \
+byte motionSystem; \
 byte unknownByte1; \
 byte unknownByte2; \
 byte qualityType; \
@@ -1399,7 +1399,7 @@ vector<Ref<AbhkConstraint > > constraints; \
 #define BHK_RIGID_BODY_PARENT bhkEntity \
 
 #define BHK_RIGID_BODY_CONSTRUCT \
- : layerCopy_((uint)0), unknownFloat00(0.0f), unknownFloat01(0.0f), unknownFloat02(0.0f), unknownFloat03(0.0f), mass(0.0f), linearDamping(0.0f), angularDamping(0.0f), friction(0.0f), restitution(0.0f), maxLinearVelocity(0.0f), maxAngularVelocity(31.415926535f), penDepth(0.0f), motionSystem_((byte)0), unknownByte1((byte)0), unknownByte2((byte)0), qualityType((byte)0), unknownInt6((uint)0), unknownInt7((uint)0), unknownInt8((uint)0), numConstraints((uint)0) \
+ : layerCopy((uint)0), unknownFloat00(0.0f), unknownFloat01(0.0f), unknownFloat02(0.0f), unknownFloat03(0.0f), mass(0.0f), linearDamping(0.0f), angularDamping(0.0f), friction(0.0f), restitution(0.0f), maxLinearVelocity(0.0f), maxAngularVelocity(31.415926535f), penetrationDepth(0.0f), motionSystem((byte)0), unknownByte1((byte)0), unknownByte2((byte)0), qualityType((byte)0), unknownInt6((uint)0), unknownInt7((uint)0), unknownInt8((uint)0), numConstraints((uint)0) \
 
 #define BHK_RIGID_BODY_READ \
 InternalRead( in, link_stack, version, user_version ); \
diff --git a/gen/obj_impl.cpp b/gen/obj_impl.cpp
index b8562500..a6d907e3 100644
--- a/gen/obj_impl.cpp
+++ b/gen/obj_impl.cpp
@@ -3133,7 +3133,7 @@ void bhkRigidBody::InternalRead( istream& in, list<uint> & link_stack, unsigned
 	for (uint i1 = 0; i1 < 4; i1++) {
 		NifStream( unknownShorts1[i1], in, version );
 	};
-	NifStream( layerCopy_, in, version );
+	NifStream( layerCopy, in, version );
 	for (uint i1 = 0; i1 < 6; i1++) {
 		NifStream( unknownShorts2[i1], in, version );
 	};
@@ -3148,7 +3148,7 @@ void bhkRigidBody::InternalRead( istream& in, list<uint> & link_stack, unsigned
 	NifStream( angularVelocity, in, version );
 	NifStream( unknownFloat02, in, version );
 	for (uint i1 = 0; i1 < 12; i1++) {
-		NifStream( transform_[i1], in, version );
+		NifStream( transform[i1], in, version );
 	};
 	NifStream( center, in, version );
 	NifStream( unknownFloat03, in, version );
@@ -3159,8 +3159,8 @@ void bhkRigidBody::InternalRead( istream& in, list<uint> & link_stack, unsigned
 	NifStream( restitution, in, version );
 	NifStream( maxLinearVelocity, in, version );
 	NifStream( maxAngularVelocity, in, version );
-	NifStream( penDepth, in, version );
-	NifStream( motionSystem_, in, version );
+	NifStream( penetrationDepth, in, version );
+	NifStream( motionSystem, in, version );
 	NifStream( unknownByte1, in, version );
 	NifStream( unknownByte2, in, version );
 	NifStream( qualityType, in, version );
@@ -3185,7 +3185,7 @@ void bhkRigidBody::InternalWrite( ostream& out, map<NiObjectRef,uint> link_map,
 	for (uint i1 = 0; i1 < 4; i1++) {
 		NifStream( unknownShorts1[i1], out, version );
 	};
-	NifStream( layerCopy_, out, version );
+	NifStream( layerCopy, out, version );
 	for (uint i1 = 0; i1 < 6; i1++) {
 		NifStream( unknownShorts2[i1], out, version );
 	};
@@ -3200,7 +3200,7 @@ void bhkRigidBody::InternalWrite( ostream& out, map<NiObjectRef,uint> link_map,
 	NifStream( angularVelocity, out, version );
 	NifStream( unknownFloat02, out, version );
 	for (uint i1 = 0; i1 < 12; i1++) {
-		NifStream( transform_[i1], out, version );
+		NifStream( transform[i1], out, version );
 	};
 	NifStream( center, out, version );
 	NifStream( unknownFloat03, out, version );
@@ -3211,8 +3211,8 @@ void bhkRigidBody::InternalWrite( ostream& out, map<NiObjectRef,uint> link_map,
 	NifStream( restitution, out, version );
 	NifStream( maxLinearVelocity, out, version );
 	NifStream( maxAngularVelocity, out, version );
-	NifStream( penDepth, out, version );
-	NifStream( motionSystem_, out, version );
+	NifStream( penetrationDepth, out, version );
+	NifStream( motionSystem, out, version );
 	NifStream( unknownByte1, out, version );
 	NifStream( unknownByte2, out, version );
 	NifStream( qualityType, out, version );
@@ -3247,7 +3247,7 @@ std::string bhkRigidBody::InternalAsString( bool verbose ) const {
 		};
 		out << "    Unknown Shorts 1[" << i1 << "]:  " << unknownShorts1[i1] << endl;
 	};
-	out << "  Layer Copy?:  " << layerCopy_ << endl;
+	out << "  Layer Copy:  " << layerCopy << endl;
 	for (uint i1 = 0; i1 < 6; i1++) {
 		if ( !verbose && ( i1 > MAXARRAYDUMP ) ) {
 			out << "<Data Truncated. Use verbose mode to see complete listing.>" << endl;
@@ -3270,7 +3270,7 @@ std::string bhkRigidBody::InternalAsString( bool verbose ) const {
 			out << "<Data Truncated. Use verbose mode to see complete listing.>" << endl;
 			break;
 		};
-		out << "    Transform?[" << i1 << "]:  " << transform_[i1] << endl;
+		out << "    Transform[" << i1 << "]:  " << transform[i1] << endl;
 	};
 	out << "  Center:  " << center << endl;
 	out << "  Unknown Float 03:  " << unknownFloat03 << endl;
@@ -3281,8 +3281,8 @@ std::string bhkRigidBody::InternalAsString( bool verbose ) const {
 	out << "  Restitution:  " << restitution << endl;
 	out << "  Max Linear Velocity:  " << maxLinearVelocity << endl;
 	out << "  Max Angular Velocity:  " << maxAngularVelocity << endl;
-	out << "  Pen Depth:  " << penDepth << endl;
-	out << "  Motion System?:  " << motionSystem_ << endl;
+	out << "  Penetration Depth:  " << penetrationDepth << endl;
+	out << "  Motion System:  " << motionSystem << endl;
 	out << "  Unknown Byte 1:  " << unknownByte1 << endl;
 	out << "  Unknown Byte 2:  " << unknownByte2 << endl;
 	out << "  Quality Type:  " << qualityType << endl;
diff --git a/obj/NiAVObject.cpp b/obj/NiAVObject.cpp
index af1ffccb..e1464068 100644
--- a/obj/NiAVObject.cpp
+++ b/obj/NiAVObject.cpp
@@ -153,11 +153,6 @@ void NiAVObject::SetVelocity( const Vector3 & n ) {
 	velocity = n;
 }
 
-void NiAVObject::SetCollisionObject(Ref<NiCollisionObject> &obj)
-{
-	collisionObject = obj;
-}
-
 NiAVObject::CollisionType NiAVObject::GetCollision()
 {
    return (NiAVObject::CollisionType)NIFLIB_GET_FLAG(flags, 1, 0x03);
@@ -193,3 +188,35 @@ void NiAVObject::SetVisibility( bool n ) {
 		flags ^= 1;
 	}
 }
+
+bool NiAVObject::GetHasBoundingBox() const {
+	return hasBoundingBox;
+}
+
+void NiAVObject::SetHasBoundingBox( bool value ) {
+	hasBoundingBox = value;
+}
+
+BoundingBox NiAVObject::GetBoundingBox() const {
+	return boundingBox;
+}
+
+void NiAVObject::SetBoundingBox( const BoundingBox & value ) {
+	boundingBox = value;
+}
+
+Ref<NiCollisionData > NiAVObject::GetCollisionData() const {
+	return collisionData;
+}
+
+void NiAVObject::SetCollisionData( Ref<NiCollisionData > value ) {
+	collisionData = value;
+}
+
+Ref<NiCollisionObject > NiAVObject::GetCollisionObject() const {
+	return collisionObject;
+}
+
+void NiAVObject::SetCollisionObject( Ref<NiCollisionObject > value ) {
+	collisionObject = value;
+}
diff --git a/obj/NiAVObject.h b/obj/NiAVObject.h
index c888a860..ec2b3a29 100644
--- a/obj/NiAVObject.h
+++ b/obj/NiAVObject.h
@@ -92,16 +92,46 @@ public:
 	bool GetVisibility() const;
 	void SetVisibility( bool n );
 
-	void SetCollisionObject(Ref<NiCollisionObject> &);
+	/*!
+	 * Gets whether there is a bounding box associated with this object.
+    * \return True if there is a bounding box.
+    * \sa NiAVObject::SetHasBoundingBox
+	 */
+	bool GetHasBoundingBox() const;
+
+   /*!
+   * Assigns whether there is a bounding box associated with this object.
+   * \sa NiAVObject::GetHasBoundingBox
+   */
+	void SetHasBoundingBox( bool value );
+
+	/*!
+	 * The bounding box.
+	 */
+	BoundingBox GetBoundingBox() const;
+	void SetBoundingBox( const BoundingBox & value );
+
+	/*!
+	 * Bounding box: refers to NiCollisionData
+	 */
+	Ref<NiCollisionData > GetCollisionData() const;
+	void SetCollisionData( Ref<NiCollisionData> value );
+
+	/*!
+	 * In Oblivion this links the havok objects.
+	 */
+	Ref<NiCollisionObject > GetCollisionObject() const;
+	void SetCollisionObject( Ref<NiCollisionObject> value );
+
+   bool GetHidden();
+   void SetHidden(bool value);
 
    typedef enum CollisionType
    {
-      ctNone, ctTriangles, ctBoundingBox, ctContinue
+      CT_NONE, CT_TRIANGLES, CT_BOUNDINGBOX, CT_CONTINUE
    } CollisionType;
-   CollisionType GetCollision();
-   bool GetHidden();
 
-   void SetHidden(bool value);
+   CollisionType GetCollision();
    void SetCollsion(CollisionType value);
 
 protected:
diff --git a/obj/NiCollisionObject.cpp b/obj/NiCollisionObject.cpp
index a925bc79..2a540adb 100644
--- a/obj/NiCollisionObject.cpp
+++ b/obj/NiCollisionObject.cpp
@@ -33,18 +33,22 @@ list<NiObjectRef> NiCollisionObject::GetRefs() const {
 	NI_COLLISION_OBJECT_GETREFS
 }
 
-void NiCollisionObject::SetParent(NiAVObject *obj)
-{
-	parent = obj;
+const Type & NiCollisionObject::GetType() const {
+	return TYPE;
+};
+
+Ref<NiAVObject> NiCollisionObject::GetParent() const {
+	return Ref<NiAVObject>(parent);
 }
 
-void NiCollisionObject::SetBody(const Ref<NiObject> &obj)
-{
-	body = obj;
+void NiCollisionObject::SetParent( NiAVObject * value ) {
+	parent = value;
 }
 
-const Type & NiCollisionObject::GetType() const {
-	return TYPE;
-};
+Ref<NiObject > NiCollisionObject::GetBody() const {
+	return body;
+}
 
-NiAVObject * NiCollisionObject::Parent() const { return NULL; }
+void NiCollisionObject::SetBody( Ref<NiObject > value ) {
+	body = value;
+}
diff --git a/obj/NiCollisionObject.h b/obj/NiCollisionObject.h
index 5fcbeab6..66f5f2ca 100644
--- a/obj/NiCollisionObject.h
+++ b/obj/NiCollisionObject.h
@@ -39,11 +39,19 @@ public:
 	virtual list<NiObjectRef> GetRefs() const;
 	virtual const Type & GetType() const;
 
-	void 	SetParent(NiAVObject *);
-	void 	SetBody(const Ref<NiObject> &);
+	/*!
+	 * Links to the node parent.
+	 */
+   Ref<NiAVObject> GetParent() const;
+	void SetParent( NiAVObject * value );
+
+	/*!
+	 * Links to the collision object data
+	 */
+	Ref<NiObject > GetBody() const;
+	void SetBody( Ref<NiObject > value );
 
 protected:
-	NiAVObject * NiCollisionObject::Parent() const;
 	NI_COLLISION_OBJECT_MEMBERS
 	STANDARD_INTERNAL_METHODS
 };
diff --git a/obj/NiTriStripsData.cpp b/obj/NiTriStripsData.cpp
index 502508e7..83090282 100644
--- a/obj/NiTriStripsData.cpp
+++ b/obj/NiTriStripsData.cpp
@@ -41,6 +41,8 @@ ushort NiTriStripsData::GetStripCount() const {
 
 void NiTriStripsData::SetStripCount(int n) {
 	points.resize( n );
+   stripLengths.resize( n );
+   hasPoints = (n != 0);
 
 	//Recalculate Triangle Count
 	numTriangles = CalcTriangleCount();
diff --git a/obj/bhkBoxShape.cpp b/obj/bhkBoxShape.cpp
index 9d6670e5..3272418b 100644
--- a/obj/bhkBoxShape.cpp
+++ b/obj/bhkBoxShape.cpp
@@ -35,3 +35,11 @@ const Type & bhkBoxShape::GetType() const {
 	return TYPE;
 };
 
+Vector3 bhkBoxShape::GetDimensions() const {
+	return dimensions;
+}
+
+void bhkBoxShape::SetDimensions(const Vector3 &value) {
+	dimensions = value;
+}
+
diff --git a/obj/bhkBoxShape.h b/obj/bhkBoxShape.h
index 8bdea853..4e1bb6e6 100644
--- a/obj/bhkBoxShape.h
+++ b/obj/bhkBoxShape.h
@@ -33,6 +33,12 @@ public:
 	virtual list<NiObjectRef> GetRefs() const;
 	virtual const Type & GetType() const;
 
+	/*!
+	 * Looks like this could be the box size.
+	 */
+	Vector3 GetDimensions() const;
+	void SetDimensions( const Vector3& value );
+
 protected:
 	BHK_BOX_SHAPE_MEMBERS
 	STANDARD_INTERNAL_METHODS
diff --git a/obj/bhkCapsuleShape.cpp b/obj/bhkCapsuleShape.cpp
index dc640016..48659864 100644
--- a/obj/bhkCapsuleShape.cpp
+++ b/obj/bhkCapsuleShape.cpp
@@ -35,3 +35,43 @@ const Type & bhkCapsuleShape::GetType() const {
 	return TYPE;
 };
 
+float bhkCapsuleShape::GetRadius() const {
+	return radius;
+}
+
+void bhkCapsuleShape::SetRadius( float value ) {
+	radius = value;
+}
+
+Vector3 bhkCapsuleShape::GetFirstPoint() const {
+	return firstPoint;
+}
+
+void bhkCapsuleShape::SetFirstPoint( const Vector3 & value ) {
+	firstPoint = value;
+}
+
+float bhkCapsuleShape::GetRadius1() const {
+	return radius1;
+}
+
+void bhkCapsuleShape::SetRadius1( float value ) {
+	radius1 = value;
+}
+
+Vector3 bhkCapsuleShape::GetSecondPoint() const {
+	return secondPoint;
+}
+
+void bhkCapsuleShape::SetSecondPoint( const Vector3 & value ) {
+	secondPoint = value;
+}
+
+float bhkCapsuleShape::GetRadius2() const {
+	return radius2;
+}
+
+void bhkCapsuleShape::SetRadius2( float value ) {
+	radius2 = value;
+}
+
diff --git a/obj/bhkCapsuleShape.h b/obj/bhkCapsuleShape.h
index c8850e14..49be185e 100644
--- a/obj/bhkCapsuleShape.h
+++ b/obj/bhkCapsuleShape.h
@@ -33,6 +33,36 @@ public:
 	virtual list<NiObjectRef> GetRefs() const;
 	virtual const Type & GetType() const;
 
+	/*!
+	 * Apparently the capsule's radius.
+	 */
+	float GetRadius() const;
+	void SetRadius( float value );
+
+	/*!
+	 * First point on the capsule's axis.
+	 */
+	Vector3 GetFirstPoint() const;
+	void SetFirstPoint( const Vector3 & value );
+
+	/*!
+	 * Matches first capsule radius.
+	 */
+	float GetRadius1() const;
+	void SetRadius1( float value );
+
+	/*!
+	 * Second point on the capsule's axis.
+	 */
+	Vector3 GetSecondPoint() const;
+	void SetSecondPoint( const Vector3 & value );
+
+	/*!
+	 * Matches second capsule radius.
+	 */
+	float GetRadius2() const;
+	void SetRadius2( float value );
+
 protected:
 	BHK_CAPSULE_SHAPE_MEMBERS
 	STANDARD_INTERNAL_METHODS
diff --git a/obj/bhkEntity.cpp b/obj/bhkEntity.cpp
index 3f6740f7..ff26738e 100644
--- a/obj/bhkEntity.cpp
+++ b/obj/bhkEntity.cpp
@@ -36,12 +36,19 @@ const Type & bhkEntity::GetType() const {
 	return TYPE;
 };
 
-void bhkEntity::SetShape(const Ref<bhkShape> &s)
-{
-	shape = s;
+Ref<bhkShape > bhkEntity::GetShape() const {
+	return shape;
 }
 
-void bhkEntity::SetLayer(int l)
-{
-	layer = l;
+void bhkEntity::SetShape( Ref<bhkShape > value ) {
+	shape = value;
 }
+
+uint bhkEntity::GetLayer() const {
+	return layer;
+}
+
+void bhkEntity::SetLayer( uint value ) {
+	layer = value;
+}
+
diff --git a/obj/bhkEntity.h b/obj/bhkEntity.h
index b672b7f5..fbbcedbe 100644
--- a/obj/bhkEntity.h
+++ b/obj/bhkEntity.h
@@ -38,8 +38,75 @@ public:
 	virtual list<NiObjectRef> GetRefs() const;
 	virtual const Type & GetType() const;
 
-	void SetShape(const Ref<bhkShape> &);
-	void SetLayer(int layer);
+	/*!
+	 * The body's shape.
+	 */
+	Ref<bhkShape > GetShape() const;
+	void SetShape( Ref<bhkShape > value );
+
+	/*!
+	 * Sets mesh colour in CS.
+    * 0: Unidentified (white)
+	 * 1: Static (red)
+    * 2: AnimStatic (magenta)
+    * 3: Transparent (light pink)
+    * 4: Clutter (light blue)
+	 * 5: Weapon (orange)
+    * 6: Projectile (light orange)
+	 * 7: Spell (cyan)
+    * 8: Biped (green) Seems to apply to all creatures/NPCs
+    * 9: Trees (light brown)
+    * 10: Props (magenta)
+    * 11: Water (cyan)
+    * 12: Trigger (light grey)
+    * 13: Terrain (light yellow)
+    * 14: Trap (light grey)
+    * 15: NonCollidable (white)
+	 * 16: CloudTrap (greenish grey)
+    * 17: Ground (none)
+	 * 18: Portal (green)
+    * 19: Stairs (white)
+    * 20: CharController (yellow)
+    * 21: AvoidBox (dark yellow)
+	 * 22: ? (white)
+    * 23: ? (white)
+    * 24: CameraPick (white)
+    * 25: ItemPick (white)
+    * 26: LineOfSight (white)
+    * 27: PathPick (white)
+    * 28: CustomPick1 (white)
+    * 29: CustomPick2 (white)
+    * 30: SpellExplosion (white)
+    * 31: DroppingPick (white)
+	 * 32: Other (white)
+    * 33: Head
+    * 34: Body
+	 * 35: Spine1
+    * 36: Spine2
+    * 37: LUpperArm
+	 * 38: LForeArm
+    * 39: LHand
+    * 40: LThigh
+	 * 41: LCalf
+    * 42: LFoot
+    * 43: RUpperArm
+	 * 44: RForeArm
+    * 45: RHand
+    * 46: RThigh
+    * 47: RCalf
+    * 48: RFoot
+    * 49: Tail
+    * 50: SideWeapon
+    * 51: Shield
+    * 52: Quiver
+	 * 53: BackWeapon
+    * 54: BackWeapon (?)
+    * 55: PonyTail
+	 * 56: Wing
+    * 57+: Null
+	 */
+	uint GetLayer() const;
+	void SetLayer( uint value );
 
 protected:
 	BHK_ENTITY_MEMBERS
diff --git a/obj/bhkNiTriStripsShape.h b/obj/bhkNiTriStripsShape.h
index 00a8dbb7..cf3cc4fc 100644
--- a/obj/bhkNiTriStripsShape.h
+++ b/obj/bhkNiTriStripsShape.h
@@ -38,6 +38,12 @@ public:
 	virtual list<NiObjectRef> GetRefs() const;
 	virtual const Type & GetType() const;
 
+	/*!
+	 * Scale. Usually (1.0, 1.0, 1.0).
+	 */
+	Vector3 GetScale() const;
+	void SetScale( const Vector3 & value );
+
 	void	SetNumStripsData(int i);
 	void	SetStripsData(int i, Ref<NiTriStripsData> &);
 
diff --git a/obj/bhkRigidBody.cpp b/obj/bhkRigidBody.cpp
index 5f879081..c3278a2c 100644
--- a/obj/bhkRigidBody.cpp
+++ b/obj/bhkRigidBody.cpp
@@ -37,18 +37,138 @@ const Type & bhkRigidBody::GetType() const {
 	return TYPE;
 };
 
-void bhkRigidBody::SetTranslation(const Vector3 &v)
-{
-	translation = v;
+uint bhkRigidBody::GetLayerCopy() const {
+	return layerCopy;
 }
 
-void bhkRigidBody::SetRotation(const QuaternionXYZW &q)
-{
-	rotation = q;
+void bhkRigidBody::SetLayerCopy( uint value ) {
+	layerCopy = value;
 }
 
-void bhkRigidBody::SetLayerCopy(int l)
-{
-	layerCopy_ = l;
+Vector3 bhkRigidBody::GetTranslation() const {
+	return translation;
 }
 
+void bhkRigidBody::SetTranslation( const Vector3 & value ) {
+	translation = value;
+}
+
+QuaternionXYZW bhkRigidBody::GetRotation() const {
+	return rotation;
+}
+
+void bhkRigidBody::SetRotation( const QuaternionXYZW & value ) {
+	rotation = value;
+}
+
+Vector3 bhkRigidBody::GetLinearVelocity() const {
+	return linearVelocity;
+}
+
+void bhkRigidBody::SetLinearVelocity( const Vector3 & value ) {
+	linearVelocity = value;
+}
+
+Vector3 bhkRigidBody::GetAngularVelocity() const {
+	return angularVelocity;
+}
+
+void bhkRigidBody::SetAngularVelocity( const Vector3 & value ) {
+	angularVelocity = value;
+}
+
+array<float,12>  bhkRigidBody::GetTransform() const {
+	return transform;
+}
+
+void bhkRigidBody::SetTransform( const array<float,12>&  value ) {
+	transform = value;
+}
+
+Vector3 bhkRigidBody::GetCenter() const {
+	return center;
+}
+
+void bhkRigidBody::SetCenter( const Vector3 & value ) {
+	center = value;
+}
+
+float bhkRigidBody::GetMass() const {
+	return mass;
+}
+
+void bhkRigidBody::SetMass( float value ) {
+	mass = value;
+}
+
+float bhkRigidBody::GetLinearDamping() const {
+	return linearDamping;
+}
+
+void bhkRigidBody::SetLinearDamping( float value ) {
+	linearDamping = value;
+}
+
+float bhkRigidBody::GetAngularDamping() const {
+	return angularDamping;
+}
+
+void bhkRigidBody::SetAngularDamping( float value ) {
+	angularDamping = value;
+}
+
+float bhkRigidBody::GetFriction() const {
+	return friction;
+}
+
+void bhkRigidBody::SetFriction( float value ) {
+	friction = value;
+}
+
+float bhkRigidBody::GetRestitution() const {
+	return restitution;
+}
+
+void bhkRigidBody::SetRestitution( float value ) {
+	restitution = value;
+}
+
+float bhkRigidBody::GetMaxLinearVelocity() const {
+	return maxLinearVelocity;
+}
+
+void bhkRigidBody::SetMaxLinearVelocity( float value ) {
+	maxLinearVelocity = value;
+}
+
+float bhkRigidBody::GetMaxAngularVelocity() const {
+	return maxAngularVelocity;
+}
+
+void bhkRigidBody::SetMaxAngularVelocity( float value ) {
+	maxAngularVelocity = value;
+}
+
+float bhkRigidBody::GetPenetrationDepth() const {
+	return penetrationDepth;
+}
+
+void bhkRigidBody::SetPenetrationDepth( float value ) {
+	penetrationDepth = value;
+}
+
+byte bhkRigidBody::GetMotionSystem() const {
+	return motionSystem;
+}
+
+void bhkRigidBody::SetMotionSystem( byte value ) {
+	motionSystem = value;
+}
+
+byte bhkRigidBody::GetQualityType() const {
+	return qualityType;
+}
+
+void bhkRigidBody::SetQualityType( byte value ) {
+	qualityType = value;
+}
diff --git a/obj/bhkRigidBody.h b/obj/bhkRigidBody.h
index 96977efd..56b9892d 100644
--- a/obj/bhkRigidBody.h
+++ b/obj/bhkRigidBody.h
@@ -39,9 +39,125 @@ public:
 	virtual list<NiObjectRef> GetRefs() const;
 	virtual const Type & GetType() const;
 
-	void SetTranslation(const Vector3 &v);
-	void SetRotation(const QuaternionXYZW &q);
-	void SetLayerCopy(int l);
+	/*!
+	 * Copy of layer value?
+	 */
+	uint GetLayerCopy() const;
+	void SetLayerCopy( uint value );
+
+	/*!
+	 * Translation.
+	 */
+	Vector3 GetTranslation() const;
+	void SetTranslation( const Vector3 & value );
+
+	/*!
+	 * Rotation.
+	 */
+	QuaternionXYZW GetRotation() const;
+	void SetRotation( const QuaternionXYZW & value );
+
+	/*!
+	 * Linear velocity.
+	 */
+	Vector3 GetLinearVelocity() const;
+	void SetLinearVelocity( const Vector3 & value );
+
+	/*!
+	 * Angular velocity.
+	 */
+	Vector3 GetAngularVelocity() const;
+	void SetAngularVelocity( const Vector3 & value );
+
+	/*!
+	 * Seems to be some kind of transformation matrix, scale or translation?
+	 */
+	array<float,12>  GetTransform() const;
+	void SetTransform( const array<float,12>&  value );
+
+	/*!
+	 * The object's center.
+	 */
+	Vector3 GetCenter() const;
+	void SetCenter( const Vector3 & value );
+
+	/*!
+	 * Object mass.
+	 */
+	float GetMass() const;
+	void SetMass( float value );
+
+	/*!
+	 * Linear damping level.
+	 */
+	float GetLinearDamping() const;
+	void SetLinearDamping( float value );
+
+	/*!
+	 * Angular Dampling level.
+	 */
+	float GetAngularDamping() const;
+	void SetAngularDamping( float value );
+
+	/*!
+	 * The object's friction.
+	 */
+	float GetFriction() const;
+	void SetFriction( float value );
+
+	/*!
+	 * The object's restitution (elasticity).
+	 */
+	float GetRestitution() const;
+	void SetRestitution( float value );
+
+	/*!
+	 * Maximal linear velocity.
+	 */
+	float GetMaxLinearVelocity() const;
+	void SetMaxLinearVelocity( float value );
+
+	/*!
+	 * Maximal angular velocity. Pi x 10?
+	 */
+	float GetMaxAngularVelocity() const;
+	void SetMaxAngularVelocity( float value );
+
+	/*!
+	 * Penetration depth.
+	 */
+	float GetPenetrationDepth() const;
+	void SetPenetrationDepth( float value );
+
+	/*!
+	 * Motion system? Overrides Quality when on Keyframed?
+    * 0: Keyframed
+    * 1: Box
+    * 2: Sphere
+    * 3: Sphere
+    * 4: Box
+    * 5: Box
+    * 6: Keyframed
+	 * 7: Keyframed
+    * 8: Box
+    * 9+: Keyframed?
+	 */
+	byte GetMotionSystem() const;
+	void SetMotionSystem( byte value );
+
+	/*!
+	 * The motion type. Determines quality of motion?
+    * 0: Moving
+	 * 1: Fixed
+    * 2: Keyframed
+    * 3-4: Moving(?)
+	 * 5: Critical
+    * 6: Bullet
+    * 7: User
+    * 8+: Null
+	 */
+	byte GetQualityType() const;
+	void SetQualityType( byte value );
 
 protected:
 	BHK_RIGID_BODY_MEMBERS
diff --git a/obj/bhkSphereRepShape.cpp b/obj/bhkSphereRepShape.cpp
index d6353be7..56962e28 100644
--- a/obj/bhkSphereRepShape.cpp
+++ b/obj/bhkSphereRepShape.cpp
@@ -35,7 +35,11 @@ const Type & bhkSphereRepShape::GetType() const {
 	return TYPE;
 };
 
-void bhkSphereRepShape::SetMaterial(int m)
-{
-	material = m;
+uint bhkSphereRepShape::GetMaterial() const {
+	return material;
 }
+
+void bhkSphereRepShape::SetMaterial( uint value ) {
+	material = value;
+}
+
diff --git a/obj/bhkSphereRepShape.h b/obj/bhkSphereRepShape.h
index 5ccfdfc0..e4a1d865 100644
--- a/obj/bhkSphereRepShape.h
+++ b/obj/bhkSphereRepShape.h
@@ -34,7 +34,11 @@ public:
 	virtual list<NiObjectRef> GetRefs() const;
 	virtual const Type & GetType() const;
 
-	void SetMaterial(int m);
+	/*!
+	 * The shape's material.
+	 */
+	uint GetMaterial() const;
+	void SetMaterial( uint value );
 
 protected:
 	BHK_SPHERE_REP_SHAPE_MEMBERS
diff --git a/obj/bhkSphereShape.cpp b/obj/bhkSphereShape.cpp
index 7064d091..55364fcb 100644
--- a/obj/bhkSphereShape.cpp
+++ b/obj/bhkSphereShape.cpp
@@ -35,3 +35,11 @@ const Type & bhkSphereShape::GetType() const {
 	return TYPE;
 };
 
+float bhkSphereShape::GetRadius() const {
+	return radius;
+}
+
+void bhkSphereShape::SetRadius( float value ) {
+	radius = value;
+}
+
diff --git a/obj/bhkSphereShape.h b/obj/bhkSphereShape.h
index 728c95ba..2c687091 100644
--- a/obj/bhkSphereShape.h
+++ b/obj/bhkSphereShape.h
@@ -33,6 +33,12 @@ public:
 	virtual list<NiObjectRef> GetRefs() const;
 	virtual const Type & GetType() const;
 
+	/*!
+	 * This denotes the radius of the sphere.
+	 */
+	float GetRadius() const;
+	void SetRadius( float value );
+
 protected:
 	BHK_SPHERE_SHAPE_MEMBERS
 	STANDARD_INTERNAL_METHODS
-- 
GitLab