SBLINEPROJECTOR(3iv)

πŸ’– NAME πŸ’–

SbLineProjector β€” it's a line projector, bestie. That's the whole vibe. It takes your 2D cursor situation and yeets it onto a 3D line. πŸŽ€

This page lives in section 3IV of the manual, so if you're out here looking for SbLineProjector(3IV), you found her. πŸ‘‘


🌸 INHERITS FROM 🌸

SbProjector > SbLineProjector

so she's a SbProjector at heart, with all the projector family drama that comes with it. πŸ’…


✨ SYNOPSIS ✨

#include <Inventor/projectors/SbLineProjector.h>

Methods from class SbLineProjector:

                     SbLineProjector()
                     ~SbLineProjector()
 void                setLine(const SbLine &line)
 const SbLine &      getLine() const
 virtual SbVec3f     getVector(const SbVec2f &mousePosition1, const SbVec2f
                          &mousePosition2)
 virtual SbVec3f     getVector(const SbVec2f &mousePosition)
 void                setStartPosition(const SbVec2f &mousePosition)
 void                setStartPosition(const SbVec3f &point)

Methods from class SbProjector:

 virtual SbVec3f        project(const SbVec2f &point)
 virtual void           setViewVolume(const SbViewVolume &vol)
 const SbViewVolume &   getViewVolume() const
 virtual void           setWorkingSpace(const SbMatrix &space)
 const SbMatrix &       getWorkingSpace() const
 virtual SbProjector *  copy() const

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so here's the tea, bestie: SbLineProjector takes a 2D point β€” literally usually just wherever your cursor is at πŸ–±οΈ β€” and projects it onto a 3D line. That's it. That's the job. And she eats every single time. πŸ”₯


πŸ’… METHODS πŸ’…

🌟 Constructor & Destructor 🌟

                     SbLineProjector()
                     ~SbLineProjector()

Constructor and destructor, iconic duo. 🫢 The default line passes through the origin and is aligned with the Y axis β€” no cap, that's just how she comes out of the box.


πŸŽ€ Get / Set the Line πŸŽ€

 void                setLine(const SbLine &line)
 const SbLine &      getLine() const

Set and get the line on which to project 2D points. Like, this is the line. The main character line. Set her and get her. πŸ‘‘


🌈 Get a Vector From Two Mouse Points 🌈

 virtual SbVec3f     getVector(const SbVec2f &mousePosition1, const SbVec2f
                          &mousePosition2)

Get a vector on this line given two normalized mouse points. Two points in, one vector out. ✨


πŸ“ Get a Vector From the Current Mouse Point πŸ“

 virtual SbVec3f     getVector(const SbVec2f &mousePosition)

Get a vector given the current mouse point. This one uses the last point on this projector from the previous call to getVector() or setStartPostion(). (Yes, setStartPostion() β€” that's the spelling in the docs, don't come for me πŸ™ˆ.)

⚠️ Do not use this if the working space transform is changing, because the new point will be in a different space than the old one. It's giving chaos and we are NOT doing that. πŸ’€

🌸 Set the Initial Position 🌸

 void                setStartPosition(const SbVec2f &mousePosition)

Set the initial position from a mouse position. Cursor-coded starting point. πŸ–±οΈ


🧚 Set the Initial Position (3D Edition) 🧚

 void                setStartPosition(const SbVec3f &point)

Set the initial position from a point on the projector. 3D point, no mouse needed, we're fancy now. πŸ’œ


πŸ‘‘ SEE ALSO πŸ‘‘

The whole projector friend group, fr fr:

  • SbCylinderProjector
  • SbCylinderPlaneProjector
  • SbCylinderSectionProjector
  • SbCylinderSheetProjector
  • SbPlaneProjector
  • SbSpherePlaneProjector
  • SbSphereProjector
  • SbSphereSectionProjector
  • SbSphereSheetProjector

And that's the page, bestie!! πŸ’– This was SbLineProjector(3IV) from section 3IV β€” that's the manual name and the footer energy all wrapped up, so you know exactly what you're reading and where it came from. Go project something cute. Periodt. βœ¨πŸŽ€πŸ¦‹