![]() |
Kale
|
#include <Node.hpp>
Public Attributes | |
std::string | name |
const float | updateTime = 100.0f |
const float | preUpdateTime = 100.0f |
Protected Member Functions | |
virtual void | begin (const Scene &scene) |
virtual void | render (const Camera &camera, float deltaTime) const |
virtual void | update (size_t threadNum, const Scene &scene, float deltaTime) |
virtual void | preUpdate (size_t threadNum, const Scene &scene, float deltaTime) |
virtual void | end (const Scene &scene) |
Node () | |
Node (float preUpdateTime, float updateTime) | |
Protected Attributes | |
std::optional< std::mutex > | mutex |
Friends | |
class | Scene |
The main class for nodes, all nodes must inherit from this class
|
protected |
Creates the node parent
preUpdateTime | The average pre update time, please see Node::preUpdateTime for documentation |
updateTime | The average update time, please see Node::updateTime for documentation |
|
protectedvirtual |
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 in Kale::PathNode< T >, and Kale::PathNode< T >.
|
protectedvirtual |
Called when the node is removed from the scene, guaranteed to be called from the main thread
Reimplemented in Kale::PathNode< T >, and Kale::PathNode< T >.
|
protectedvirtual |
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 in Kale::PathNode< T >, and Kale::SkeletalAnimatable.
|
protectedvirtual |
Renders the node
camera | The camera to render with |
Reimplemented in Kale::PathNode< T >, and Kale::PathNode< T >.
|
protectedvirtual |
Called on update, perfect place to do any physics updating, game logic, 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 in Kale::SkeletalAnimatable.
|
protected |
std::string Kale::Node::name |
const float Kale::Node::preUpdateTime = 100.0f |
const float Kale::Node::updateTime = 100.0f |
The amount of time (in microseconds) this node takes to update on average
You can gain this statistic using the Kale Editor calibration tools. This measure is device specific, when developing on multiple devices it is recommended that you use a low powered device for calibration, the same device must be used for calibrating all nodes to avoid potential bias