Browse Source

Trying proposed _PSTDINT_H_INCLUDED fix. Reformatting some docstrings

TheComet 8 years ago
parent
commit
d355540f41

+ 4 - 0
Source/Urho3D/Core/Context.cpp

@@ -33,6 +33,10 @@
 #endif
 
 #ifdef URHO3D_IK
+// Hopefully fixes issue on windows where ik/pstdint.h redefines int32_t
+#if defined(HAVE_STDINT_H)
+#define _PSTDINT_H_INCLUDED
+#endif
 #include <ik/memory.h>
 #include <ik/log.h>
 #endif

+ 1 - 3
Source/Urho3D/IK/IK.h

@@ -43,9 +43,7 @@ namespace Urho3D
 
 class Context;
 
-/*!
- * Registers all IK systems to the specified context.
- */
+/// Registers all IK systems to the specified context.
 void RegisterIKLibrary(Context* context);
 
 } // namespace Urho3D

+ 3 - 9
Source/Urho3D/IK/IKConstraint.h

@@ -38,19 +38,13 @@ class URHO3D_API IKConstraint : public Component
 
 public:
 
-    /*!
-     * Constructs a new IK constraint.
-     */
+    /// Constructs a new IK constraint.
     IKConstraint(Context* context);
 
-    /*!
-     * Destructs he IK constraint.
-     */
+    /// Destructs he IK constraint.
     virtual ~IKConstraint();
 
-    /*!
-     * Registers this class as an object factory.
-     */
+    /// Registers this class as an object factory.
     static void RegisterObject(Context* context);
 
     float GetStiffness() const;

+ 1 - 1
Source/Urho3D/IK/IKEffector.cpp

@@ -129,7 +129,7 @@ const Quaternion& IKEffector::GetTargetRotation() const
 void IKEffector::SetTargetRotation(const Quaternion& targetRotation)
 {
     targetRotation_ = targetRotation;
-    if(ikEffector_)
+    if (ikEffector_)
         ikEffector_->target_rotation = QuatUrho2IK(targetRotation);
 }
 

+ 14 - 12
Source/Urho3D/IK/IKEffector.h

@@ -45,9 +45,7 @@ public:
     /// Destructs he IK effector.
     virtual ~IKEffector();
 
-    /*!
-     * Registers this class as an object factory.
-     */
+    /// Registers this class as an object factory.
     static void RegisterObject(Context* context);
 
     /// Retrieves the node that is being used as a target. Can be NULL.
@@ -102,11 +100,13 @@ public:
 
     /// How strongly the effector affects the solution.
     float GetWeight() const;
+
     /*!
-     * @brief Sets how much influence the effector has on the solution. You can
-     * use this value to smoothly transition between a solved pose and an
-     * initial pose  For instance, lifting a foot off of the ground or letting
-     * go of an object.
+     * @brief Sets how much influence the effector has on the solution.
+     *
+     * You can use this value to smoothly transition between a solved pose and
+     * an initial pose  For instance, lifting a foot off of the ground or
+     * letting go of an object.
      */
     void SetWeight(float weight);
 
@@ -126,11 +126,13 @@ public:
 
     /*!
      * @brief A factor with which to control the target rotation influence of
-     * the next segments down the chain. For example, if this is set to 0.5
-     * and the rotation weight is set to 1.0, then the first segment will
-     * match the target rotation exactly, the next segment will match it only
-     * 50%, the next segment 25%, the next 12.5%, etc. This parameter makes
-     * long chains look more natural when matching a target rotation.
+     * the next segments down the chain.
+     *
+     * For example, if this is set to 0.5 and the rotation weight is set to
+     * 1.0, then the first segment will match the target rotation exactly, the
+     * next segment will match it only 50%, the next segment 25%, the next
+     * 12.5%, etc. This parameter makes long chains look more natural when
+     * matching a target rotation.
      */
     void SetRotationDecay(float decay);
 

+ 10 - 13
Source/Urho3D/IK/IKSolver.cpp

@@ -81,7 +81,7 @@ IKSolver::~IKSolver()
 {
     // Destroying the solver tree will destroy the effector objects, so remove
     // any references any of the IKEffector objects could be holding
-    for(PODVector<IKEffector*>::ConstIterator it = effectorList_.Begin(); it != effectorList_.End(); ++it)
+    for (PODVector<IKEffector*>::ConstIterator it = effectorList_.Begin(); it != effectorList_.End(); ++it)
         (*it)->SetIKEffector(NULL);
 
     ik_solver_destroy(solver_);
@@ -153,7 +153,7 @@ float IKSolver::GetTolerance() const
 // ----------------------------------------------------------------------------
 void IKSolver::SetTolerance(float tolerance)
 {
-    if(tolerance < M_EPSILON)
+    if (tolerance < M_EPSILON)
         tolerance = M_EPSILON;
     solver_->tolerance = tolerance;
 }
@@ -258,7 +258,7 @@ void IKSolver::Solve()
     if (updateInitialPose_)
         UpdateInitialPose();
 
-    for(PODVector<IKEffector*>::ConstIterator it = effectorList_.Begin(); it != effectorList_.End(); ++it)
+    for (PODVector<IKEffector*>::ConstIterator it = effectorList_.Begin(); it != effectorList_.End(); ++it)
     {
         (*it)->UpdateTargetNodePosition();
     }
@@ -357,7 +357,7 @@ void IKSolver::BuildTree()
 
     PODVector<Node*> effectorNodes;
     node_->GetChildrenWithComponent<IKEffector>(effectorNodes, true);
-    for(PODVector<Node*>::ConstIterator it = effectorNodes.Begin(); it != effectorNodes.End(); ++it)
+    for (PODVector<Node*>::ConstIterator it = effectorNodes.Begin(); it != effectorNodes.End(); ++it)
     {
         BuildTreeToEffector(*it);
     }
@@ -369,7 +369,7 @@ void IKSolver::BuildTreeToEffector(const Node* node)
     // Check if the component that was added is an IK effector. If not, then it
     // does not concern us.
     IKEffector* effector = static_cast<IKEffector*>(node->GetComponent<IKEffector>());
-    if(effector == NULL || effector->GetType() != IKEffector::GetTypeStatic())
+    if (effector == NULL || effector->GetType() != IKEffector::GetTypeStatic())
         return;
 
     // May need to build tree up to the node where this effector was added. Do
@@ -412,7 +412,7 @@ void IKSolver::HandleComponentAdded(StringHash eventType, VariantMap& eventData)
     using namespace ComponentAdded;
     (void)eventType;
 
-    if(solver_->tree == NULL)
+    if (solver_->tree == NULL)
         return;
 
     Node* node = static_cast<Node*>(eventData[P_NODE].GetPtr());
@@ -423,9 +423,8 @@ void IKSolver::HandleComponentAdded(StringHash eventType, VariantMap& eventData)
 void IKSolver::HandleComponentRemoved(StringHash eventType, VariantMap& eventData)
 {
     using namespace ComponentRemoved;
-    (void)eventType;
 
-    if(solver_->tree == NULL)
+    if (solver_->tree == NULL)
         return;
 
     // If an effector was removed, the tree will have to be rebuilt.
@@ -455,7 +454,6 @@ void IKSolver::HandleComponentRemoved(StringHash eventType, VariantMap& eventDat
 void IKSolver::HandleNodeAdded(StringHash eventType, VariantMap& eventData)
 {
     using namespace NodeAdded;
-    (void)eventType;
 
     if (solver_->tree == NULL)
         return;
@@ -475,9 +473,8 @@ void IKSolver::HandleNodeAdded(StringHash eventType, VariantMap& eventData)
 void IKSolver::HandleNodeRemoved(StringHash eventType, VariantMap& eventData)
 {
     using namespace NodeRemoved;
-    (void)eventType;
 
-    if(solver_->tree == NULL)
+    if (solver_->tree == NULL)
         return;
 
     Node* node = static_cast<Node*>(eventData[P_NODE].GetPtr());
@@ -485,7 +482,7 @@ void IKSolver::HandleNodeRemoved(StringHash eventType, VariantMap& eventData)
     // Remove cached IKEffectors from our list
     PODVector<Node*> nodes;
     node->GetChildrenWithComponent<IKEffector>(nodes, true);
-    for(PODVector<Node*>::ConstIterator it = nodes.Begin(); it != nodes.End(); ++it)
+    for (PODVector<Node*>::ConstIterator it = nodes.Begin(); it != nodes.End(); ++it)
     {
         effectorList_.Remove((*it)->GetComponent<IKEffector>());
     }
@@ -494,7 +491,7 @@ void IKSolver::HandleNodeRemoved(StringHash eventType, VariantMap& eventData)
     // solver's tree instead of destroying the single node. Calling
     // ik_node_destroy() on the solver's root node will cause segfaults.
     ik_node_t* ikNode = ik_node_find_child(solver_->tree, node->GetID());
-    if(ikNode != NULL)
+    if (ikNode != NULL)
     {
         if(ikNode == solver_->tree)
             ik_solver_destroy_tree(solver_);