Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Recent
    • Tags
    • Users
    • Login

    GeRayCollider::Init()?

    Scheduled Pinned Locked Moved SDK Help
    8 Posts 0 Posters 628 Views
    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 Offline
      Helper
      last edited by

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

      On 18/02/2011 at 08:36, xxxxxxxx wrote:

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

      ---------
      Howdy,

      I'm just wondering if someone could clarify the use of the second parameter in the GeRayCollider::Init() function. When should you use "TRUE" and when should you use "FALSE"?

      I've searched the forum for other code and find that sometimes TRUE is used and other times FALSE is used.

      In the documentation it says:

      Bool Init(BaseObject[URL-REMOVED]* goal, Bool force = FALSE)_<_h4_>_

      Initalizes the ray collider with the object specified by  goal. <_<_h5_>_h5_<_h5_>_rn
      > Bool
      >
      >> TRUE[URL-REMOVED] if successful, otherwise FALSE[URL-REMOVED].
      >
      > _quote>
      >
      > ##### _ <_h5_>_eters
      >
      >> BaseObject[URL-REMOVED]* goal
      >>
      >>> The object to check for intersections. The pointed object is copied.
      >>
      >> Bool force = FALSE
      >>
      >>> If  _force_ ==FALSE then the app checks if the passed object's GetDirty(DIRTY_DATA)[URL-REMOVED] is unchanged. If yes, it does nothing and returns TRUE.
      > If  _force_ ==TRUE it always rebuilds the cache.
      >
      >

      >
      > ... but when do you know that you want to always force rebuilding the cache?
      >
      >
      >
      >
      > Adios,
      >
      > Cactus Dan


      [URL-REMOVED] @maxon: This section contained a non-resolving link which has been removed.

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

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

        On 25/02/2011 at 06:54, xxxxxxxx wrote:

        Howdy,

        Any word on this?

        The reason I ask is that I've had a crash reported to me:

          	CINEMA 4D:	\__ZN16GeColliderCacheI11AddTriangleERK6VectorS2_S2_l + 0x4d (SP: 0xbfffbb48 PC: 0x53dcad)
          	CINEMA 4D:	\__ZN14GeRayColliderI4InitEP10BaseObjecti + 0x411 (SP: 0xbfffbb98 PC: 0x53ff19)
          	CDJointSkinR10.5.dylib:	\__ZN17CDPaintSkinWeight13GetCursorInfoEP12BaseDocumentR13BaseContainerP8BaseDrawffS3\_ + 0x418 (SP: 0xbfffbf58 PC: 0x1d6f9a68)
        

        ... you can see the last function in my plugin was ToolData::GetCurserInfo(), and in that function I'm calling:

        AutoAlloc<GeRayCollider> rc; if(!rc) return TRUE;
        if(!rc->Init(dest, TRUE)) return TRUE;
        

        Is using "TRUE" for the Init function triggering this?

        Adios,
        Cactus Dan

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

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

          On 25/02/2011 at 07:28, xxxxxxxx wrote:

          Well, depends on when you are using it. Let's say you use it in a tool plugin (which you are apparently doing) which modifies the geometry of dest, then you would intitialise with TRUE as you want the cache of the collider to rebuilt to get the correct information. If you do only place objects on the surface of the object, well, then you set it to FALSE as the cache does not need to be rebuilt, it works with the initialised data.

          That would be my understanding.

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

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

            On 25/02/2011 at 07:36, xxxxxxxx wrote:

            Howdy,

            Well, my tool is my CD Paint Skin Weights tool, so it's only painting the weights. So, would FALSE be better there?

            Adios,
            Cactus Dan

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

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

              On 25/02/2011 at 07:38, xxxxxxxx wrote:

              yep, exactly. The object geometry stays the same so it is enough if the geometry cache is built once in the collider class.

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

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

                On 25/02/2011 at 07:41, xxxxxxxx wrote:

                Howdy,

                OK, thanks.

                Now the question is: could using TRUE have triggered the crash?

                Adios,
                Cactus Dan

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

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

                  On 25/02/2011 at 07:50, xxxxxxxx wrote:

                  Don't know. I don't use the Collider Class myself as I have own code but I remember that I used both cases back then without any crash behavior so I guess there might be something else triggering the crash.

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

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

                    On 25/02/2011 at 08:21, xxxxxxxx wrote:

                    AFAIK, it shouldn't crash. It would just slow things down, since the RayCollider is initialized again and again with the complete geometry.

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