Botcraft 1.21.4
Loading...
Searching...
No Matches
Botcraft::Renderer Namespace Reference

Classes

class  Atlas
 
class  BehaviourRenderer
 
class  BlockRenderable
 
class  Camera
 
class  Chunk
 
class  Entity
 
class  Face
 
struct  FaceTransformation
 
struct  IMatrix
 
struct  ImNode
 A class to hold data to be drawn on ImNode context. More...
 
class  RenderingManager
 
class  Rotation
 
class  Scale
 
class  Shader
 
struct  Texture
 
struct  TextureData
 
class  Transformation
 
class  Translation
 
class  TransparentChunk
 
struct  TreePosNode
 
class  WorldRenderer
 

Typedefs

typedef std::shared_ptr< TransformationTransformationPtr
 
typedef std::shared_ptr< ScaleScalePtr
 

Enumerations

enum class  Transparency { Opaque , Total , Partial }
 Transparency values for textures. More...
 
enum class  Animation { Static , Animated }
 Animation status of a texture. More...
 
enum class  KEY_CODE {
  FORWARD = 0 , BACKWARD , RIGHT , LEFT ,
  SPACE , SHIFT , CTRL , ESC ,
  MOUSE_LEFT , INVENTORY , BEHAVIOUR , NUMBER_OF_KEYS
}
 
enum class  BufferStatus { Created , Updated , UpToDate }
 
enum class  FrustumResult { Outside = 0 , Intersect , Inside }
 
enum class  ImNodeStatus { Idle , Success , Failure , Running }
 

Functions

void WriteImage (const std::string &path, const int height, const int width, const int depth, const unsigned char *data, const bool vertical_revert=true)
 
std::vector< std::unique_ptr< ImNode > > UnrollTreeStructure (const BaseNode *node, const int index=1)
 Convert a tree to a vector of ImNode with proper data.
 
void PlaceNodesBuchheim (ImNode *root)
 Apply Buchheim & al.
 
void FirstWalk (TreePosNode *v)
 
void SecondWalk (TreePosNode *v, const float m=0.0f)
 
TreePosNodeApportion (TreePosNode *v, TreePosNode *default_ancestor)
 
TreePosNodeAncestor (TreePosNode *vim, TreePosNode *v, TreePosNode *default_ancestor)
 
void ExecuteShifts (TreePosNode *v)
 
void MoveSubtree (TreePosNode *wm, TreePosNode *wp, const float shift)
 
void GetMaxWidthPerDepthLevel (TreePosNode *node, std::vector< float > &max_width_depth)
 
void SetRealNodePos (TreePosNode *node, std::vector< float > &max_width_depth)
 
ImColor GetNodeColor (const BehaviourNodeType type)
 
ImColor GetStatusColor (const ImNodeStatus s)
 
void ToggleNodeVisibility (ImNode *node, const bool b)
 
ImVec4 ColorInterpolation (const ImVec4 &a, const ImVec4 &b, const float t)
 
void RecursiveRenderBlackboardJsonNode (const std::string &name, ProtocolCraft::Json::Value &node)
 
void RecursiveUpdateTimerBlackboardJsonNode (ProtocolCraft::Json::Value &node)
 
const float Distance (const Face &f, const glm::vec3 &pos)
 

Typedef Documentation

◆ ScalePtr

typedef std::shared_ptr<Scale> Botcraft::Renderer::ScalePtr

Definition at line 61 of file Transformation.hpp.

◆ TransformationPtr

Definition at line 60 of file Transformation.hpp.

Enumeration Type Documentation

◆ Animation

enum class Botcraft::Renderer::Animation
strong

Animation status of a texture.

Enumerator
Static 
Animated 

Definition at line 16 of file Enums.hpp.

◆ BufferStatus

Enumerator
Created 
Updated 
UpToDate 

Definition at line 13 of file BlockRenderable.hpp.

◆ FrustumResult

Enumerator
Outside 
Intersect 
Inside 

Definition at line 31 of file WorldRenderer.hpp.

◆ ImNodeStatus

Enumerator
Idle 
Success 
Failure 
Running 

Definition at line 23 of file BehaviourRenderer.cpp.

