collidercache

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

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; }  
    };

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
🙂