Class CoalScenePart#

Inheritance Relationships#

Base Types#

Class Documentation#

class CoalScenePart : public Karana::Scene::CoalSceneNode, public Karana::Scene::CollisionScenePart#

CollisionScenePart implementation for CoalScene.

See Scene layer for more discussion on the scene layer.

Public Functions

CoalScenePart(std::string_view name, const kc::ks_ptr<Scene> &scene, const VarStaticGeometry &geometry, const VarMaterial &material, layer_t layers, const CoalGeometryCache &geometry_cache)#

CoalScenePart constructor.

Parameters:
  • name – - Name of the CoalScenePart.

  • scene – - CoalScene to add the part to.

  • geometry – - Geometry of the CoalScenePart.

  • material – - Material for the CoalScenePart.

  • layers – - Layers to use for the CoalScenePart.

  • geometry_cache – - Scene-owned cache used to construct the initial native geometry.

~CoalScenePart()#

Destructor.

virtual const CollisionInfo &collide(const CollisionScenePart &other, CollisionInfo &result = CollisionInfo::singleton()) const override#

Check for collisions with another part.

Parameters:
  • other – - The other CollisionPart

  • result – - The CollisionInfo instance to store the result in.

Returns:

The CollisionInfo result.

virtual const DistanceInfo &distance(const CollisionScenePart &other, DistanceInfo &result = DistanceInfo::singleton()) const override#

Compute distance from another part.

Parameters:
  • other – - The other CollisionPart

  • result – - The DistanceInfo instance to store the result in.

Returns:

The DistanceInfo result.

virtual void setIntrinsicScale(const Karana::Math::Vec3 &scale) override#

Set the intrinsic geometry scale supported by CoalScene.

Parameters:

scale – Positive uniform intrinsic scale.

Throws:

std::invalid_argument – if the scale is non-positive, non-finite, or nonuniform.

Public Static Functions

static kc::ks_ptr<CoalScenePart> create(std::string_view name, const kc::ks_ptr<CoalScene> &scene, const VarStaticGeometry &geometry, const VarMaterial &material = defaultMaterial(), layer_t layers = LAYER_PHYSICAL)#

Create a CoalScenePart.

Parameters:
Returns:

The new CoalScene part.