![]() |
Kale
|
#include <PathNodeGL.hpp>
Classes | |
struct | BezierWeights |
Public Types | |
enum class | StrokeStyle { Neither = 0 , Both = 1 , Inside = 2 , Outside = 3 } |
Public Member Functions | |
PathNode () | |
PathNode (const JSON &json) | |
PathNode (const Path &path, bool fill=true, StrokeStyle stroke=StrokeStyle::Neither) | |
![]() | |
Transform | getFullTransform () const |
![]() | |
Rect | getBoundingBox () const |
Public Attributes | |
std::optional< StateAnimatable< Path > > | pathFSM |
std::shared_ptr< SkeletalAnimatable > | skeletalAnimatable |
std::optional< std::vector< BezierWeights > > | skeletalWeights |
std::optional< Path > | basePath |
float | zPosition = 1.0f |
bool | fill = true |
StrokeStyle | stroke = StrokeStyle::Neither |
float | strokeRadius = 20.0f |
Color | color = Color(0x333333) |
Color | strokeColor = Color(0x555555) |
![]() | |
std::string | name |
const float | updateTime = 100.0f |
const float | preUpdateTime = 100.0f |
![]() | |
std::optional< StateAnimatable< Transform > > | transformFSM |
Transform | transform |
Protected Member Functions | |
virtual void | begin (const Scene &scene) override |
virtual void | preUpdate (size_t threadNum, const Scene &scene, float deltaTime) override |
virtual void | render (const Camera &camera, float deltaTime) const override |
virtual void | end (const Scene &scene) override |
virtual void | begin (const Scene &scene) override |
virtual void | render (const Camera &camera, float deltaTime) const override |
virtual void | end (const Scene &scene) override |
![]() | |
virtual void | update (size_t threadNum, const Scene &scene, float deltaTime) |
Node () | |
Node (float preUpdateTime, float updateTime) | |
![]() | |
void | updateTransform (float deltaTime) |
Private Member Functions | |
void | updateBoundingBox () |
Static Private Member Functions | |
static void | setup () |
static void | cleanup () |
Private Attributes | |
std::unique_ptr< OpenGL::VertexArray< Vector2f, 2 > > | vertexArray |
Path | path |
Friends | |
class | Application |
Additional Inherited Members | |
![]() | |
std::optional< std::mutex > | mutex |
![]() | |
std::optional< Transform > | stateTransform |
![]() | |
Rect | boundingBox |
Used for rendering filled bezier paths
Used for rendering filled bezier paths
An | enum class containing all the animation states |
Definition at line 50 of file PathNodeGL.hpp.
|
strong |
Styles of rendering strokes on a path
Enumerator | |
---|---|
Neither | |
Both | |
Inside | |
Outside |
Definition at line 57 of file PathNodeGL.hpp.
Creates a blank pathnode with nothing to render
Definition at line 203 of file PathNodeGL.cpp.
Creates a path node based on the json saved values
json | The json saved values |
Definition at line 211 of file PathNodeGL.cpp.
PathNode::PathNode | ( | const Path & | path, |
bool | fill = true, | ||
StrokeStyle | stroke = StrokeStyle::Neither ) |
Creates a path node given the path to use
path | The path to use |
fill | Whether or not to fill the node |
stroke | Whether or not to stroke the node |
Definition at line 237 of file PathNodeGL.cpp.
Called when the node is added to the scene, guaranteed to be called before any updates & renders and from the main thread.
scene | The scene the node has been added to |
Reimplemented from Kale::Node.
Definition at line 97 of file PathNodeGL.cpp.
Called when the node is added to the scene, guaranteed to be called before any updates & renders and from the main thread.
scene | The scene the node has been added to |
Reimplemented from Kale::Node.
Definition at line 40 of file PathNodeVK.hpp.
Deletes shaders/cleans up
Definition at line 64 of file PathNodeGL.cpp.
Called when the node is removed from the scene, guaranteed to be called from the main thread
Reimplemented from Kale::Node.
Definition at line 196 of file PathNodeGL.cpp.
Called when the node is removed from the scene, guaranteed to be called from the main thread
Reimplemented from Kale::Node.
Definition at line 55 of file PathNodeVK.hpp.
|
overrideprotectedvirtual |
Called prior to update, perfect place to do things such as updating the bounding box, etc
threadNum | the index of the thread this update is called on |
scene | The scene being updated to |
deltaTime | The duration of the last frame in microseconds |
Reimplemented from Kale::Node.
Definition at line 125 of file PathNodeGL.cpp.
Renders the node
camera | The camera to render with |
Reimplemented from Kale::Node.
Definition at line 171 of file PathNodeGL.cpp.
|
inlineoverrideprotectedvirtual |
Renders the node
camera | The camera to render with |
Reimplemented from Kale::Node.
Definition at line 48 of file PathNodeVK.hpp.
Creates and compiles shaders
Creates and compiles shaders if not already compiled/created
Definition at line 31 of file PathNodeGL.cpp.
Updates the bounding box accounting for stroke
Definition at line 71 of file PathNodeGL.cpp.
|
friend |
Definition at line 130 of file PathNodeGL.hpp.
std::optional<Path> Kale::PathNode< T >::basePath |
An optional path to be used for skeletal rigging. If a skeletal rig is provided, then this base path must be the path where all vertices are aligned with the skeleton's base form
Definition at line 183 of file PathNodeGL.hpp.
Definition at line 108 of file PathNodeGL.hpp.
The location of the uniform within the shader for rendering this node
Definition at line 107 of file PathNodeGL.hpp.
Color Kale::PathNode< T >::color = Color(0x333333) |
The color of this path node
Definition at line 209 of file PathNodeGL.hpp.
Whether or not to fill the path when rendering
Definition at line 194 of file PathNodeGL.hpp.
Definition at line 108 of file PathNodeGL.hpp.
Definition at line 107 of file PathNodeGL.hpp.
Definition at line 108 of file PathNodeGL.hpp.
|
private |
The path being rendered
Definition at line 97 of file PathNodeGL.hpp.
std::optional<StateAnimatable<Path> > Kale::PathNode< T >::pathFSM |
The FSM used for path states. Path nodes support FSM based animations, to use the FSM simply set the value of this optional and fill the map. Access to the FSM must be externally synchronized if done from multiple threads.
Definition at line 166 of file PathNodeGL.hpp.
The location of the attribute within the shader for rendering this node
Definition at line 113 of file PathNodeGL.hpp.
|
inlinestaticprivate |
The shader used for rendering
Definition at line 102 of file PathNodeGL.hpp.
std::shared_ptr<SkeletalAnimatable> Kale::PathNode< T >::skeletalAnimatable |
A skeletal animatable to use for animating this path node. Both pathFSM and skeletalAnimatable cannot be set at the same time.
Definition at line 171 of file PathNodeGL.hpp.
std::optional<std::vector<BezierWeights> > Kale::PathNode< T >::skeletalWeights |
A vector of the skeletal weights for skeletal animations. This must be the same length as the number of beziers in the path, and it must be set if skeletalAnimatable isn't nullptr.
Definition at line 177 of file PathNodeGL.hpp.
StrokeStyle Kale::PathNode< T >::stroke = StrokeStyle::Neither |
Whether or not to stroke the path when rendering
Definition at line 199 of file PathNodeGL.hpp.
The color to stroke this path node with
Definition at line 214 of file PathNodeGL.hpp.
Definition at line 108 of file PathNodeGL.hpp.
float Kale::PathNode< T >::strokeRadius = 20.0f |
The radius of the stroke if stroke is true
Definition at line 204 of file PathNodeGL.hpp.
Definition at line 108 of file PathNodeGL.hpp.
Definition at line 108 of file PathNodeGL.hpp.
|
private |
The vertex array used for rendering
Definition at line 92 of file PathNodeGL.hpp.
Definition at line 107 of file PathNodeGL.hpp.
float Kale::PathNode< T >::zPosition = 1.0f |
The z position of this node, setting this allows for rendering in front of or behind other nodes.
Definition at line 188 of file PathNodeGL.hpp.
Definition at line 107 of file PathNodeGL.hpp.