reference

This documentation is automatically generated from the openFrameworks source code using doxygen and refers to the most recent release, version 0.12.0.

A generic 3d object in space with transformation (position, rotation, scale). More...

#include <ofNode.h>

Inheritance diagram for ofNode:
of3dPrimitive ofCamera ofLight ofBoxPrimitive ofConePrimitive ofCylinderPrimitive ofIcoSpherePrimitive ofPlanePrimitive ofSpherePrimitive ofEasyCam

Public Member Functions

Parent Node
void setParent (ofNode &parent, bool bMaintainGlobalTransform=false)
 Set parent for the node. The node will inherit transformations from parent.
 
void clearParent (bool bMaintainGlobalTransform=false)
 Remove parent node linking.
 
ofNodegetParent () const
 Get the parent node of this node.
 
Getters
glm::vec3 getPosition () const
 Get node's local position as a 3D vector.
 
float getX () const
 Get node's local x position.
 
float getY () const
 Get node's local y position.
 
float getZ () const
 Get node's local z position.
 
glm::vec3 getXAxis () const
 Get the node's local x axis as 3d vector.
 
glm::vec3 getYAxis () const
 Get the node's local y axis as 3d vector.
 
glm::vec3 getZAxis () const
 Get the node's local z axis as 3d vector.
 
glm::vec3 getSideDir () const
 Get direction of node's side aka local x axis, as 3d vector.
 
glm::vec3 getLookAtDir () const
 Get direction the node looks at aka local -z axis, as 3d vector.
 
glm::vec3 getUpDir () const
 Get direction of node's top aka local y axis, as 3d vector.
 
 OF_DEPRECATED_MSG ("Use Deg/Rad versions.", float getPitch() const)
 
 OF_DEPRECATED_MSG ("Use Deg/Rad versions.", float getHeading() const)
 
 OF_DEPRECATED_MSG ("Use Deg/Rad versions.", float getRoll() const)
 
float getPitchDeg () const
 Get pitch of node, aka the rotation along local x axis.
 
float getHeadingDeg () const
 Get heading of node, aka the rotation along local y axis.
 
float getRollDeg () const
 Get roll of node, aka the rotation along local z axis.
 
float getPitchRad () const
 Get pitch of node, aka the rotation along local x axis.
 
float getHeadingRad () const
 Get heading of node, aka the rotation along local y axis.
 
float getRollRad () const
 Get roll of node, aka the rotation along local z axis.
 
glm::quat getOrientationQuat () const
 Get the local orientation of the node as a quaternion.
 
 OF_DEPRECATED_MSG ("Use the Deg/Rad version.", glm::vec3 getOrientationEuler() const)
 
glm::vec3 getOrientationEulerDeg () const
 Get local orientation of node in degrees around x, y, and z axes.
 
glm::vec3 getOrientationEulerRad () const
 Get local orientation of node in degrees around x, y, and z axes.
 
glm::vec3 getScale () const
 Get local scale of node in xyz axes where 1 is default.
 
const glm::mat4 & getLocalTransformMatrix () const
 Get node's local transformations (position, orientation, scale).
 
glm::mat4 getGlobalTransformMatrix () const
 Get node's global transformations (position, orientation, scale).
 
glm::vec3 getGlobalPosition () const
 Get node's global position as a 3D vector.
 
glm::quat getGlobalOrientation () const
 Get the global orientation of the node as a quaternion.
 
glm::vec3 getGlobalScale () const
 Get global scale of node in xyz axes where 1 is default.
 
Setters
void setPosition (float px, float py, float pz)
 Set the local position of the node using xyz coordinates.
 
void setPosition (const glm::vec3 &p)
 Set the local position of the node using a 3D vector of coordinates.
 
void setGlobalPosition (float px, float py, float pz)
 Set the global position of the node using xyz coordinates.
 
void setGlobalPosition (const glm::vec3 &p)
 Set the global position of the node using a 3D vector of coordinates.
 
