Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    collidercache

    SDK Help
    0
    3
    914
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H
      Helper
      last edited by

      THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

      On 01/11/2002 at 12:49, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   8.012 
      Platform:   Windows  ; Mac  ;  Mac OSX  ; 
      Language(s) :     C++  ;

      ---------
      im trying to use the collidercache lib
       
      AutoAlloc<GeColliderCache> o1; if (!o1) return NULL;
      Bool result=FillColliderCache(*o1,*surface);
      this seems pretty  simple, however the code in the docs describing a FillColliderCache function doesnt work.
       
      it  get to
      AutoAlloc<PolygonObject> poly(static_cast<PolygonObject*>(md2.op));
      then it breaks because  of error
       error C2664: '__thiscall AutoAlloc<class PolygonObject>::AutoAlloc<class PolygonObject>(long)' : cannot convert parameter 1 from 'class PolygonObject *' to 'long'
              This conversion requires a reinterpret_cast, a C-style cast or function-style cast
       
      er , whats he on about ?
      🙂
      cheers
       
      Paul

      1 Reply Last reply Reply Quote 0
      • H
        Helper
        last edited by

        THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

        On 01/11/2002 at 13:07, xxxxxxxx wrote:

        Quote: Originally posted by Paul Everett on 01  November 2002
        >
        > * * *
        >
        >  error C2664: '__thiscall AutoAlloc<class PolygonObject>::AutoAlloc<class PolygonObject>(long)' : cannot convert parameter 1 from 'class PolygonObject *' to 'long'
        >         This conversion requires a reinterpret_cast, a C-style cast or function-style cast
        Sorry, this code used one of my proposed changes to AutoAlloc that was never added officially. To use AutoAlloc in this way you'll have to add this constructor:

            
            
            template <class TYPE> class AutoAlloc  
            {  
                TYPE *ptr;  
              
              public:  
             **     AutoAlloc(TYPE* initptr) { ptr = initptr; }  
            **  
                AutoAlloc()           { ptr = TYPE::Alloc(); }  
                AutoAlloc(LONG id)    { ptr = TYPE::Alloc(id); }  
                AutoAlloc(LONG p1, LONG p2)   { ptr = TYPE::Alloc(p1,p2); }  
                ~AutoAlloc()          { TYPE::Free(ptr); ptr = NULL; }  
                operator TYPE* ()     { return ptr; }  
                operator TYPE& ()     { return *ptr; }  
                TYPE *operator -> ()  { return ptr; }  
                TYPE *const *operator & ()  { return &ptr; }  
                TYPE *Release() { TYPE *tmp=ptr; ptr=NULL; return tmp; }  
            };
        
        1 Reply Last reply Reply Quote 0
        • H
          Helper
          last edited by

          THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

          On 02/11/2002 at 04:10, xxxxxxxx wrote:

          thanks Mikael
          🙂

          1 Reply Last reply Reply Quote 0
          • First post
            Last post