Support Forum G3D Web Page |
Base class for debugging shapes that can render themselves. More...
Inherits G3D::ReferenceCountedObject.
Inherited by G3D::ArrowShape, G3D::AxesShape, G3D::BoxShape, G3D::CapsuleShape, G3D::CylinderShape, G3D::MeshShape, G3D::PlaneShape, G3D::PointShape, G3D::RayShape, G3D::SphereShape, and G3D::TriangleShape.
Classes | |
class | Type |
Public Member Functions | |
virtual | ~Shape () |
virtual float | area () const =0 |
Surface area of the outside of this object. More... | |
virtual CoordinateFrame & | axes () |
virtual AABox | boundingAABox () const =0 |
Bounding axis aligned box of this object. More... | |
virtual Sphere | boundingSphere () const =0 |
Bounding sphere of this object. More... | |
virtual Box & | box () |
virtual const Box & | box () const |
virtual Capsule & | capsule () |
virtual const Capsule & | capsule () const |
virtual Vector3 | center () const =0 |
Center of mass for this object. More... | |
virtual Cylinder & | cylinder () |
virtual const Cylinder & | cylinder () const |
virtual void | getRandomSurfacePoint (Point3 &P, Vector3 &N=Vector3::ignore, Random &rnd=Random::common()) const =0 |
A point selected uniformly at random with respect to the surface area of this object. More... | |
virtual const Array< int > & | indexArray () const |
virtual Plane & | plane () |
virtual const Plane & | plane () const |
virtual Vector3 & | point () |
virtual const Vector3 & | point () const |
virtual Point3 | randomInteriorPoint (Random &rnd=Random::common()) const =0 |
A point selected uniformly at random with respect to the volume of this object. More... | |
virtual Ray & | ray () |
virtual const Ray & | ray () const |
virtual void | render (class RenderDevice *rd, const CoordinateFrame &cframe, Color4 solidColor=Color4(.5,.5, 0,.5), Color4 wireColor=Color3::black())=0 |
virtual Sphere & | sphere () |
virtual const Sphere & | sphere () const |
virtual Triangle & | triangle () |
virtual const Triangle & | triangle () const |
virtual Type | type () const =0 |
virtual const Array< Vector3 > & | vertexArray () const |
virtual float | volume () const =0 |
Volume of the interior of this object. More... | |
Static Public Member Functions | |
static String | typeToString (Type t) |
Static Protected Member Functions | |
template<class T , class ... ArgTypes> | |
static shared_ptr< T > | createShared (ArgTypes &&... args) |
Like std::make_shared, but works for protected constructors. More... | |
Base class for debugging shapes that can render themselves.
G3D primitives like Box and Cylinder have no base class so that their implementations are maximally efficient, and have no "render" method because they are lower-level than the rendering API.
The Shape classes provide a parallel set of classes to the G3D primitives that support more functionality.
Mesh shapes are intentionally immutable because they precompute data.
BETA API This API is subject to change in future releases.
|
inlinevirtual |
|
pure virtual |
Surface area of the outside of this object.
Implemented in G3D::PointShape, G3D::PlaneShape, G3D::CapsuleShape, G3D::SphereShape, G3D::CylinderShape, G3D::AxesShape, G3D::ArrowShape, G3D::RayShape, G3D::TriangleShape, G3D::BoxShape, and G3D::MeshShape.
|
inlinevirtual |
Reimplemented in G3D::AxesShape.
|
pure virtual |
Bounding axis aligned box of this object.
Implemented in G3D::PointShape, G3D::PlaneShape, G3D::CapsuleShape, G3D::SphereShape, G3D::CylinderShape, G3D::AxesShape, G3D::ArrowShape, G3D::RayShape, G3D::TriangleShape, G3D::BoxShape, and G3D::MeshShape.
|
pure virtual |
Bounding sphere of this object.
Implemented in G3D::PointShape, G3D::PlaneShape, G3D::CapsuleShape, G3D::SphereShape, G3D::CylinderShape, G3D::AxesShape, G3D::ArrowShape, G3D::RayShape, G3D::TriangleShape, G3D::BoxShape, and G3D::MeshShape.
|
inlinevirtual |
Reimplemented in G3D::BoxShape.
|
inlinevirtual |
Reimplemented in G3D::BoxShape.
|
inlinevirtual |
Reimplemented in G3D::CapsuleShape.
|
inlinevirtual |
Reimplemented in G3D::CapsuleShape.
|
pure virtual |
Center of mass for this object.
Implemented in G3D::PointShape, G3D::PlaneShape, G3D::CapsuleShape, G3D::SphereShape, G3D::CylinderShape, G3D::AxesShape, G3D::ArrowShape, G3D::RayShape, G3D::TriangleShape, G3D::BoxShape, and G3D::MeshShape.
|
inlinestaticprotectedinherited |
Like std::make_shared, but works for protected constructors.
Call as createShared<myclass>.
|
inlinevirtual |
Reimplemented in G3D::CylinderShape.
|
inlinevirtual |
Reimplemented in G3D::CylinderShape.
|
pure virtual |
A point selected uniformly at random with respect to the surface area of this object.
Not available on the Plane or Ray, which have infinite extent. The normal has unit length and points out of the surface.
Implemented in G3D::PointShape, G3D::PlaneShape, G3D::CapsuleShape, G3D::SphereShape, G3D::CylinderShape, G3D::AxesShape, G3D::ArrowShape, G3D::RayShape, G3D::TriangleShape, G3D::BoxShape, and G3D::MeshShape.
|
inlinevirtual |
Reimplemented in G3D::MeshShape.
|
inlinevirtual |
Reimplemented in G3D::PlaneShape.
|
inlinevirtual |
Reimplemented in G3D::PlaneShape.
|
inlinevirtual |
Reimplemented in G3D::PointShape.
|
inlinevirtual |
Reimplemented in G3D::PointShape, and G3D::ArrowShape.
|
pure virtual |
A point selected uniformly at random with respect to the volume of this object.
Not available on objects with infinite extent.
Implemented in G3D::PointShape, G3D::PlaneShape, G3D::CapsuleShape, G3D::SphereShape, G3D::CylinderShape, G3D::AxesShape, G3D::ArrowShape, G3D::RayShape, G3D::TriangleShape, G3D::BoxShape, and G3D::MeshShape.
|
inlinevirtual |
Reimplemented in G3D::RayShape.
|
inlinevirtual |
Reimplemented in G3D::RayShape.
|
pure virtual |
|
inlinevirtual |
Reimplemented in G3D::SphereShape.
|
inlinevirtual |
Reimplemented in G3D::SphereShape.
|
inlinevirtual |
Reimplemented in G3D::TriangleShape.
|
inlinevirtual |
Reimplemented in G3D::TriangleShape.
|
pure virtual |
Reimplemented in G3D::MeshShape.
|
pure virtual |
Volume of the interior of this object.
Implemented in G3D::PointShape, G3D::PlaneShape, G3D::CapsuleShape, G3D::SphereShape, G3D::CylinderShape, G3D::AxesShape, G3D::ArrowShape, G3D::RayShape, G3D::TriangleShape, G3D::BoxShape, and G3D::MeshShape.