Class ProxyScenePart#
Defined in File ProxyScenePart.h
Inheritance Relationships#
Base Types#
public Karana::Scene::ScenePart(Class ScenePart)public Karana::Scene::ProxySceneNode(Class ProxySceneNode)
Class Documentation#
-
class ProxyScenePart : public Karana::Scene::ScenePart, public Karana::Scene::ProxySceneNode#
ScenePart acting as a proxy for client SceneParts.
See Scene layer for more discussion on the scene layer.
Public Functions
-
ProxyScenePart(std::string_view name, const VarStaticGeometry &geometry, const VarMaterial &material, layer_t layers, const Karana::Core::ks_ptr<ClientRegistry> &client_registry, const Karana::Core::ks_ptr<ImplDatabase> &impl_database, const kc::ks_ptr<ProxyScene> &scene)#
ProxyScenePart constructor.
- Parameters:
name – - Name of the ProxyScenePart.
geometry – - Geometry of the ProxyScenePart.
material – - Material for the ProxyScenePart.
layers – - Layers to use for the ProxyScenePart.
client_registry – - Helper to track registered client scenes
impl_database – - Helper to track implementations of objects for client scenes
scene – - The ProxyScene to add the ProxyScenePart to.
-
virtual ~ProxyScenePart()#
-
virtual void setMaterial(const VarMaterial &material) override#
Set the part’s material.
- Parameters:
material – - The part’s new material.
-
Karana::Core::ks_ptr<ScenePart> of(Scene &scene) const#
Get the implementation for a given client.
- Parameters:
scene – - The client scene
- Returns:
The implementation of this node for the client
-
Karana::Core::ks_ptr<GraphicalScenePart> graphics() const#
Get a graphical implementation If there is more than one graphical implementation only the first one found is returned.
- Returns:
A graphical implementation or nullptr
-
Karana::Core::ks_ptr<GraphicalScenePart> graphics(Scene &scene) const#
Get the graphical implementation for a client.
- Parameters:
scene – - The client scene
- Returns:
The graphical implementation or for the client
-
Karana::Core::ks_ptr<CollisionScenePart> collision() const#
Get a collision implementation If there is more than one collision implementation only the first one found is returned.
- Returns:
A collision implementation or nullptr
-
Karana::Core::ks_ptr<CollisionScenePart> collision(Scene &scene) const#
Get the collision implementation for a client.
- Parameters:
scene – - The client scene
- Returns:
The collision implementation or for the client
Public Static Functions
-
static kc::ks_ptr<ProxyScenePart> create(std::string_view name, const VarStaticGeometry &geometry, const kc::ks_ptr<ProxyScene> &scene, const VarMaterial &material = defaultMaterial(), layer_t layers = LAYER_PHYSICAL)#
Create a ProxyScenePart.
- Parameters:
name – - Name of the ProxyScenePart.
geometry – - Geometry of the ProxyScenePart.
scene – - The ProxyScene to add the ProxyScenePart to.
material – - Material for the ProxyScenePart.
layers – - Layers to use for the ProxyScenePart.
- Returns:
The new ProxyScene part.
-
static kc::ks_ptr<ProxyScenePart> fromScenePartSpec(const kc::ks_ptr<ProxyScene> &scene, const ScenePartSpec &spec)#
Create a ProxyScenePart from a ScenePartSpec.
- Parameters:
scene – - The ProxyScene to add the ProxyScenePart to.
spec – The spec to use to create the ProxyScenePart.
- Returns:
The new ProxyScene part.
Protected Functions
-
virtual void _implement(Scene &scene) override#
Create the implementation for a client scene.
This is called automatically as needed and shouldn’t need to be called outside of ProxyScene internals.
- Parameters:
scene – - The client to create an implementation for.
-
virtual void _unimplement(Scene &scene) override#
Destroy the implementation for a client scene.
This is called automatically as needed and shouldn’t need to be called outside of ProxyScene internals.
- Parameters:
scene – - The client to destroy the implementation for.
-
ProxyScenePart(std::string_view name, const VarStaticGeometry &geometry, const VarMaterial &material, layer_t layers, const Karana::Core::ks_ptr<ClientRegistry> &client_registry, const Karana::Core::ks_ptr<ImplDatabase> &impl_database, const kc::ks_ptr<ProxyScene> &scene)#