◆ KEY_CODE

enum class Botcraft::Renderer::KEY_CODE
strong
Enumerator
FORWARD 
BACKWARD 
RIGHT 
LEFT 
SPACE 
SHIFT 
CTRL 
ESC 
MOUSE_LEFT 
INVENTORY 
BEHAVIOUR 
NUMBER_OF_KEYS 

Definition at line 34 of file RenderingManager.hpp.

◆ Transparency

Transparency values for textures.

Enumerator
Opaque 
Total 
Partial 

Definition at line 8 of file Enums.hpp.

Function Documentation

◆ Ancestor()

TreePosNode * Botcraft::Renderer::Ancestor ( TreePosNode vim,
TreePosNode v,
TreePosNode default_ancestor 
)

◆ Apportion()

◆ ColorInterpolation()

ImVec4 Botcraft::Renderer::ColorInterpolation ( const ImVec4 &  a,
const ImVec4 &  b,
const float  t 
)

Definition at line 269 of file BehaviourRenderer.cpp.

Referenced by RecursiveRenderBlackboardJsonNode().

◆ Distance()

const float Botcraft::Renderer::Distance ( const Face f,
const glm::vec3 &  pos 
)

Definition at line 14 of file TransparentChunk.cpp.

References Botcraft::Renderer::Face::GetMatrix().

◆ ExecuteShifts()

◆ FirstWalk()

◆ GetMaxWidthPerDepthLevel()

void Botcraft::Renderer::GetMaxWidthPerDepthLevel ( TreePosNode node,
std::vector< float > &  max_width_depth 
)

◆ GetNodeColor()

ImColor Botcraft::Renderer::GetNodeColor ( const BehaviourNodeType  type)

◆ GetStatusColor()

ImColor Botcraft::Renderer::GetStatusColor ( const ImNodeStatus  s)

◆ MoveSubtree()

◆ PlaceNodesBuchheim()

void Botcraft::Renderer::PlaceNodesBuchheim ( ImNode root)

Apply Buchheim & al.

algorithm to position all nodes in the tree (position is directly set inside the nodes) Christoph Buchheim, Michael Jünger, and Sebastian Leipert, "Improving Walker’s algorithm to run in linear time", 2002

Definition at line 759 of file BehaviourRenderer.cpp.

References FirstWalk(), GetMaxWidthPerDepthLevel(), Botcraft::Renderer::TreePosNode::prelim, SecondWalk(), and SetRealNodePos().

Referenced by Botcraft::Renderer::BehaviourRenderer::RenderNodes().

◆ RecursiveRenderBlackboardJsonNode()

◆ RecursiveUpdateTimerBlackboardJsonNode()

◆ SecondWalk()

void Botcraft::Renderer::SecondWalk ( TreePosNode v,
const float  m = 0.0f 
)

◆ SetRealNodePos()

◆ ToggleNodeVisibility()

void Botcraft::Renderer::ToggleNodeVisibility ( ImNode node,
const bool  b 
)

◆ UnrollTreeStructure()

std::vector< std::unique_ptr< ImNode > > Botcraft::Renderer::UnrollTreeStructure ( const BaseNode node,
const int  index = 1 
)

Convert a tree to a vector of ImNode with proper data.

Parameters
nodeRoot node of the tree
indexIndex to give to the next node/pin
Returns
A vector of all the nodes

Definition at line 617 of file BehaviourRenderer.cpp.

References Botcraft::BaseNode::GetChild(), Botcraft::BaseNode::GetClassName(), Botcraft::BaseNode::GetName(), Botcraft::BaseNode::GetNodeType(), Botcraft::BaseNode::GetNumChildren(), and UnrollTreeStructure().

Referenced by Botcraft::Renderer::BehaviourRenderer::SetCurrentBehaviourTree(), and UnrollTreeStructure().

◆ WriteImage()

void Botcraft::Renderer::WriteImage ( const std::string &  path,
const int  height,
const int  width,
const int  depth,
const unsigned char *  data,
const bool  vertical_revert = true 
)

Definition at line 13 of file ImageSaver.cpp.

Referenced by Botcraft::Renderer::RenderingManager::Run().