Om  1.0.0
A universal framework for multimedia simulation
Public Member Functions | Static Public Attributes | List of all members
om::graphics::shapes::SkyBoxShape Class Reference

A class that provides a simple means to draw a 3D oriented rectangular sky box. More...

#include <omGraphicsSkyBoxShape.h>

Inheritance diagram for om::graphics::shapes::SkyBoxShape:
om::graphics::shapes::GraphicsShape om::graphics::base::Renderable om::graphics::devices::GraphicsContextObject

Public Member Functions

 SkyBoxShape ()
 Create a sky box shape centered at the origin with width, height and depth = 100. More...
 
 SkyBoxShape (Real width, Real height, Real depth)
 Create a sky box shape with the specified local width, height, and depth. More...
 
 SkyBoxShape (Real width, Real height, Real depth, const Vector3 &newPosition)
 Create a sky box shape with the specified position, width, height, and depth. More...
 
 SkyBoxShape (Real width, Real height, Real depth, const Vector3 &newPosition, const Matrix3 &newOrientation)
 Create a sky box shape for the given graphics context with the specified position, orientation, width, height, and depth. More...
 
const Vector3getPosition () const
 Return the position of this box's center in local coordinates. More...
 
void setPosition (const Vector3 &newPosition)
 Set the position of this box's center in local coordinates. More...
 
const Matrix3getOrientation () const
 Return the orientation of this box's axes in local coordinates. More...
 
void setOrientation (const Matrix3 &newOrientation)
 Set the orientation of this box's axes in local coordinates. More...
 
const Vector3getSize () const
 Set the 3D dimensions of this box in its local coordinate frame. More...
 
void setSize (const Vector3 &newSize)
 Set the 3D dimensions of this box in its local coordinate frame. More...
 
Real getWidth () const
 Return the width (X size) of this box in its local coordinate frame. More...
 
void setWidth (Real newWidth)
 Set the width (X size) of this box in its local coordinate frame. More...
 
Real getHeight () const
 Return the height (Y size) of this box in its local coordinate frame. More...
 
void setHeight (Real newHeight)
 Set the height (Y size) of this box in its local coordinate frame. More...
 
Real getDepth () const
 Return the depth (Z size) of this box in its local coordinate frame. More...
 
void setDepth (Real newDepth)
 Set the depth (Z size) of this box in its local coordinate frame. More...
 
TexturegetTexture () const
 Return a pointer to the texture that this sky box is using. More...
 
Bool setTexture (Texture *newTexture)
 Set the sky texture that this sky box is using. More...
 
virtual void setContext (devices::GraphicsContext *newContext)
 Change the graphics context that is used to create this sky box shape. More...
 
virtual void upload (UploadRequest &request)
 Upload this sky box shape's current CPU representation to the GPU device. More...
 
virtual void download (DownloadRequest &request)
 Download the sky box shape's GPU representation to CPU memory. More...
 
virtual void updateBoundingBox ()
 Update the box's axis-aligned bounding box. More...
 
virtual void getRenderables (const RenderRequest &request, const Transform3 &worldTransform, RenderQueue &outputQueue) const
 Process the renderable and add all child renderable objects to the output render queue. More...
 
- Public Member Functions inherited from om::graphics::shapes::GraphicsShape
ShapeTypeID getShapeTypeID () const
 Return an integer identifying the sub type of this shape. More...
 
const ShapeTypegetShapeType () const
 Return a reference to an object representing the type of this Shape. More...
 
Sphere3 getBoundingSphere () const
 Return a bounding sphere for this transformable in its parent coordinate space. More...
 
const AABB3getBoundingBox () const
 Return an axis-aligned bounding box that encompases this entire transformable in its parent coordinate space. More...
 
virtual void intersectRay (GraphicsRay &ray) const
 Trace a ray against this shape and compute the closest intersection. More...
 
virtual void testRay (GraphicsRay &ray) const
 Trace a ray against this shape and determine if any intersection exist along the ray. More...
 
- Public Member Functions inherited from om::graphics::base::Renderable
 Renderable ()
 Create a new renderable object with the default renderable flags. More...
 
 Renderable (const RenderableFlags &newFlags)
 Create a new renderable object with the specified renderable flags. More...
 
RenderableFlagsgetFlags ()
 Return a reference to an object that contains boolean parameters of the renderable. More...
 
const RenderableFlagsgetFlags () const
 Return an object that contains boolean parameters of the renderable. More...
 
void setFlags (const RenderableFlags &newFlags)
 Set an object that contains boolean parameters of the renderable. More...
 
Bool flagIsSet (RenderableFlags::Flag flag) const
 Return whether or not the specified boolan flag is set for this renderable. More...
 
Bool flagsAreSet (const RenderableFlags &otherFlags) const
 Return whether or not all of the specified boolan flags are set for this renderable. More...
 
void setFlag (RenderableFlags::Flag flag, Bool newIsSet=true)
 Set whether or not the specified boolan flag is set for this renderable. More...
 
Bool getIsVisible () const
 Get whether or not the renderable and its children are visible in the scene. More...
 
void setIsVisible (Bool newIsVisible)
 Set whether or not the renderable and its children are visible in the scene. More...
 
Bool getShadowsEnabled () const
 Return whether or not this renderable can cast shadows. More...
 
void setShadowsEnabled (Bool newCanCastShadows)
 Set whether or not this renderable can cast shadows. More...
 
- Public Member Functions inherited from om::graphics::devices::GraphicsContextObject
virtual ~GraphicsContextObject ()
 Destory this graphics context object. More...
 
GraphicsContextgetContext () const
 Return a pointer to the graphics context this context object is using to do rendering. More...
 
void clearContext ()
 Clear the previous context from this object. More...
 
void upload ()
 Upload this resource's CPU representation to the GPU device. More...
 
void download ()
 Upload this resource's CPU representation to the GPU device. More...
 
virtual Bool isUploaded () const
 Return whether or not this graphics resource has been successfully created and uploaded to the device. More...
 
virtual Bool isDownloaded () const
 Return whether or not this graphics resource has a copy of its data stored in CPU-side memory. More...
 
virtual Bool isValid () const
 Return whether or not the state of this graphics resource is valid (either on CPU or GPU) and able to be used for rendering. More...
 

Static Public Attributes

static const ShapeType TYPE
 A shape type object that represents the type to use for a sky box shape. More...
 
- Static Public Attributes inherited from om::graphics::shapes::GraphicsShape
static const ResourceType RESOURCE_TYPE
 The resource type for a graphics shape. More...
 

Additional Inherited Members

- Protected Member Functions inherited from om::graphics::shapes::GraphicsShape
 GraphicsShape (const ShapeType *newType)
 Create a new shape with the specified type. More...
 
void setBoundingBox (const AABB3 &newBoundingBox)
 Set the local axis-aligned bounding box for this shape. More...
 
- Protected Member Functions inherited from om::graphics::devices::GraphicsContextObject
 GraphicsContextObject ()
 Create a new graphics context object that doesn't have an associated graphics context. More...
 
 GraphicsContextObject (GraphicsContext *newContext)
 Create a new graphics context object that uses the specified context for rendering. More...
 
- Protected Attributes inherited from om::graphics::base::Renderable
RenderableFlags flags
 An object containing boolean configuration flags for this renderable. More...
 
- Protected Attributes inherited from om::graphics::devices::GraphicsContextObject
GraphicsContextcontext
 A pointer to the graphics context this object is using. More...
 

Detailed Description

A class that provides a simple means to draw a 3D oriented rectangular sky box.

A sky box is used to draw a static background at infinite depth that surrounds the camera.

Constructor & Destructor Documentation

om::graphics::shapes::SkyBoxShape::SkyBoxShape ( )

Create a sky box shape centered at the origin with width, height and depth = 100.

om::graphics::shapes::SkyBoxShape::SkyBoxShape ( Real  width,
Real  height,
Real  depth 
)

Create a sky box shape with the specified local width, height, and depth.

om::graphics::shapes::SkyBoxShape::SkyBoxShape ( Real  width,
Real  height,
Real  depth,
const Vector3 newPosition 
)

Create a sky box shape with the specified position, width, height, and depth.

om::graphics::shapes::SkyBoxShape::SkyBoxShape ( Real  width,
Real  height,
Real  depth,
const Vector3 newPosition,
const Matrix3 newOrientation 
)

Create a sky box shape for the given graphics context with the specified position, orientation, width, height, and depth.

Member Function Documentation

const Vector3& om::graphics::shapes::SkyBoxShape::getPosition ( ) const
inline

Return the position of this box's center in local coordinates.

void om::graphics::shapes::SkyBoxShape::setPosition ( const Vector3 newPosition)

Set the position of this box's center in local coordinates.

const Matrix3& om::graphics::shapes::SkyBoxShape::getOrientation ( ) const
inline

Return the orientation of this box's axes in local coordinates.

void om::graphics::shapes::SkyBoxShape::setOrientation ( const Matrix3 newOrientation)

Set the orientation of this box's axes in local coordinates.

const Vector3& om::graphics::shapes::SkyBoxShape::getSize ( ) const
inline

Set the 3D dimensions of this box in its local coordinate frame.

void om::graphics::shapes::SkyBoxShape::setSize ( const Vector3 newSize)
inline

Set the 3D dimensions of this box in its local coordinate frame.

Real om::graphics::shapes::SkyBoxShape::getWidth ( ) const
inline

Return the width (X size) of this box in its local coordinate frame.

void om::graphics::shapes::SkyBoxShape::setWidth ( Real  newWidth)
inline

Set the width (X size) of this box in its local coordinate frame.

This width value is clamped to the range of [0,+infinity].

Real om::graphics::shapes::SkyBoxShape::getHeight ( ) const
inline

Return the height (Y size) of this box in its local coordinate frame.

void om::graphics::shapes::SkyBoxShape::setHeight ( Real  newHeight)
inline

Set the height (Y size) of this box in its local coordinate frame.

This height value is clamped to the range of [0,+infinity].

Real om::graphics::shapes::SkyBoxShape::getDepth ( ) const
inline

Return the depth (Z size) of this box in its local coordinate frame.

void om::graphics::shapes::SkyBoxShape::setDepth ( Real  newDepth)
inline

Set the depth (Z size) of this box in its local coordinate frame.

This depth value is clamped to the range of [0,+infinity].

Texture* om::graphics::shapes::SkyBoxShape::getTexture ( ) const
inline

Return a pointer to the texture that this sky box is using.

Bool om::graphics::shapes::SkyBoxShape::setTexture ( Texture newTexture)

Set the sky texture that this sky box is using.

The texture must be a cube map.

virtual void om::graphics::shapes::SkyBoxShape::setContext ( devices::GraphicsContext newContext)
virtual

Change the graphics context that is used to create this sky box shape.

Calling this method causes the previously generated box geometry to be discarded and regenerated using the new context.

Reimplemented from om::graphics::devices::GraphicsContextObject.

virtual void om::graphics::shapes::SkyBoxShape::upload ( UploadRequest request)
virtual

Upload this sky box shape's current CPU representation to the GPU device.

Reimplemented from om::graphics::devices::GraphicsContextObject.

virtual void om::graphics::shapes::SkyBoxShape::download ( DownloadRequest request)
virtual

Download the sky box shape's GPU representation to CPU memory.

Reimplemented from om::graphics::devices::GraphicsContextObject.

virtual void om::graphics::shapes::SkyBoxShape::updateBoundingBox ( )
virtual

Update the box's axis-aligned bounding box.

Reimplemented from om::graphics::shapes::GraphicsShape.

virtual void om::graphics::shapes::SkyBoxShape::getRenderables ( const RenderRequest request,
const Transform3 worldTransform,
RenderQueue outputQueue 
) const
virtual

Process the renderable and add all child renderable objects to the output render queue.

Implements om::graphics::base::Renderable.

Member Data Documentation

const ShapeType om::graphics::shapes::SkyBoxShape::TYPE
static

A shape type object that represents the type to use for a sky box shape.


The documentation for this class was generated from the following file: