HOG2
Public Member Functions | Public Attributes | List of all members
Cubie Class Reference

#include <RC.h>

Collaboration diagram for Cubie:
Collaboration graph
[legend]

Public Member Functions

void Initialize (int ind)
 
void Initialize (int RCpos, int RCind, int RCrot)
 
void Draw (Graphics::Display &display) const
 
void DrawFace (Graphics::Display &display, int index) const
 
void RotateRelative (const float angle[3])
 
void RotateBase (float angle[3])
 
void RotateFacePos (bool clockwise, int axis)
 
void ResetToBase ()
 
void ResetVisibleFace ()
 
void SetFacePositionVisible (bool toggle, int position)
 
void PrintData ()
 

Public Attributes

std::vector< Graphics::pointbasePoints
 
std::vector< std::vector< Graphics::point > > baseFacePoints
 
std::vector< Graphics::pointpoints
 
std::vector< std::vector< Graphics::point > > facePoints
 
rgbColor faceCols [6]
 
int index
 
int RCindex = -1
 
bool facesShown [6]
 
int blackFaceToReset = -1
 
int faceInPos [6] = {0,1,2,3,4,5}
 
const float sideLen = 0.2f
 
const float faceSize = 0.85f
 
const rgbColor outCol = rgbColor(0.f, 0.f, 0.f)
 
const rgbColor inCol = rgbColor(0.04f, 0.04f, 0.06f)
 
const std::vector< std::vector< float > > projection
 
const int pointsOnFace [6][4]
 
const rgbColor faceColors [6]
 
const int faceOrderByAxis [3][4]
 
const int facesShowing [20][3]
 

Detailed Description

Definition at line 26 of file RC.h.

Member Function Documentation

◆ Draw()

void Cubie::Draw ( Graphics::Display display) const

Definition at line 350 of file RC.cpp.

References DrawFace(), facesShown, furthestZ(), points, and pointsOnFace.

Referenced by RC::DrawCubies().

◆ DrawFace()

void Cubie::DrawFace ( Graphics::Display display,
int  index 
) const

Definition at line 417 of file RC.cpp.

Referenced by Draw().

◆ Initialize() [1/2]

void Cubie::Initialize ( int  ind)

◆ Initialize() [2/2]

void Cubie::Initialize ( int  RCpos,
int  RCind,
int  RCrot 
)

◆ PrintData()

void Cubie::PrintData ( )

Definition at line 557 of file RC.cpp.

References baseFacePoints, blackFaceToReset, faceInPos, facePoints, facesShown, index, and points.

◆ ResetToBase()

void Cubie::ResetToBase ( )

Definition at line 514 of file RC.cpp.

References baseFacePoints, basePoints, facePoints, and points.

Referenced by RC::Draw(), RC::InterpFaceRot(), and RC::RotateCubies().

◆ ResetVisibleFace()

void Cubie::ResetVisibleFace ( )

Definition at line 536 of file RC.cpp.

References blackFaceToReset, faceInPos, and facesShown.

Referenced by RC::TestUpdate().

◆ RotateBase()

void Cubie::RotateBase ( float  angle[3])

◆ RotateFacePos()

void Cubie::RotateFacePos ( bool  clockwise,
int  axis 
)

Definition at line 489 of file RC.cpp.

References faceInPos, and faceOrderByAxis.

Referenced by RC::RotateFace().

◆ RotateRelative()

void Cubie::RotateRelative ( const float  angle[3])

◆ SetFacePositionVisible()

void Cubie::SetFacePositionVisible ( bool  toggle,
int  position 
)

Definition at line 548 of file RC.cpp.

References blackFaceToReset, faceInPos, and facesShown.

Referenced by RC::RotateFace().

Member Data Documentation

◆ baseFacePoints

std::vector<std::vector<Graphics::point> > Cubie::baseFacePoints

Definition at line 31 of file RC.h.

Referenced by Initialize(), PrintData(), ResetToBase(), and RotateBase().

