SmallChange  1.0.0
A collection of extensions to Coin3D
Loading...
Searching...
No Matches
Coinboard Class Reference

The Coinboard class is a shape node which faces geometry towards the camera. More...

#include <Coinboard.h>

Inheritance diagram for Coinboard:
SoShape

Public Types

enum  ShapeType { TRIANGLES , QUADS , TRIANGLE_STRIP , TRIANGLE_FAN }
 

Public Member Functions

 Coinboard (void)
 
virtual void getPrimitiveCount (SoGetPrimitiveCountAction *action)
 
virtual void GLRender (SoGLRenderAction *action)
 

Static Public Member Functions

static void initClass (void)
 

Public Attributes

SoSFVec3f axisOfRotation
 
SoMFVec3f coord
 
SoSFInt32 frontAxis
 
SoSFVec3f normal
 
SoMFInt32 numVertices
 
SoMFVec3f position
 
SoSFEnum shapeType
 
SoMFVec4f texCoord
 

Protected Member Functions

virtual ~Coinboard ()
 
virtual void computeBBox (SoAction *action, SbBox3f &box, SbVec3f &center)
 
virtual void generatePrimitives (SoAction *action)
 

Detailed Description

The Coinboard class is a shape node which faces geometry towards the camera.

If the position field contains more than one value, the shape is rendered several times with a translation as specified in position. This makes it possible to have multiple equal billboards at different positions. Very useful for rendering particles or a forest of trees etc.

When picking, each triangle in each billboard will have an SoFaceDetail. The face index will (for now) always be 0, while the part index will the position index used for the billboard.

Member Enumeration Documentation

◆ ShapeType

The type of shape in the coord field.

Enumerator
TRIANGLES 

Draw triangles (GL_TRIANGLES).

QUADS 

Draw quads (GL_QUADS).

TRIANGLE_FAN 

Draw triangle fan (GL_TRIANGLE_FAN).

Constructor & Destructor Documentation

◆ Coinboard()

Coinboard::Coinboard ( void )

Constructor.

◆ ~Coinboard()

Coinboard::~Coinboard ( )
protectedvirtual

Destructor.

Member Function Documentation

◆ computeBBox()

void Coinboard::computeBBox ( SoAction * action,
SbBox3f & box,
SbVec3f & center )
protectedvirtual

This is a Coin method. It calculates the bounding box of the front facing shapes.

◆ generatePrimitives()

void Coinboard::generatePrimitives ( SoAction * action)
protectedvirtual

This is a Coin method. It should generate primitives, but is currently not implemented.

◆ getPrimitiveCount()

void Coinboard::getPrimitiveCount ( SoGetPrimitiveCountAction * action)
virtual

This is a Coin method. It should return the number of primitives, float maxval = coords[0][0]; but is currently not implemented.

◆ GLRender()

void Coinboard::GLRender ( SoGLRenderAction * action)
virtual

This is a Coin method. It renders all shapes facing the camera.

◆ initClass()

void Coinboard::initClass ( void )
static

Required Coin method.

Member Data Documentation

◆ axisOfRotation

SoSFVec3f Coinboard::axisOfRotation

Use this to lock rotation around one axis. Default is [0,1,0]. Set to [0,0,0] to rotate freely.

◆ coord

SoMFVec3f Coinboard::coord

The coordinates that will be sent to GL.

◆ frontAxis

SoSFInt32 Coinboard::frontAxis

The axis which should be directed towards the camera. This can be either 0 (positive x-axis), 1 (positive y-axis) or 2 (positive z-axis).

◆ normal

SoSFVec3f Coinboard::normal

The normal per vertex. Will be used when you have as many normals as normal coordinates.

◆ numVertices

SoMFInt32 Coinboard::numVertices

To draw several shapes per position, supply the number of vertices for each shape here. The default is one value with -1, which means all coordinates should be used for the one shape specified by the coords field.

◆ position

SoMFVec3f Coinboard::position

The positions where shapes should be replicated. Default is [0,0,0].

◆ shapeType

SoSFEnum Coinboard::shapeType

Shape type. Default value is TRIANGLES.

◆ texCoord

SoMFVec4f Coinboard::texCoord

The texture coordinates per vertex. Will be used when you have as many texture coordinates as normal coordinates.


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