Gin
Loading...
Searching...
No Matches
Public Member Functions | List of all members
Object3D Class Reference

A 3D object that contains a collection of points and line segments with a transform. More...

#include <gin_scene3d.h>

Public Member Functions

 Object3D ()=default
 
void clear ()
 Clears all points and line segments.
 
void addPoint (const Point3D &point)
 Adds a point.
 
void addPoint (const Vec3f &position, float size=1.0f, juce::Colour colour=juce::Colours::white)
 
void addLine (const LineSegment3D &line)
 Adds a line segment.
 
void addLine (const Vec3f &start, const Vec3f &end, juce::Colour colour=juce::Colours::white)
 
void addTriangle (const Vec3f &a, const Vec3f &b, const Vec3f &c, juce::Colour colour=juce::Colours::white)
 Adds multiple lines forming a triangle (wireframe).
 
void addBox (const Vec3f &min, const Vec3f &max, juce::Colour colour=juce::Colours::white)
 Adds multiple lines forming a box (wireframe).
 
void addGrid (float size, int divisions, juce::Colour colour=juce::Colours::grey)
 Adds lines forming a grid on the XZ plane.
 
void addAxes (float length, float thickness=1.0f)
 Adds coordinate axis lines.
 
void setTransform (const Mat4f &t)
 Sets the object's transform matrix.
 
const Mat4fgetTransform () const
 Gets the object's transform matrix.
 
void setPosition (const Vec3f &pos)
 Sets the object's position.
 
Vec3f getPosition () const
 Gets the object's position.
 
const std::vector< Point3D > & getPoints () const
 Gets all points.
 
size_t getNumPoints () const
 Gets the number of points.
 
const std::vector< LineSegment3D > & getLines () const
 Gets all line segments.
 
size_t getNumLines () const
 Gets the number of line segments.
 
void setColour (juce::Colour c)
 Sets the default colour for new lines.
 
void setVisible (bool v)
 Visibility.
 
bool isVisible () const
 

Detailed Description

A 3D object that contains a collection of points and line segments with a transform.

Constructor & Destructor Documentation

◆ Object3D()

Object3D::Object3D ( )
default

Member Function Documentation

◆ clear()

void Object3D::clear ( )

Clears all points and line segments.

◆ addPoint() [1/2]

void Object3D::addPoint ( const Point3D point)

Adds a point.

◆ addPoint() [2/2]

void Object3D::addPoint ( const Vec3f position,
float  size = 1.0f,
juce::Colour  colour = juce::Colours::white 
)

◆ addLine() [1/2]

void Object3D::addLine ( const LineSegment3D line)

Adds a line segment.

Referenced by addAxes(), addBox(), addGrid(), and addTriangle().

◆ addLine() [2/2]

void Object3D::addLine ( const Vec3f start,
const Vec3f end,
juce::Colour  colour = juce::Colours::white 
)

◆ addTriangle()

void Object3D::addTriangle ( const Vec3f a,
const Vec3f b,
const Vec3f c,
juce::Colour  colour = juce::Colours::white 
)

Adds multiple lines forming a triangle (wireframe).

References addLine().

◆ addBox()

void Object3D::addBox ( const Vec3f min,
const Vec3f max,
juce::Colour  colour = juce::Colours::white 
)

Adds multiple lines forming a box (wireframe).

References addLine(), Point< T >::x, and Point< T >::y.

◆ addGrid()

void Object3D::addGrid ( float  size,
int  divisions,
juce::Colour  colour = juce::Colours::grey 
)

Adds lines forming a grid on the XZ plane.

References addLine().

◆ addAxes()

void Object3D::addAxes ( float  length,
float  thickness = 1.0f 
)

Adds coordinate axis lines.

References addLine().

◆ setTransform()

void Object3D::setTransform ( const Mat4f t)

Sets the object's transform matrix.

◆ getTransform()

const Mat4f & Object3D::getTransform ( ) const

Gets the object's transform matrix.

◆ setPosition()

void Object3D::setPosition ( const Vec3f pos)

Sets the object's position.

References Mat4< T >::m, Vec3< T >::x, Vec3< T >::y, and Vec3< T >::z.

◆ getPosition()

Vec3f Object3D::getPosition ( ) const

Gets the object's position.

References Mat4< T >::m.

◆ getPoints()

const std::vector< Point3D > & Object3D::getPoints ( ) const

Gets all points.

◆ getNumPoints()

size_t Object3D::getNumPoints ( ) const

Gets the number of points.

◆ getLines()

const std::vector< LineSegment3D > & Object3D::getLines ( ) const

Gets all line segments.

◆ getNumLines()

size_t Object3D::getNumLines ( ) const

Gets the number of line segments.

◆ setColour()

void Object3D::setColour ( juce::Colour  c)

Sets the default colour for new lines.

◆ setVisible()

void Object3D::setVisible ( bool  v)

Visibility.

◆ isVisible()

bool Object3D::isVisible ( ) const

The documentation for this class was generated from the following file: