SOTRACKBALLDRAGGER(3iv)
SoTrackballDragger β the striped ball that spins π«
okay bestie, welcome to the SoTrackballDragger(3IV) page, this is part 1 of 2 so buckle up, we're going in πΈ
β¨ NAME β¨
SoTrackballDragger β a striped ball that you can rotate or scale uniformly by dragging it with the mouse. it's giving "fidget toy but make it 3D" π
𧬠INHERITS FROM π§¬
SoBase > SoFieldContainer > SoNode > SoBaseKit > SoInteractionKit >
SoDragger > SoTrackballDragger
so yeah she's deep in the family tree, generational talent fr fr π
π SYNOPSIS π
first things first, the include:
#include <Inventor/draggers/SoTrackballDragger.h>
π Fields from class SoTrackballDragger
SoSFVec3f scaleFactor
SoSFRotation rotation
π Fields from class SoDragger
SoSFBool isActive
π Fields from class SoInteractionKit
SoSFEnum renderCaching
SoSFEnum boundingBoxCaching
SoSFEnum renderCulling
SoSFEnum pickCulling
π Parts from class SoBaseKit
(SoNodeKitListPart) callbackList
π Methods from class SoTrackballDragger
SoTrackballDragger()
SbBool isAnimationEnabled()
void setAnimationEnabled(SbBool newVal)
static const SoNodekitCatalog *
getClassNodekitCatalog() const
static SoType getClassTypeId()
π Methods from class SoDragger
void addStartCallback(SoDraggerCB *f, void *userData =
NULL)
void removeStartCallback(SoDraggerCB *f, void *userData =
NULL)
void addMotionCallback(SoDraggerCB *f, void *userData =
NULL)
void removeMotionCallback(SoDraggerCB *f, void *userData =
NULL)
void addFinishCallback(SoDraggerCB *f, void *userData =
NULL)
void removeFinishCallback(SoDraggerCB *f, void *userData =
NULL)
void addValueChangedCallback(SoDraggerCB *f, void *userData
= NULL)
void removeValueChangedCallback(SoDraggerCB *f, void
*userData = NULL)
SbBool enableValueChangedCallbacks()
void setMinGesture(int pixels)
int getMinGesture() const
static void setMinScale(float newMinScale)
static float getMinScale()
π Methods from class SoInteractionKit
virtual SbBool setPartAsPath(const SbName &partName, SoPath
*surrogatePath )
π Methods from class SoBaseKit
virtual const SoNodekitCatalog *
getNodekitCatalog() const
virtual SoNode * getPart(const SbName &partName, SbBool
makeIfNeeded)
SbString getPartString(const SoBase *part)
virtual SoNodeKitPath * createPathToPart(const SbName &partName, SbBool
makeIfNeeded, const SoPath *pathToExtend =
NULL)
virtual SbBool setPart(const SbName &partName, SoNode *newPart)
SbBool set(char *partName, char *parameters)
SbBool set(char *nameValuePairs)
static SbBool isSearchingChildren()
static void setSearchingChildren(SbBool newVal)
π Methods from class SoNode
void setOverride(SbBool state)
SbBool isOverride() const
SoNode * copy(SbBool copyConnections = FALSE) const
virtual SbBool affectsState() const
static SoNode * getByName(const SbName &name)
static int getByName(const SbName &name, SoNodeList &list)
π Methods from class SoFieldContainer
void setToDefaults()
SbBool hasDefaultValues() const
SbBool fieldsAreEqual(const SoFieldContainer *fc) const
void copyFieldValues(const SoFieldContainer *fc, SbBool
copyConnections = FALSE)
void get(SbString &fieldDataString)
virtual int getFields(SoFieldList &resultList) const
virtual SoField * getField(const SbName &fieldName) const
SbBool getFieldName(const SoField *field, SbName &fieldName)
const
SbBool isNotifyEnabled() const
SbBool enableNotify(SbBool flag)
π Methods from class SoBase
void ref()
void unref() const
void unrefNoDelete() const
void touch()
virtual SoType getTypeId() const
SbBool isOfType(SoType type) const
virtual void setName(const SbName &name)
virtual SbName getName() const
π Macros from class SoBaseKit
SO_GET_PART(kit, partName, partClass)
SO_CHECK_PART(kit, partName, partClass)
π DESCRIPTION π
okay so picture this: SoTrackballDragger is literally just a ball wrapped in three circular stripes. the stripes are oriented like wheels that spin around the x, y, and z axes. drag the stripes to rotate the trackball around those axes π‘
and here's the slay part β you do not have to hit the lines. pick anywhere within the stripe's outline. no pixel-hunting required, we're not doing that today π
wanna rotate the trackball freely in 3 dimensions? click the area between the stripes and then drag. an invisible but pickable sphere initiates this dragging β sneaky, iconic, no cap π»β¨
if the mouse is still moving when you release it, the trackball will continue to spin. yes, momentum. she has main character energy and she keeps going.
press the <Control> key to scale the trackball uniformly instead of rotating π«Ά
press the <Shift> key and the user axis appears β it's a draggable axis with an extra stripe around it. moving the mouse along the surface of the sphere drags the 'pole' of the axis. release the <Shift> key and the user axis remains (she's not leaving, she lives here now). drag the new stripe for constrained rotation around the user axis π
to make the user axis disappear, press <Shift> and drag the pole to where two of the other stripes intersect. this aligns the user axis with a primary axis, at which point the user axis disappears. poof. gone. periodt π«
as you drag the trackball, it updates its rotation field, or its scaleFactor field if the <Control> key is down. and as with all draggers, if you change the fields the dragger moves in response. two-way street bestie π
Remember: This is not an SoTransform! π¨ this is the single most important line on this page. do not come for me saying "why isn't my object moving".
if you want to move other objects with this dragger, you have two options:
- [a] use an
SoTrackballManip, which is subclassed fromSoTransform. the manipulator creates one of these draggers and uses it as the interface to edit the manipulator's fields. (see theSoTrackballManipreference page). - [b] use field-to-field connections to connect the fields of this dragger to those of any
SoTransformationnode.
you can change the parts in any instance of this dragger using setPart(). the default part geometries are defined as resources for this SoTrackballDragger class. they are detailed in the Dragger Resources section of the online reference page for this class π
wanna make your program use different default resources for the parts? so easy:
- copy the file
/usr/share/data/draggerDefaults/trackballDragger.ivinto your own directory - edit the file
- then set the environment variable
SO_DRAGGER_DIRto be a path to that directory
boom. customized. ate and left no crumbs π
π FIELDS π
SoSFVec3fscaleFactorβ the Scale of the dragger. how big she's feeling today πSoSFRotationrotationβ the Orientation of the dragger. which way she's facing. her vibe check, if you will π¦
π οΈ METHODS π οΈ
SoTrackballDragger()β Constructor. she is born β¨SbBool isAnimationEnabled()void setAnimationEnabled(SbBool newVal)
if the mouse is moving while you release it, the trackball will continue to spin afterwards. these two methods will query and set whether this feature is turned on or off. by default, the animation feature is turned on π₯ (yes, the spin-forever thing is default behaviour, you're welcome)
static const SoNodekitCatalog * getClassNodekitCatalog() constβ Returns anSoNodekitCatalogfor this class ποΈstatic SoType getClassTypeId()β Returns type identifier for this class π·οΈ
π¦ CATALOG PARTS π¦
All parts
here's the full roster of parts, with their type, default type, and whether they're NULL by default π
callbackListβ Part Type:NodeKitListPartβ Default Type:--β NULL by Default: yessurroundScaleβ Part Type:SurroundScaleβ Default Type:--β NULL by Default: yesantiSquishβ Part Type:AntiSquishβ Default Type:--β NULL by Default: norotatorβ Part Type:Separatorβ Default Type:--β NULL by Default: yesrotatorActiveβ Part Type:Separatorβ Default Type:--β NULL by Default: yesXRotatorβ Part Type:Separatorβ Default Type:--β NULL by Default: yesXRotatorActiveβ Part Type:Separatorβ Default Type:--β NULL by Default: yesYRotatorβ Part Type:Separatorβ Default Type:--β NULL by Default: yesYRotatorActiveβ Part Type:Separatorβ Default Type:--β NULL by Default: yesZRotatorβ Part Type:Separatorβ Default Type:--β NULL by Default: yesZRotatorActiveβ Part Type:Separatorβ Default Type:--β NULL by Default: yesuserAxisβ Part Type:Separatorβ Default Type:--β NULL by Default: yesuserAxisActiveβ Part Type:Separatorβ Default Type:--β NULL by Default: yesuserRotatorβ Part Type:Separatorβ Default Type:--β NULL by Default: yesuserRotatorActiveβ Part Type:Separatorβ Default Type:--β NULL by Default: yes
Extra information for list parts from above table
callbackListβ Container Type:Separatorβ Permissible Types:Callback,EventCallback
okay bestie that's part 1, and there is more coming β don't go anywhere πΈ
β¨ DRAGGER RESOURCES β¨
okay bestie, this is the part where we meet every single resource this dragger has π each one is a little part with its own vibe, so let's go one by one, no skipping, we're doing all of them π«Ά
πΈ Resource: trackballRotator
- Part:
rotator - Appearance: Invisible but pickable sphere
- Description: Initiates unconstrained 3D rotation. Slightly smaller radius than the stripes, so you must pick between the stripes to use it.
πΈ Resource: trackballRotatorActive
- Part:
rotatorActive - Appearance: Invisible sphere
- Description: Displayed during unconstrained 3D rotation.
πΈ Resource: trackballXRotator
- Part:
XRotator - Appearance: White outline of a stripe aligned with the X axis.
- Description: Pick this to initiate constrained rotation about the X axis.
πΈ Resource: trackballXRotatorActive
- Part:
XRotatorActive - Appearance: Yellow version of the regular
XRotator - Description: Displayed during constrained rotation about the X axis.
πΈ Resource: trackballYRotator
- Part:
YRotator - Appearance: White outline of a stripe aligned with the Y axis.
- Description: Pick this to initiate constrained rotation about the Y axis.
πΈ Resource: trackballYRotatorActive
- Part:
YRotatorActive - Appearance: Yellow version of the regular
YRotator - Description: Displayed during constrained rotation about the Y axis.
πΈ Resource: trackballZRotator
- Part:
ZRotator - Appearance: White outline of a stripe aligned with the Z axis.
- Description: Pick this to initiate constrained rotation about the Z axis.
πΈ Resource: trackballZRotatorActive
- Part:
ZRotatorActive - Appearance: Yellow version of the regular
ZRotator - Description: Displayed during constrained rotation about the Z axis.
πΈ Resource: trackballUserAxis
- Part:
userAxis - Appearance: Thin purple line
- Description: Displays the user axis. Dragging the
userRotatorrotates about this line.
πΈ Resource: trackballUserAxisActive
- Part:
userAxisActive - Appearance: Thin purple line
- Description: Displays the user axis. Dragging the
userRotatorrotates about this line.
πΈ Resource: trackballUserRotator
- Part:
userRotator - Appearance: Transparent green stripe circling the user axis.
- Description: Pick to initiate constrained rotation about the user axis.
πΈ Resource: trackballUserRotatorActive
- Part:
userRotatorActive - Appearance: Brighter green version of the regular
userRotator - Description: Displayed during constrained rotation about the user axis.
πΎ FILE FORMAT/DEFAULTS πΎ
like, here's literally the whole default setup, copy-paste energy, do not touch a single character bestie π
TrackballDragger {
renderCaching AUTO
boundingBoxCaching AUTO
renderCulling AUTO
pickCulling AUTO
isActive FALSE
rotation 0 0 1 0
scaleFactor 1 1 1
callbackList NULL
surroundScale NULL
antiSquish AntiSquish {
sizing LONGEST_DIAGONAL }
rotator <trackballRotator resource>
rotatorActive <trackballRotatorActive resource>
XRotator <trackballXRotator resource>
XRotatorActive <trackballXRotatorActive resource>
YRotator <trackballYRotator resource>
YRotatorActive <trackballYRotatorActive resource>
ZRotator <trackballZRotator resource>
ZRotatorActive <trackballZRotatorActive resource>
userAxis <trackballUserAxis resource>
userAxisActive <trackballUserAxisActive resource>
userRotator <trackballUserRotator resource>
userRotatorActive <trackballUserRotatorActive resource>
}
π«’ NOTE π«’
okay so this is lowkey tea β β unlike most multi-function draggers, SoTrackballDragger is not a compound dragger made up of other draggers that perform its smaller tasks. And it's not because it was inappropriate, nope β it's because the trackball was written before implementation of the methods that take care of synchronizing multiple child draggers π
The younger SoCenterballDragger is similar in form to the trackball, but the centerball is a compound dragger. periodt. π
π SEE ALSO π
go read these next, bestie, they're all family:
SoInteractionKitSoDraggerSoCenterballDraggerSoDirectionalLightDraggerSoDragPointDraggerSoHandleBoxDraggerSoJackDraggerSoPointLightDraggerSoRotateCylindricalDraggerSoRotateDiscDraggerSoRotateSphericalDraggerSoScale1DraggerSoScale2DraggerSoScale2UniformDraggerSoScaleUniformDraggerSoSpotLightDraggerSoTabBoxDraggerSoTabPlaneDraggerSoTransformBoxDraggerSoTransformerDraggerSoTranslate1DraggerSoTranslate2Dragger
and that's a wrap on SoTrackballDragger, the 3IV girlies' finest π no date on this one so I can't tell you when it was written, but the source and version you're holding is SoTrackballDragger(3IV)() β slay, bye bestie, go rotate something π¦β¨
π¦ where this page comes from
- debian bookworm: inventor-doc 2.1.5-10+dfsg-2 Β· LGPL-2.0-or-later
- debian trixie: inventor-doc 2.1.6+ds-2 Β· LGPL-2.0-or-later
- ubuntu jammy: inventor-doc 2.1.5-10-24
- ubuntu noble: inventor-doc 2.1.5-10+dfsg-2.1build2 Β· LGPL-2.0-or-later
- ubuntu questing: inventor-doc 2.1.6+ds-2
- ubuntu resolute: inventor-doc 2.1.6.1+ds-1 Β· LGPL-2.0-or-later
- ubuntu stonking: inventor-doc 2.1.6.1+ds-1 Β· LGPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms