Python Script Engine  8.3
GL Studio Editor Python Script API
GlsGeometryResource Class Reference

Public Member Functions

 GlsGeometryResource (GlsGeometryResource &src)
 
 GlsGeometryResource (disti::GlsGeometryResource *geometryResource, bool incEditorRef)
 
None DrawSetup (VertexAttribIndexLookup *shaderProgram)
 
None DrawIndexBuffer (int bufferNumber)
 
None DrawCleanup (VertexAttribIndexLookup *shaderProgram)
 
None FreeOpenGLBuffers ()
 
None GetExtents (Vector &min, Vector &max, GlsMatrixAffine *matrix=NULL)
 
None UpdateBoundingVolume ()
 
bool BoundingVolumeHit (Vector &point, Vector &direction)
 
bool HitTest (int pickType, Vector &pickLinePoint, Vector &pickLineDirection, Vector &collisionPoint)
 
int StatsIndexBufferVertexCount (int bufferNumber)
 
int StatsIndexBufferPolygonCount (int bufferNumber)
 
TypeDescType ()
 
None IncrementReference ()
 
None DecrementReference ()
 
int NumIndexBuffers ()
 
VectorBoundingVolumeCenter ()
 
float BoundingVolumeRadius ()
 
None SetResourceId (int id)
 
int GetResourceId ()
 

Static Public Member Functions

static None SetCreateInstanceMakesHalfFloat (bool value)
 
static GlsGeometryResourceCreateInstance (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
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

◆ BoundingVolumeCenter()

Vector & GlsGeometryResource::BoundingVolumeCenter ( )

Get the bounding sphere center.

Returns
The bounding sphere center

◆ BoundingVolumeHit()

bool GlsGeometryResource::BoundingVolumeHit ( Vector point,
Vector direction 
)

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.

◆ 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
typeA description of the initial Structure

◆ DecrementReference()

None GlsGeometryResource::DecrementReference ( )

Decrement the Reference count to this instance.

The OpenGL context should be available to free resources.

Precondition
Postcondition

◆ DrawCleanup()

None GlsGeometryResource::DrawCleanup ( VertexAttribIndexLookup shaderProgram)

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

◆ DrawIndexBuffer()

None GlsGeometryResource::DrawIndexBuffer ( int  bufferNumber)

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

◆ DrawSetup()

None GlsGeometryResource::DrawSetup ( VertexAttribIndexLookup shaderProgram)

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.

◆ FreeOpenGLBuffers()

None GlsGeometryResource::FreeOpenGLBuffers ( )

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

◆ GetExtents()

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

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

◆ GetResourceId()

int GlsGeometryResource::GetResourceId ( )

◆ HitTest()

bool GlsGeometryResource::HitTest ( int  pickType,
Vector pickLinePoint,
Vector pickLineDirection,
Vector collisionPoint 
)

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.

◆ IncrementReference()

None GlsGeometryResource::IncrementReference ( )

Increment the Reference count to this instance.

Precondition
Postcondition

◆ NumIndexBuffers()

int GlsGeometryResource::NumIndexBuffers ( )
Returns
The number of index buffers in this geometry resource.
Precondition
Postcondition

◆ SetCreateInstanceMakesHalfFloat()

static None GlsGeometryResource::SetCreateInstanceMakesHalfFloat ( bool  value)
static

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

◆ SetResourceId()

None GlsGeometryResource::SetResourceId ( int  id)

◆ StatsIndexBufferPolygonCount()

int GlsGeometryResource::StatsIndexBufferPolygonCount ( int  bufferNumber)

Returns polygon count for use in editor statistics.

◆ StatsIndexBufferVertexCount()

int GlsGeometryResource::StatsIndexBufferVertexCount ( int  bufferNumber)

Returns vertex count for use in editor statistics.

◆ Type()

TypeDesc & GlsGeometryResource::Type ( )

Returns the TypeDesc for this resource.

◆ UpdateBoundingVolume()

None GlsGeometryResource::UpdateBoundingVolume ( )

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: