Python Script Engine  8.1
GL Studio Editor Python Script API
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)
 
TypeDescType ()
 
void IncrementReference ()
 
void DecrementReference ()
 
unsigned int NumIndexBuffers ()
 
VectorBoundingVolumeCenter ()
 
float BoundingVolumeRadius ()
 
void SetResourceId (unsigned int id)
 
int GetResourceId ()
 

Static Public Member Functions

static void SetCreateInstanceMakesHalfFloat (bool value)
 
static GlsGeometryResourceCreateInstance (TypeDesc &type=GlsGeometryResource::TypeDesc())
 

Detailed Description

Python engine extension for the GlsGeometryResource editor object.

Constructor & Destructor Documentation

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

ctor

Parameters
geometryResourceGlsGeometryResource to wrap
incEditorReftrue if to increment editor ref on with wrapped group (i.e. if this pointer came from the editor) else false

Member Function Documentation

Vector& GlsGeometryResource::BoundingVolumeCenter ( )

Get the bounding sphere center.

Returns
The bounding sphere center
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
pointThe starting point of the ray.
directionThe direction vector of the ray.
Returns
True if this bounding volume is hit by the ray.
float GlsGeometryResource::BoundingVolumeRadius ( )

Get the bounding sphere radius.

Returns
The bounding sphere radius
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
typeA description of the initial Structure
void GlsGeometryResource::DecrementReference ( )

Decrement the Reference count to this instance.

The OpenGL context should be available to free resources.

Precondition
Postcondition
virtual void GlsGeometryResource::DrawCleanup ( VertexAttribIndexLookup shaderProgram)
virtual

Restore the OpenGL state after rendering.

Parameters
shaderProgramMust be the same value that was passed to DrawSetup
Precondition
DrawSetup was called
Postcondition
The OpenGL state will be restored
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
bufferNumberWhich index buffer to draw
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
shaderPrograminterface 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.
virtual void GlsGeometryResource::FreeOpenGLBuffers ( )
virtual

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

virtual void GlsGeometryResource::GetExtents ( Vector min,
Vector max,
GlsMatrixAffine matrix = NULL 
)
virtual

Calculate and return the geometry extents.

Parameters
minReturns the minimum x,y,z values
maxReturns the maximum x,y,z values
matrix(Optional) matrix to transform the vertices into the desired coordinate system
int GlsGeometryResource::GetResourceId ( )
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
pickTypeThe type of picking (see PickableType_e), must be PICK_FIRST or PICK_BEST
pickLinePointA point on the pick line.
pickLineDirectionThe direction of the pick line.
collisionPointIf the method returns true, this contains the point that was hit.
Returns
true if the object was hit by the pick.
void GlsGeometryResource::IncrementReference ( )

Increment the Reference count to this instance.

Precondition
Postcondition
unsigned int GlsGeometryResource::NumIndexBuffers ( )
Returns
The number of index buffers in this geometry resource.
Precondition
Postcondition
static void GlsGeometryResource::SetCreateInstanceMakesHalfFloat ( bool  value)
static

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

void GlsGeometryResource::SetResourceId ( unsigned int  id)
virtual unsigned int GlsGeometryResource::StatsIndexBufferPolygonCount ( unsigned int  bufferNumber)
virtual

Returns polygon count for use in editor statistics.

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

Returns vertex count for use in editor statistics.

TypeDesc& GlsGeometryResource::Type ( )

Returns the TypeDesc for this resource.

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: