| Python Script Engine 8.3 GL Studio Editor Python Script API

Public Member Functions | Static Public Member Functions | List of all members
GlsGeometryResource Class Reference

## Public Member Functions
| GlsGeometryResource (GlsGeometryResource &src)
| GlsGeometryResource (disti::GlsGeometryResource *geometryResource, bool incEditorRef)
virtual void | DrawSetup (VertexAttribIndexLookup *shaderProgram)
virtual void | DrawIndexBuffer (unsigned int bufferNumber)
virtual void | DrawCleanup (VertexAttribIndexLookup *shaderProgram)
virtual void | FreeOpenGLBuffers ()
virtual void | GetExtents (Vector &min, Vector &max, GlsMatrixAffine *matrix=NULL)
virtual void | UpdateBoundingVolume ()
virtual bool | BoundingVolumeHit (Vector &point, Vector &direction)
virtual bool | HitTest (unsigned char pickType, Vector &pickLinePoint, Vector &pickLineDirection, Vector &collisionPoint)
virtual unsigned int | StatsIndexBufferVertexCount (unsigned int bufferNumber)
virtual unsigned int | StatsIndexBufferPolygonCount (unsigned int bufferNumber)
TypeDesc & | Type ()
void | IncrementReference ()
void | DecrementReference ()
unsigned int | NumIndexBuffers ()
Vector & | BoundingVolumeCenter ()
float | BoundingVolumeRadius ()
void | SetResourceId (unsigned int id)
int | GetResourceId ()

## Static Public Member Functions
static void | SetCreateInstanceMakesHalfFloat (bool value)
static GlsGeometryResource * | CreateInstance (TypeDesc &type=GlsGeometryResource::TypeDesc())

## Detailed Description

Python engine extension for the GlsGeometryResource editor object.

## Constructor & Destructor Documentation

## ◆ GlsGeometryResource() [1/2]

GlsGeometryResource::GlsGeometryResource | ( | GlsGeometryResource & | src | ) |

## ◆ GlsGeometryResource() [2/2]

GlsGeometryResource::GlsGeometryResource | ( | disti::GlsGeometryResource * | geometryResource,
|  | bool | incEditorRef
| ) |  |

ctor

Parameters

  geometryResource | GlsGeometryResource to wrap
  incEditorRef | true if to increment editor ref on with wrapped group (i.e. if this pointer came from the editor) else false

## Member Function Documentation

## ◆ BoundingVolumeCenter()

Vector & GlsGeometryResource::BoundingVolumeCenter | ( |  | ) |

Get the bounding sphere center.

Returns
  The bounding sphere center

## ◆ BoundingVolumeHit()

virtual bool GlsGeometryResource::BoundingVolumeHit | ( | Vector & | point,
|  | Vector & | direction
| ) |  |
| virtual

Determines if the given ray hits the geometry bounding volume.

Note: All parameters should be in this object's coordinates.

Parameters

  point | The starting point of the ray.
  direction | The direction vector of the ray.

Returns
  True if this bounding volume is hit by the ray.

## ◆ BoundingVolumeRadius()

float GlsGeometryResource::BoundingVolumeRadius | ( |  | ) |

Get the bounding sphere radius.

Returns
  The bounding sphere radius

## ◆ CreateInstance()

static GlsGeometryResource * GlsGeometryResource::CreateInstance | ( | TypeDesc & | type = `GlsGeometryResource::TypeDesc()` | ) |
| static

Construct an empty GlsGeometryResource with the given type The initial reference count is 1.

Call DecrementReference to free the resource when you are done with it.

Parameters

  type | A description of the initial Structure

## ◆ DecrementReference()

void GlsGeometryResource::DecrementReference | ( |  | ) |

Decrement the Reference count to this instance.

The OpenGL context should be available to free resources.

Precondition

Postcondition

## ◆ DrawCleanup()

virtual void GlsGeometryResource::DrawCleanup | ( | VertexAttribIndexLookup * | shaderProgram | ) |
| virtual

Restore the OpenGL state after rendering.

Parameters

  shaderProgram | Must be the same value that was passed to DrawSetup