void setOrientation (const glm::quat &q)
 Set local orientation with a quaternion.
 
void setOrientation (const glm::vec3 &eulerAngles)
 Set local orientation with xyz euler angles.
 
void setGlobalOrientation (const glm::quat &q)
 Set global orientation with a quaternion.
 
void setScale (float s)
 Set local uniform scale (x, y, and z are equally scaled).
 
void setScale (float sx, float sy, float sz)
 Set local scale for xyz axes individually.
 
void setScale (const glm::vec3 &s)
 Set local scale for xyz axes individually with a 3D vector.
 
Modifiers
void move (float x, float y, float z)
 Move node by relative amount with xyz coordinates.
 
void move (const glm::vec3 &offset)
 Move node by relative amount with xyz as ref to 3D vector.
 
void truck (float amount)
 Move node left+right relative to current position (in local x axis).
 
void boom (float amount)
 Move node up+down relative to current position (in local y axis).
 
void dolly (float amount)
 Move node backward+forward relative to current position (in local z axis).
 
 OF_DEPRECATED_MSG ("Use the Deg/Rad version.", void tilt(float degrees))
 
void tiltDeg (float degrees)
 Tilt up+down relative to current orientation (around local x axis).
 
void tiltRad (float radians)
 Tilt up+down relative to current orientation (around local x axis).
 
 OF_DEPRECATED_MSG ("Use the Deg/Rad version.", void pan(float degrees))
 
void panDeg (float degrees)
 Rotate left+right relative to current orientation (around local y axis).
 
void panRad (float radians)
 Rotate left+right relative to current orientation (around local y axis).
 
 OF_DEPRECATED_MSG ("Use the Deg/Rad version.", void roll(float degrees))
 
void rollDeg (float degrees)
 Roll left+right relative to current orientation (around local z axis).
 
void rollRad (float radians)
 Roll left+right relative to current orientation (around local z axis).
 
void rotate (const glm::quat &q)
 Rotate relative to current orientation by quaternion.
 
 OF_DEPRECATED_MSG ("Use the Deg/Rad version.", void rotate(float degrees, const glm::vec3 &v))
 
void rotateDeg (float degrees, const glm::vec3 &v)
 Rotate relative to current orientation around arbitrary axis.
 
void rotateRad (float radians, const glm::vec3 &v)
 Rotate relative to current orientation around arbitrary axis.
 
 OF_DEPRECATED_MSG ("Use the Deg/Rad version.", void rotate(float degrees, float vx, float vy, float vz))
 
void rotateDeg (float degrees, float vx, float vy, float vz)
 Rotate relative to current orientation around arbitrary axis.
 
void rotateRad (float radians, float vx, float vy, float vz)
 Rotate relative to current orientation around arbitrary axis.
 
void rotateAround (const glm::quat &q, const glm::vec3 &point)
 Rotate relative to current orientation by quaternion around point.
 
 OF_DEPRECATED_MSG ("Use the Deg/Rad version.", void rotateAround(float degrees, const glm::vec3 &axis, const glm::vec3 &point))
 
void rotateAroundDeg (float degrees, const glm::vec3 &axis, const glm::vec3 &point)
 Rotate relative to current orientation around arbitrary axis around point.
 
void rotateAroundRad (float radians, const glm::vec3 &axis, const glm::vec3 &point)
 Rotate relative to current orientation around arbitrary axis around point.
 
void lookAt (const glm::vec3 &lookAtPosition)
 Orient node to look at point (-z axis pointing to global position).
 
void lookAt (const glm::vec3 &lookAtPosition, glm::vec3 upVector)
 Orient node to look at point (-z axis pointing to global position).
 
void lookAt (const ofNode &lookAtNode)
 Orient node to look at another node (-z axis pointing at other node).
 
void lookAt (const ofNode &lookAtNode, const glm::vec3 &upVector)
 Orient node to look at another node (-z axis pointing at other node).
 
 OF_DEPRECATED_MSG ("Use the Deg/Rad version.", void orbit(float longitude, float latitude, float radius, const glm::vec3 &centerPoint=glm::vec3(0, 0, 0)))
 
 OF_DEPRECATED_MSG ("Use the Deg/Rad version.", void orbit(float longitude, float latitude, float radius, ofNode &centerNode))
 
void orbitDeg (float longitude, float latitude, float radius, const glm::vec3 &centerPoint=glm::vec3(0, 0, 0))
 Orbit node around a global position at a specific radius.
 
void orbitDeg (float longitude, float latitude, float radius, ofNode &centerNode)
 Orbit node around another node at a specific radius.
 
void orbitRad (float longitude, float latitude, float radius, const glm::vec3 &centerPoint=glm::vec3(0, 0, 0))
 Orbit node around a global position at a specific radius.
 
void orbitRad (float longitude, float latitude, float radius, ofNode &centerNode)
 Orbit node around another node at a specific radius.
 
OpenGL Transformation
void transformGL (ofBaseRenderer *renderer=nullptr) const
 Set opengl renderer's modelview matrix to this nodes transform.
 
void restoreTransformGL (ofBaseRenderer *renderer=nullptr) const
 Restore opengl renderer's previous modelview transform matrix.
 
void resetTransform ()
 Reset this node's transformations, position, rotation and scale.
 
Drawing
virtual void customDraw (const ofBaseRenderer *renderer) const
 If you extend ofNode and wish to change the way it draws, extend this.
 
virtual void customDraw ()
 If you extend ofNode and wish to change the way it draws, extend this.
 
virtual void draw () const
 Draw the node as a white cube with xyz axes.
 

Protected Member Functions

void createMatrix ()
 
void updateAxis ()
 
virtual void onPositionChanged ()
 Classes extending ofNode can override this method to get notified when the position changed.
 
virtual void onOrientationChanged ()
 Classes extending ofNode can override this methods to get notified when the orientation changed.
 
virtual void onScaleChanged ()
 Classes extending ofNode can override this methods to get notified when the scale changed.
 

Protected Attributes

ofNodeparent = nullptr
 

Detailed Description

A generic 3d object in space with transformation (position, rotation, scale).

Member Function Documentation

◆ boom()

void ofNode::boom ( float  amount)

Move node up+down relative to current position (in local y axis).

Parameters
amountDesired relative position change along local y axis as float.

◆ clearParent()

void ofNode::clearParent ( bool  bMaintainGlobalTransform = false)

Remove parent node linking.

Parameters
bMaintainGlobalTransformBoolean if maintain child's global transformations (default = false).

◆ createMatrix()

void ofNode::createMatrix ( )
protected

◆ customDraw() [1/2]

void ofNode::customDraw ( )
virtual

If you extend ofNode and wish to change the way it draws, extend this.

Note
Try to not use global functions for rendering and instead use the passed renderer.

◆ customDraw() [2/2]

void ofNode::customDraw ( const ofBaseRenderer renderer) const
virtual

If you extend ofNode and wish to change the way it draws, extend this.

Parameters
rendererA pointer to the renderer you want to draw to.
Note
Try to not use global functions for rendering and instead use the passed renderer.

◆ dolly()

void ofNode::dolly ( float  amount)

Move node backward+forward relative to current position (in local z axis).

Parameters
amountDesired relative position change along local z axis as float.

◆ draw()

void ofNode::draw ( ) const
virtual

Draw the node as a white cube with xyz axes.

Note
do NOT override this. It transforms the node to its position+orientation+scale and calls the virtual 'customDraw' method above which you CAN override.

Reimplemented in of3dPrimitive, and of3dPrimitive.

◆ getGlobalOrientation()

glm::quat ofNode::getGlobalOrientation ( ) const

Get the global orientation of the node as a quaternion.

Returns
An quaternion of the global orientations(useful for complex rotations)

◆ getGlobalPosition()

glm::vec3 ofNode::getGlobalPosition ( ) const

Get node's global position as a 3D vector.

