TGE

Members
  • Content count

    7
  • Joined

  • Last visited

Community Reputation

107 Neutral

About TGE

  • Rank
    Newbie
  1. Hi,   I would like to implement an Ik solver capable of driving a skeleton using mocap data but don't really know were to start from. I saw several videos dealing with Full Body IK ( https://goo.gl/ZB72zZ or https://goo.gl/QtQAKG ) but can't find any paper describing the techniques.   Could anyone give me an answer?   Thanks.
  2. Hi everyone, I made a simple program that swaps two arrays of integers and I face some problems while looking at the result : it is different whether the swap function is called inside the main function or outside. Here is a simple test : [source lang="cpp"]#include <iostream> #define N 2 void print( const std::string& label, const int* u) { std::cout << label << "\t" << u; for ( int i=0 ; i<N ; i++ ) std::cout << "\t" << u[i]; std::cout << std::endl; } void fswap(int* a, int* b) { std::swap(a,b); } int main() { int* a = new int[N]; int* b = new int[N]; for (int i=0; i<N; ++i) { a[i] = i; b[i] = i+10; } // DIRECT SWAP print( "a in", a); print( "b in", b); std::swap(a,b); print( "a out", a); print( "b out", b); // FUNCTION SWAP std::cout << std::endl; print( "a in", a); print( "b in", b); fswap(a,b); print( "a out", a); print( "b out", b); delete [] a; delete [] b; return 0; }[/source] Any idea ?! Thx.
  3. [quote name='Rattrap' timestamp='1307117075' post='4819110'] About the only way I can see you solving it would be to replace the Elem* 's in List with AbstractElem* 's in the List definition and List* 's with AbstractList* 's in Elem's definition. [/quote] I think I'm gonna try this way. Thanks !
  4. That was just an example. I'm not trying to develop a new container, the names are arbitrary, I just though it would be easier than using A, B or C as a class name ;) I've got this error in a much more complex example and tried to find a more simple one. I just want to understand why I had a compilation error in re-implemented list() but not for elem() !
  5. Thanks for the answer ! I already tried this, separating into Elem.h and List.h and here is what I get as an error : [b]In file included from List.h:4, from covariant.cpp:1: Elem.h:9: error: ISO C++ forbids declaration of ‘AbstractList’ with no type Elem.h:9: error: ‘AbstractList’ declared as a ‘virtual’ field Elem.h:9: error: expected ‘;’ before ‘*’ token Elem.h:22: error: ISO C++ forbids declaration of ‘List’ with no type Elem.h:22: error: ‘List’ declared as a ‘virtual’ field Elem.h:22: error: expected ‘;’ before ‘*’ token Elem.h:27: error: expected `;' before ‘protected’ Elem.h:28: error: ISO C++ forbids declaration of ‘List’ with no type Elem.h:28: error: expected ‘;’ before ‘*’ token[/b] Using [b]class Elem[/b]; and [b]class List;[/b] instead of #include in the header file leads to the same error than before... Any idea ? [source lang="cpp"]#ifndef _ELEM_ #define _ELEM_ #include "List.h" class AbstractElem { public : virtual AbstractList* list() = 0; protected : AbstractElem() {}; }; class Elem : public AbstractElem { public : Elem() : AbstractElem() {}; virtual List* list() { return _list; } protected : List* _list; }; #endif[/source] [source lang="cpp" ]#ifndef _LIST_ #define _LIST_ #include "Elem.h" class AbstractList { public : virtual AbstractElem* elem() = 0; protected : AbstractList() {}; }; class List : public AbstractList { public : List() : AbstractList() {} virtual Elem* elem() { return _e; } protected : Elem* _e; }; #endif[/source]
  6. Hy everyone ! Here is a peace of code that leads to the following error when compiling : [b]invalid covariant return type for ‘virtual List* Elem::list()’[/b] [source]class AbstractList; class AbstractElem { public : virtual AbstractList* list() = 0; protected : AbstractElem() {}; }; class List; class Elem : public AbstractElem { public : Elem() : AbstractElem() {}; virtual List* list() { return _list; } protected : List* _list; }; class AbstractList { public : virtual AbstractElem* elem() = 0; protected : AbstractList() {}; }; class List : public AbstractList { public : List() : AbstractList() {} virtual Elem* elem() { return _e; } protected : Elem* _e; }; int main() { return 0; }[/source] The thing that I don't understand is why I only get this error for the [b]list()[/b] function but not for the [b]elem()[/b] function ! Could anyone explain me the difference ? Thanks.
  7. Hy everyone, I'm planning to develop a tail / rope / strand simulator and i wanted to know if there were any papers, implementations or any experience to share about [b]oriented articulated-bodies[/b] ? There are many papers about general articulated bodies but I was wondering if a "local coordinates" simulator could do the trick. Thanks in advance.