Class ProxyScene#
Defined in File ProxyScene.h
Inheritance Relationships#
Base Type#
public Karana::Scene::Scene(Class Scene)
Class Documentation#
-
class ProxyScene : public Karana::Scene::Scene#
A Scene implementation acting as a proxy to any number of registered ‘client’ Scenes.
Public Functions
-
ProxyScene(std::string_view name, const kc::ks_ptr<kf::Frame> &root_frame)#
ProxyScene constructor.
- Parameters:
name – - Name of the ProxyScene.
root_frame – - Default Frame to attach nodes to.
-
~ProxyScene()#
-
void update()#
Update all Frame-attached nodes’ transforms for all clients.
-
void update(Scene &scene)#
Update all Frame-attached nodes’s transforms for a client.
- Parameters:
scene – - The client Scene to update
-
void registerClientScene(const kc::ks_ptr<Scene> &scene, const kc::ks_ptr<kf::Frame> &origin_frame, layer_t layers = LAYER_ALL)#
Register a client Scene to be managed.
- Parameters:
scene – - The client Scene
origin_frame – - The Frame to center the client’s origin at
layers – - Bitmask for objects to implement
-
void unregisterClientScene(Scene &scene)#
Unregister a client Scene to no longer be managed.
- Parameters:
scene – - The client Scene.
-
kc::ks_ptr<Karana::Scene::GraphicalScene> graphics() const#
Get a registered GraphicalScene.
If there is more than one only the first one found is returned.
- Returns:
A GraphicalScene or nullptr
-
kc::ks_ptr<Karana::Scene::CollisionScene> collision() const#
Get a registered CollisionScene.
If there is more than one only the first one found is returned.
- Returns:
A CollisionScene or nullptr
-
const kc::ks_ptr<ProxySceneNode> &lookupProxyFromImpl(const SceneNode &impl)#
Lookup the ProxySceneNode managing the given implementation.
- Parameters:
- Returns:
The corresponding ProxySceneNode
-
const kc::ks_ptr<kf::Frame> &originFrame(const Scene &client_scene)#
Get the Frame the client’s origin is centered at.
-
std::vector<kc::ks_ptr<ProxySceneNode>> getNodesAttachedToFrame(const kc::ks_ptr<kf::Frame> &frame)#
Retrieve all ProxySceneNodes attached to the provided frame.
- Parameters:
frame – - The frame to retrieve nodes from.
- Returns:
- A vector of ProxySceneNodes attached to the provided frame.
-
void showAxes(kc::ks_ptr<kf::Frame> frm, float size = 1)#
Show the axes for a Frame.
- Parameters:
frm – the Frame to show axes for
size – the size of the axes
Public Members
-
kc::CallbackRegistry<void> update_callbacks#
Registry for callbacks that run during the scene update.
These callbacks will run after the nodes are updated.
Public Static Functions
-
static kc::ks_ptr<ProxyScene> create(std::string_view name, const kc::ks_ptr<kf::Frame> &root_frame)#
Create a ProxyScene.
- Parameters:
name – - Name of the ProxyScene.
root_frame – - Default Frame to attach nodes to.
- Returns:
The created ProxyScene
Protected Functions
-
virtual void _discard(kc::ks_ptr<Base> &b) override#
This does the work to discard the ProxyScene.
- Parameters:
b – - A pointer to the ProxyScene to discard.
-
ProxyScene(std::string_view name, const kc::ks_ptr<kf::Frame> &root_frame)#