Returns
A 3D vector with the global coordinates.

◆ getGlobalScale()

glm::vec3 ofNode::getGlobalScale ( ) const

Get global scale of node in xyz axes where 1 is default.

Returns
The global scale in the xyz axes where 1 = 100% of size.

◆ getGlobalTransformMatrix()

glm::mat4 ofNode::getGlobalTransformMatrix ( ) const

Get node's global transformations (position, orientation, scale).

Returns
A refrence to mat4 containing node's global transformations.
See also
https://open.gl/transformations

◆ getHeadingDeg()

float ofNode::getHeadingDeg ( ) const

Get heading of node, aka the rotation along local y axis.

Returns
The rotation around the local y axis in degrees, as a float.

◆ getHeadingRad()

float ofNode::getHeadingRad ( ) const

Get heading of node, aka the rotation along local y axis.

Returns
The rotation around the local y axis in degrees, as a float.

◆ getLocalTransformMatrix()

const glm::mat4 & ofNode::getLocalTransformMatrix ( ) const

Get node's local transformations (position, orientation, scale).

Returns
A refrence to mat4 containing node's local transformations.
See also
https://open.gl/transformations

◆ getLookAtDir()

glm::vec3 ofNode::getLookAtDir ( ) const

Get direction the node looks at aka local -z axis, as 3d vector.

Returns
A normalized 3D vector of the node's local -z axis direction.

◆ getOrientationEulerDeg()

glm::vec3 ofNode::getOrientationEulerDeg ( ) const

Get local orientation of node in degrees around x, y, and z axes.

Returns
The local x, y and z axes orientation in degrees, as a 3D vector.

◆ getOrientationEulerRad()

glm::vec3 ofNode::getOrientationEulerRad ( ) const

Get local orientation of node in degrees around x, y, and z axes.

Returns
The local x, y and z axes orientation in degrees, as a 3D vector.

◆ getOrientationQuat()

glm::quat ofNode::getOrientationQuat ( ) const

Get the local orientation of the node as a quaternion.

Returns
A quaternion of local orientation (useful for complex rotations)

◆ getParent()

ofNode * ofNode::getParent ( ) const

Get the parent node of this node.

Returns
Pointer to parent ofNode.

◆ getPitchDeg()

float ofNode::getPitchDeg ( ) const

Get pitch of node, aka the rotation along local x axis.

Returns
The rotation around the local x axis in degrees, as a float.

◆ getPitchRad()

float ofNode::getPitchRad ( ) const

Get pitch of node, aka the rotation along local x axis.

Returns
The rotation around the local x axis in degrees, as a float.

◆ getPosition()

glm::vec3 ofNode::getPosition ( ) const

Get node's local position as a 3D vector.

Returns
A 3D vector with the local coordinates.

◆ getRollDeg()

float ofNode::getRollDeg ( ) const

Get roll of node, aka the rotation along local z axis.

Returns
The rotation around the local z axis in degrees, as a float.

◆ getRollRad()

float ofNode::getRollRad ( ) const

Get roll of node, aka the rotation along local z axis.

Returns
The rotation around the local z axis in degrees, as a float.

◆ getScale()

glm::vec3 ofNode::getScale ( ) const

Get local scale of node in xyz axes where 1 is default.

Returns
The local scale in the xyz axes where 1 = 100% of size.

◆ getSideDir()

glm::vec3 ofNode::getSideDir ( ) const

Get direction of node's side aka local x axis, as 3d vector.

Returns
A normalized 3D vector of the node's local x axis direction.

◆ getUpDir()

glm::vec3 ofNode::getUpDir ( ) const

Get direction of node's top aka local y axis, as 3d vector.

Returns
A normalized 3D vector of the node's local y axis direction.

◆ getX()

float ofNode::getX ( ) const

Get node's local x position.

Returns
Local x coordinate as a float.

◆ getXAxis()

glm::vec3 ofNode::getXAxis ( ) const

Get the node's local x axis as 3d vector.

Returns
A normalized 3D vector of the node's local x axis direction.

◆ getY()

float ofNode::getY ( ) const

Get node's local y position.

Returns
Local y coordinate as a float.

◆ getYAxis()

glm::vec3 ofNode::getYAxis ( ) const

Get the node's local y axis as 3d vector.

Returns
A normalized 3D vector of the node's local y axis direction.

◆ getZ()

float ofNode::getZ ( ) const

Get node's local z position.

Returns
Local z coordinate as a float.

◆ getZAxis()

glm::vec3 ofNode::getZAxis ( ) const

Get the node's local z axis as 3d vector.

Returns
A normalized 3D vector of the node's local z axis direction.

◆ lookAt() [1/4]

void ofNode::lookAt ( const glm::vec3 &  lookAtPosition)

Orient node to look at point (-z axis pointing to global position).

Parameters
lookAtPositionXYZ coordinates of point to look at as ref to 3D vector.
Note
This version calculates the up vector automatically to try to keep it relatively consistant with the original angle.

◆ lookAt() [2/4]

void ofNode::lookAt ( const glm::vec3 &  lookAtPosition,
glm::vec3  upVector 
)

Orient node to look at point (-z axis pointing to global position).

Parameters
lookAtPositionXYZ coordinates of point to look at as ref to 3D vector.
upVectorThe desired up axis as a cartesian 3D vector.

◆ lookAt() [3/4]

void ofNode::lookAt ( const ofNode lookAtNode)

Orient node to look at another node (-z axis pointing at other node).

Note
This version calculates the up vector automatically to try to keep it relatively consistant with the original angle.

◆ lookAt() [4/4]

void ofNode::lookAt ( const ofNode lookAtNode,
const glm::vec3 &  upVector 
)

Orient node to look at another node (-z axis pointing at other node).

Parameters
lookAtNodeA reference to the node to look at.
upVectorThe desired up axis as a ref to cartesian 3D vector.

◆ move() [1/2]

void ofNode::move ( const glm::vec3 &  offset)

Move node by relative amount with xyz as ref to 3D vector.

Parameters
offsetDesired relative position change along all axes as ref to 3D vector.

◆ move() [2/2]

void ofNode::move ( float  x,
float  y,
float  z 
)

Move node by relative amount with xyz coordinates.

Parameters
xDesired relative position change along x axis as a float.
yDesired relative position change along y axis as a float.
zDesired relative position change along z axis as a float.

◆ OF_DEPRECATED_MSG() [1/12]

ofNode::OF_DEPRECATED_MSG ( "Use Deg/Rad versions."  ,
float getHeading() const   
)

◆ OF_DEPRECATED_MSG() [2/12]

ofNode::OF_DEPRECATED_MSG ( "Use Deg/Rad versions."  ,
float getPitch() const   
)

◆ OF_DEPRECATED_MSG() [3/12]

ofNode::OF_DEPRECATED_MSG ( "Use Deg/Rad versions."  ,
float getRoll() const   
)

◆ OF_DEPRECATED_MSG() [4/12]

ofNode::OF_DEPRECATED_MSG ( "Use the Deg/Rad version."  ,
glm::vec3 getOrientationEuler() const   
)

◆ OF_DEPRECATED_MSG() [5/12]

ofNode::OF_DEPRECATED_MSG ( "Use the Deg/Rad version."  ,
void   orbitfloat longitude, float latitude, float radius, const glm::vec3 &centerPoint=glm::vec3(0, 0, 0) 
)

◆ OF_DEPRECATED_MSG() [6/12]

ofNode::OF_DEPRECATED_MSG ( "Use the Deg/Rad version."  ,
void   orbitfloat longitude, float latitude, float radius, ofNode &centerNode 
)

◆ OF_DEPRECATED_MSG() [7/12]

ofNode::OF_DEPRECATED_MSG ( "Use the Deg/Rad version."  ,
void   panfloat degrees 
)

◆ OF_DEPRECATED_MSG() [8/12]

ofNode::OF_DEPRECATED_MSG ( "Use the Deg/Rad version."  ,
void   rollfloat degrees 
)

◆ OF_DEPRECATED_MSG() [9/12]

ofNode::OF_DEPRECATED_MSG ( "Use the Deg/Rad version."  ,
void   rotatefloat degrees, const glm::vec3 &v 
)

◆ OF_DEPRECATED_MSG() [10/12]

ofNode::OF_DEPRECATED_MSG ( "Use the Deg/Rad version."  ,
void   rotatefloat degrees, float vx, float vy, float vz 
)

◆ OF_DEPRECATED_MSG() [11/12]

ofNode::OF_DEPRECATED_MSG ( "Use the Deg/Rad version."  ,
void   rotateAroundfloat degrees, const glm::vec3 &axis, const glm::vec3 &point 
)

◆ OF_DEPRECATED_MSG() [12/12]

ofNode::OF_DEPRECATED_MSG ( "Use the Deg/Rad version."  ,
void   tiltfloat degrees 
)

◆ onOrientationChanged()

virtual void ofNode::onOrientationChanged ( )
inlineprotectedvirtual

Classes extending ofNode can override this methods to get notified when the orientation changed.

◆ onPositionChanged()

virtual void ofNode::onPositionChanged ( )
inlineprotectedvirtual

Classes extending ofNode can override this method to get notified when the position changed.

Reimplemented in ofEasyCam.

◆ onScaleChanged()

virtual void ofNode::onScaleChanged ( )
inlineprotectedvirtual

Classes extending ofNode can override this methods to get notified when the scale changed.

◆ orbitDeg() [1/2]

void ofNode::orbitDeg ( float  longitude,
float  latitude,
float  radius,
const glm::vec3 &  centerPoint = glm::vec3(0, 0, 0) 
)

Orbit node around a global position at a specific radius.

Parameters
longitudeThe longitudinal position of the node in degrees as float.
latitudeThe latitudinal position of the node in degrees as float.
radiusThe desired radius from the position in degrees as float.
centerPointThe global position to orbit around as ref to 3D vector. Default = (0, 0, 0).

◆ orbitDeg() [2/2]

void ofNode::orbitDeg ( float  longitude,
float  latitude,
float  radius,
ofNode centerNode 
)

Orbit node around another node at a specific radius.

Parameters
longitudeThe longitudinal position of the node in degrees as float.
latitudeThe latitudinal position of the node in degrees as float.
radiusThe desired radius from the position in degrees as float.
centerNodeThe global position to orbit around as ref to 3D vector. Default = (0, 0, 0).

◆ orbitRad() [1/2]

void ofNode::orbitRad ( float  longitude,
float  latitude,
float  radius,
const glm::vec3 &  centerPoint = glm::vec3(0, 0, 0) 
)

Orbit node around a global position at a specific radius.

Parameters
longitudeThe longitudinal position of the node in radians as float.
latitudeThe latitudinal position of the node in radians as float.
radiusThe desired radius from the position in degrees as float.
centerPointThe global node to orbit around as ref to 3D vector. Default = (0, 0, 0).

◆ orbitRad() [2/2]

void ofNode::orbitRad ( float  longitude,
float  latitude,
float  radius,
ofNode centerNode 
)

Orbit node around another node at a specific radius.

Parameters
longitudeThe longitudinal position of the node in radians as float.
latitudeThe latitudinal position of the node in radians as float.
radiusThe desired radius from the position in degrees as float.
centerNodeThe global node to orbit around as ref to 3D vector. Default = (0, 0, 0).

◆ panDeg()

void ofNode::panDeg ( float  degrees)

Rotate left+right relative to current orientation (around local y axis).

Parameters
degreesDesired relative rotation change along local y axis in degrees as float.

◆ panRad()

void ofNode::panRad ( float  radians)

Rotate left+right relative to current orientation (around local y axis).

Parameters
radiansDesired relative rotation change along local y axis in radians as float.

◆ resetTransform()