Precondition
  DrawSetup was called

Postcondition
  The OpenGL state will be restored

## ◆ DrawIndexBuffer()

virtual void GlsGeometryResource::DrawIndexBuffer | ( | unsigned int | bufferNumber | ) |
| virtual

Draw the geometry specified by the given index buffer This method should only be called between calls to DrawSetup and DrawCleanup.

Precondition
  DrawSetup has been called.

Parameters

  bufferNumber | Which index buffer to draw

## ◆ DrawSetup()

virtual void GlsGeometryResource::DrawSetup | ( | VertexAttribIndexLookup * | shaderProgram | ) |
| virtual

Setup the OpenGL state for rendering this geometry.

To draw, call DrawIndexBuffer for each index buffer in the resource. After drawing, call DrawCleanup to restore the OpenGL state.

Parameters

  shaderProgram | interface to the shader program, used to lookup correct VertexAttrib index values (may be NULL)

Precondition

Postcondition
  The OpenGL state is configured for rendering from the index buffers.

## ◆ FreeOpenGLBuffers()

virtual void GlsGeometryResource::FreeOpenGLBuffers | ( |  | ) |
| virtual

Force the GlsGeometryResource to free any buffers it has allocated in the current OpenGL context.

## ◆ GetExtents()

virtual void GlsGeometryResource::GetExtents | ( | Vector & | min,
|  | Vector & | max,
|  | GlsMatrixAffine * | matrix = `NULL`
| ) |  |
| virtual

Calculate and return the geometry extents.

Parameters

  min | Returns the minimum x,y,z values
  max | Returns the maximum x,y,z values
  matrix | (Optional) matrix to transform the vertices into the desired coordinate system

## ◆ GetResourceId()

int GlsGeometryResource::GetResourceId | ( |  | ) |

## ◆ HitTest()

virtual bool GlsGeometryResource::HitTest | ( | unsigned char | pickType,
|  | Vector & | pickLinePoint,
|  | Vector & | pickLineDirection,
|  | Vector & | collisionPoint
| ) |  |
| virtual

Hit test the geometry against a picking line.

All values are in geometry space.

Parameters

  pickType | The type of picking (see PickableType_e), must be PICK_FIRST or PICK_BEST
  pickLinePoint | A point on the pick line.
  pickLineDirection | The direction of the pick line.
  collisionPoint | If the method returns true, this contains the point that was hit.

Returns
  true if the object was hit by the pick.

## ◆ IncrementReference()

void GlsGeometryResource::IncrementReference | ( |  | ) |

Increment the Reference count to this instance.

Precondition

Postcondition

## ◆ NumIndexBuffers()

unsigned int GlsGeometryResource::NumIndexBuffers | ( |  | ) |

Returns
  The number of index buffers in this geometry resource.

Precondition

Postcondition

## ◆ SetCreateInstanceMakesHalfFloat()

static void GlsGeometryResource::SetCreateInstanceMakesHalfFloat | ( | bool | value | ) |
| static

When enabled, GlsGeometryResource::CreateInstance will instantiate GlsGeometry_HalfFloat objects when possible.

## ◆ SetResourceId()

void GlsGeometryResource::SetResourceId | ( | unsigned int | id | ) |

## ◆ StatsIndexBufferPolygonCount()

virtual unsigned int GlsGeometryResource::StatsIndexBufferPolygonCount | ( | unsigned int | bufferNumber | ) |
| virtual

Returns polygon count for use in editor statistics.

## ◆ StatsIndexBufferVertexCount()

virtual unsigned int GlsGeometryResource::StatsIndexBufferVertexCount | ( | unsigned int | bufferNumber | ) |
| virtual

Returns vertex count for use in editor statistics.

## ◆ Type()

TypeDesc & GlsGeometryResource::Type | ( |  | ) |

Returns the TypeDesc for this resource.

## ◆ UpdateBoundingVolume()

virtual void GlsGeometryResource::UpdateBoundingVolume | ( |  | ) |
| virtual

Updates the bounding volume of this object This method should be called if the vertices change for picking and culling to work correctly.

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

- GlsGeometryResource.i