◆ basePoints

std::vector<Graphics::point> Cubie::basePoints

Definition at line 30 of file RC.h.

Referenced by Initialize(), ResetToBase(), and RotateBase().

◆ blackFaceToReset

int Cubie::blackFaceToReset = -1

Definition at line 38 of file RC.h.

Referenced by PrintData(), ResetVisibleFace(), and SetFacePositionVisible().

◆ faceColors

const rgbColor Cubie::faceColors[6]
Initial value:
=
{
rgbColor(255.f, 255.f, 255.f),
rgbColor(0.f, 0.f, 255.f),
rgbColor(255.f, 0.f, 0.f),
rgbColor(0.f, 255.f, 0.f),
}

Definition at line 60 of file RC.h.

Referenced by Initialize().

◆ faceCols

rgbColor Cubie::faceCols[6]

Definition at line 34 of file RC.h.

Referenced by Initialize().

◆ faceInPos

int Cubie::faceInPos[6] = {0,1,2,3,4,5}

Definition at line 39 of file RC.h.

Referenced by PrintData(), ResetVisibleFace(), RotateFacePos(), and SetFacePositionVisible().

◆ faceOrderByAxis

const int Cubie::faceOrderByAxis[3][4]
Initial value:
=
{
{0,1,5,3},
{1,2,3,4},
{0,4,5,2}
}

Definition at line 69 of file RC.h.

Referenced by RotateFacePos().

◆ facePoints

std::vector<std::vector<Graphics::point> > Cubie::facePoints

Definition at line 33 of file RC.h.

Referenced by Initialize(), PrintData(), ResetToBase(), and RotateRelative().

◆ faceSize

const float Cubie::faceSize = 0.85f

Definition at line 43 of file RC.h.

Referenced by Initialize().

◆ facesShowing

const int Cubie::facesShowing[20][3]

Definition at line 75 of file RC.h.

Referenced by Initialize().

◆ facesShown

bool Cubie::facesShown[6]

Definition at line 37 of file RC.h.

Referenced by Draw(), Initialize(), PrintData(), ResetVisibleFace(), and SetFacePositionVisible().

◆ inCol

const rgbColor Cubie::inCol = rgbColor(0.04f, 0.04f, 0.06f)

Definition at line 45 of file RC.h.

Referenced by Initialize().

◆ index

int Cubie::index

Definition at line 35 of file RC.h.

Referenced by Initialize(), and PrintData().

◆ outCol

const rgbColor Cubie::outCol = rgbColor(0.f, 0.f, 0.f)

Definition at line 44 of file RC.h.

◆ points

std::vector<Graphics::point> Cubie::points

Definition at line 32 of file RC.h.

Referenced by Draw(), Initialize(), RC::InterpFaceRot(), PrintData(), ResetToBase(), and RotateRelative().

◆ pointsOnFace

const int Cubie::pointsOnFace[6][4]
Initial value:
=
{
{0, 1, 5, 4},
{0, 1, 2, 3},
{3, 0, 4, 7},
{4, 5, 6, 7},
{1, 2, 6, 5},
{2, 3, 7, 6}
}

Definition at line 51 of file RC.h.

Referenced by Draw(), and Initialize().

◆ projection

const std::vector<std::vector<float> > Cubie::projection
Initial value:
=
{
{1, 0, 0},
{0, 1, 0}
}

Definition at line 46 of file RC.h.

◆ RCindex

int Cubie::RCindex = -1

Definition at line 36 of file RC.h.

Referenced by Initialize().

◆ sideLen

const float Cubie::sideLen = 0.2f

Definition at line 42 of file RC.h.

Referenced by Initialize().


The documentation for this class was generated from the following files:
rgbColor
A color; r/g/b are between 0...1.
Definition: Colors.h:17
Colors::orange
const rgbColor orange
Definition: Colors.h:155
Colors::yellow
const rgbColor yellow
Definition: Colors.h:148