void ofNode::resetTransform ( )

Reset this node's transformations, position, rotation and scale.

◆ restoreTransformGL()

void ofNode::restoreTransformGL ( ofBaseRenderer renderer = nullptr) const

Restore opengl renderer's previous modelview transform matrix.

Parameters
rendererA pointer to the renderer you want to restore transformation to.

◆ rollDeg()

void ofNode::rollDeg ( float  degrees)

Roll left+right relative to current orientation (around local z axis).

Parameters
degreesDesired relative rotation change along local z axis in degrees as float.

◆ rollRad()

void ofNode::rollRad ( float  radians)

Roll left+right relative to current orientation (around local z axis).

Parameters
radiansDesired relative rotation change along local z axis in radians as float.

◆ rotate()

void ofNode::rotate ( const glm::quat &  q)

Rotate relative to current orientation by quaternion.

Parameters
qDesired relative rotation change as a ref to quaternion.

◆ rotateAround()

void ofNode::rotateAround ( const glm::quat &  q,
const glm::vec3 &  point 
)

Rotate relative to current orientation by quaternion around point.

Parameters
qDesired relative rotation change as a ref to quaternion.
pointPoint to rotate around in local xyz coordinates as ref to 3D vector.

◆ rotateAroundDeg()

void ofNode::rotateAroundDeg ( float  degrees,
const glm::vec3 &  axis,
const glm::vec3 &  point 
)

Rotate relative to current orientation around arbitrary axis around point.

Parameters
degreesDesired relative angle change in degrees as float.
axisThe arbitrary axis to rotate around as ref to cartesian 3D vector.
pointPoint to rotate around in local xyz coordinates as ref to 3D vector.

◆ rotateAroundRad()

void ofNode::rotateAroundRad ( float  radians,
const glm::vec3 &  axis,
const glm::vec3 &  point 
)

Rotate relative to current orientation around arbitrary axis around point.

Parameters
radiansDesired relative angle change in degrees as float.
axisThe arbitrary axis to rotate around as ref to cartesian 3D vector.
pointPoint to rotate around in local xyz coordinates as ref to 3D vector.

◆ rotateDeg() [1/2]

void ofNode::rotateDeg ( float  degrees,
const glm::vec3 &  v 
)

Rotate relative to current orientation around arbitrary axis.

Parameters
degreesDesired relative angle change in degrees as float.
vDesired axis to rotate around as a ref to cartesian 3D Vector.

◆ rotateDeg() [2/2]

void ofNode::rotateDeg ( float  degrees,
float  vx,
float  vy,
float  vz 
)

Rotate relative to current orientation around arbitrary axis.

Parameters
degreesDesired relative angle change in degrees as float.
vxX angle of the axis to rotate around in degrees as float.
vyY angle of the axis to rotate around in degrees as float.
vzZ angle of the axis to rotate around in degrees as float.

◆ rotateRad() [1/2]

void ofNode::rotateRad ( float  radians,
const glm::vec3 &  v 
)

Rotate relative to current orientation around arbitrary axis.

Parameters
radiansDesired relative angle change in radians as float.
vDesired axis to rotate around as a ref to cartesian 3D Vector.

◆ rotateRad() [2/2]

void ofNode::rotateRad ( float  radians,
float  vx,
float  vy,
float  vz 
)

Rotate relative to current orientation around arbitrary axis.

Parameters
radiansDesired relative angle change in radians as float.
vxX angle of the axis to rotate around in radians as float.
vyY angle of the axis to rotate around in radians as float.
vzZ angle of the axis to rotate around in radians as float.

◆ setGlobalOrientation()

void ofNode::setGlobalOrientation ( const glm::quat &  q)

Set global orientation with a quaternion.

Parameters
qDesired global orientation as ref to an glm::quat.

◆ setGlobalPosition() [1/2]

void ofNode::setGlobalPosition ( const glm::vec3 &  p)

Set the global position of the node using a 3D vector of coordinates.

Parameters
pDesired global xyz coordinates as ref to 3D vector.

◆ setGlobalPosition() [2/2]

void ofNode::setGlobalPosition ( float  px,
float  py,
float  pz 
)

Set the global position of the node using xyz coordinates.

Parameters
pxDesired global x coordinate as a float.
pyDesired global y coordinate as a float.
pzDesired global z coordinate as a float.

◆ setOrientation() [1/2]

void ofNode::setOrientation ( const glm::quat &  q)

Set local orientation with a quaternion.

Parameters
qDesired local orientation as ref to an glm::quat.

◆ setOrientation() [2/2]

void ofNode::setOrientation ( const glm::vec3 &  eulerAngles)

Set local orientation with xyz euler angles.

Parameters
eulerAnglesDesired local xyz angles in degrees, as ref to 3D vector.
Note
Using euler angles can cause gimbal lock.
See also
https://en.wikipedia.org/wiki/Gimbal_lock

◆ setParent()

void ofNode::setParent ( ofNode parent,
bool  bMaintainGlobalTransform = false 
)

Set parent for the node. The node will inherit transformations from parent.

Parameters
parentReference to the ofNode which becomes the parent node.
bMaintainGlobalTransformBoolean if maintain child's global transformations (default = false).

◆ setPosition() [1/2]

void ofNode::setPosition ( const glm::vec3 &  p)

Set the local position of the node using a 3D vector of coordinates.

Parameters
pDesired local xyz coordinates as ref to 3D vector.

◆ setPosition() [2/2]

void ofNode::setPosition ( float  px,
float  py,
float  pz 
)

Set the local position of the node using xyz coordinates.

Parameters
pxDesired local x coordinate as a float.
pyDesired local y coordinate as a float.
pzDesired local z coordinate as a float.

◆ setScale() [1/3]

void ofNode::setScale ( const glm::vec3 &  s)

Set local scale for xyz axes individually with a 3D vector.

Parameters
sDesired local scale for all axes as ref to 3D vector where 1 = 100%.

◆ setScale() [2/3]

void ofNode::setScale ( float  s)

Set local uniform scale (x, y, and z are equally scaled).

Parameters
sDesired scale for all axes as a float where 1 = 100%.

◆ setScale() [3/3]

void ofNode::setScale ( float  sx,
float  sy,
float  sz 
)

Set local scale for xyz axes individually.

Parameters
sxDesired local scale for x axis as a float where 1 = 100%.
syDesired local scale for y axis as a float where 1 = 100%.
szDesired local scale for z axis as a float where 1 = 100%.

◆ tiltDeg()

void ofNode::tiltDeg ( float  degrees)

Tilt up+down relative to current orientation (around local x axis).

Parameters
degreesDesired relative rotation change along local x axis in degrees as float.

◆ tiltRad()

void ofNode::tiltRad ( float  radians)

Tilt up+down relative to current orientation (around local x axis).

Parameters
radiansDesired relative rotation change along local x axis in radians as float.

◆ transformGL()

void ofNode::transformGL ( ofBaseRenderer renderer = nullptr) const

Set opengl renderer's modelview matrix to this nodes transform.

Parameters
rendererA pointer to the renderer you want to set to this node's transform;
Note
If you want to draw something at the position+orientation+scale of this node, call ofNode::transform(); write your draw code, and ofNode::restoreTransform(); OR A simpler way is to extend ofNode and override ofNode::customDraw();

◆ truck()

void ofNode::truck ( float  amount)

Move node left+right relative to current position (in local x axis).

Parameters
amountDesired relative position change along local x axis as float.

◆ updateAxis()

void ofNode::updateAxis ( )
protected

Member Data Documentation

◆ parent

ofNode* ofNode::parent = nullptr
protected

The documentation for this class was generated from the following files:
  • /Users/icq4ever/Desktop/oF0120/libs/openFrameworks/3d/ofNode.h
  • /Users/icq4ever/Desktop/oF0120/libs/openFrameworks/3d/ofNode.cpp