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
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Updating old code: Vector > LONG

    Cinema 4D SDK
    c++ sdk
    2
    4
    634
    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.
    • fwilleke80F
      fwilleke80
      last edited by r_gigante

      Hi folks,

      I'm currently updating some old code that I didn't write myself. There's a line that I don't know what to make of:

      if (((vectorPointPos - vectorPlanePos) * vectorPlaneNormal) > 0)
      ...
      

      After looking into SDKs as old as R12, I simply can't remember or find out what happened back then when a Vector was compared to a LONG. It does not seem to be GetLength().

      Any ideas @ SDK Team?

      Thanks in advance!

      Greetings from Berlin,
      Frank

      www.frankwilleke.de
      Only asking personal code questions here.

      1 Reply Last reply Reply Quote 0
      • fwilleke80F
        fwilleke80
        last edited by

        Ah, got it. It would calculate a Dot() of (vectorPointPos - vectorPlanePos) and vectorPlaneNormal, and the LONG would be automatically cast to a Real.

        www.frankwilleke.de
        Only asking personal code questions here.

        1 Reply Last reply Reply Quote 0
        • M
          mp5gosu
          last edited by

          This is were commenting code is usually quite helpful. 🙂

          1 Reply Last reply Reply Quote 0
          • fwilleke80F
            fwilleke80
            last edited by fwilleke80

            Yeah, definitely. When porting old code that I didn't write to new C4D releases, I always add lots of comments, so people who come after me won't have the same problems 😉

            www.frankwilleke.de
            Only asking personal code questions here.

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