Rasterfarm-SDK
Loading...
Searching...
No Matches
IQMFactory Class Reference

#include <iqmfactory.h>

Classes

struct  Adjacency
 
struct  Animation
 
struct  Bounds
 
struct  Extension
 
struct  Header
 
struct  Joint
 
struct  JointNode
 
struct  Mesh
 
struct  Pose
 
struct  Triangle
 
struct  VertexArray
 

Public Types

enum  VertexArrayType {
  POSITION = 0 ,
  TEXCOORD = 1 ,
  NORMAL = 2 ,
  TANGENT = 3 ,
  BLEND_INDEX = 4 ,
  BLEND_WEIGHT = 5 ,
  COLOR = 6 ,
  CUSTOM = 0x10
}
 
enum  VertexArrayFormat {
  BYTE = 0 ,
  UBYTE = 1 ,
  SHORT = 2 ,
  USHORT = 3 ,
  INT = 4 ,
  UINT = 5 ,
  HALF = 6 ,
  FLOAT = 7 ,
  DOUBLE = 8
}
 
enum  AnimationFlags { LOOP = 1<<0 }
 

Public Member Functions

 IQMFactory (const char *iqmFile)
 
 IQMFactory (GeometricBase *pGeometric)
 
 ~IQMFactory ()
 
void read (GeometricBase *pGeometric)
 
void read (const char *iqmFile)
 
void write (const char *iqmFile)
 
void create (Shape::Skeletal *pGeometry)
 
Surface::MaterialallocMaterialAndComponents (uint meshIndex, Light *pLight, Surface::MaterialManager *pMaterialManager, Surface::Render::ComponentManager *pComponentManager, TextureManager *pTextureManager)
 
SkeletalcreateSkeletalObject (Light *pLightObject, Surface::MaterialManager *pMaterialManager, Surface::Render::ComponentManager *pComponentManager, TextureManager *pTextureManager)
 
void create (Shape::Skeletal *pGeometry, uint index)
 
const Vector4fArraygetColorArray () const
 
const Vector2fArraygetTextureCoordArray () const
 
const Vector3fArraygetTangentArray () const
 
const Vector3fArraygetBiTangentArray () const
 
Schedule::Sequence::AnimationBasecreateAnimation (Skeletal *pObject, uint index)
 
const HeapArray< JointNode > & getJointNode () const
 
const HeadergetHeader () const
 
const HeapArray< Matrix4f > & getAnimatedFrameJointMatrix (uint frame) const
 
const HeapArray< Matrix4f > & getBaseJointMatrix () const
 
const String getMeshName (uint index) const
 
JointgetJoint (uint index) const
 
AnimationgetAnimation (uint index) const
 
BoundsgetBounds (uint index) const
 
MeshgetMesh (uint index) const
 
PosegetPose (uint index) const
 
template<class S >
char * getName (S *pStruct) const
 
uint getJointIndex (const char *name)
 
void printHeader ()
 
void printJoints ()
 
void printMeshes ()
 
void printAnimations ()
 

Static Public Member Functions

static bool isLittleEndian ()
 

Static Public Attributes

static constexpr char magicString [] = "INTERQUAKEMODEL"
 

Static Protected Member Functions

static HeapArray< Jointread (Shape::Skeletal *pGeometry)
 

Protected Attributes

HeapArray< Matrix4fbaseJointMatrix
 
HeapArray2D< Matrix4fframeJointMatrix
 
Vector2fArray textureCoord
 
Vector4fArray color
 
Vector3fArray normal
 
Vector3fArray tangent
 
Vector3fArray bitangent
 

Detailed Description

Reads and writes Inter-Quake Model format(IQM) data and produces surface, shape, and animation resources.

Member Enumeration Documentation

◆ AnimationFlags

Enumerator
LOOP 

◆ VertexArrayFormat

Enumerator
BYTE 
UBYTE 
SHORT 
USHORT 
INT 
UINT 
HALF 
FLOAT 
DOUBLE 

◆ VertexArrayType

Enumerator
POSITION 
TEXCOORD 
NORMAL 
TANGENT 
BLEND_INDEX 
BLEND_WEIGHT 
COLOR 
CUSTOM 

Constructor & Destructor Documentation

◆ IQMFactory() [1/2]

IQMFactory::IQMFactory ( const char * iqmFile)

◆ IQMFactory() [2/2]

IQMFactory::IQMFactory ( GeometricBase * pGeometric)

◆ ~IQMFactory()

IQMFactory::~IQMFactory ( )

Member Function Documentation

◆ allocMaterialAndComponents()

Surface::Material * IQMFactory::allocMaterialAndComponents ( uint meshIndex,
Light * pLight,
Surface::MaterialManager * pMaterialManager,
Surface::Render::ComponentManager * pComponentManager,
TextureManager * pTextureManager )
Parameters
Themesh index
Pointerto MaterialManager, or nullptr to manage explicitly.
Pointerto ComponentManager, or nullptr to manage explicitly.
Pointerto TextureManager, or nullptr to manage explicitly.
Returns
Pointer to the newly allocated Material and Components contained within.

◆ create() [1/2]

void IQMFactory::create ( Shape::Skeletal * pGeometry)

Adds all the data needed to create the Geometry from the IQM data.

Parameters
Pointerto an Skeletal Geometry.

◆ create() [2/2]

void IQMFactory::create ( Shape::Skeletal * pGeometry,
uint index )
Parameters
Geometrypointer.
Themesh index

◆ createAnimation()

Schedule::Sequence::AnimationBase * IQMFactory::createAnimation ( Skeletal * pObject,
uint index )

◆ createSkeletalObject()

Skeletal * IQMFactory::createSkeletalObject ( Light * pLightObject,
Surface::MaterialManager * pMaterialManager,
Surface::Render::ComponentManager * pComponentManager,
TextureManager * pTextureManager )
Parameters
ALight object incident to returned Skeletal object.
Pointerto MaterialManager, or nullptr to manage explicitly.
Pointerto ComponentManager, or nullptr to manage explicitly.
Pointerto TextureManager, or nullptr to manage explicitly.
Returns
Pointer to the newly allocated SkeletalObject populated with newly allocated Materials, Components, and Textures for all meshes.

◆ getAnimatedFrameJointMatrix()

const HeapArray< Matrix4f > & IQMFactory::getAnimatedFrameJointMatrix ( uint frame) const

◆ getAnimation()

Animation * IQMFactory::getAnimation ( uint index) const
inline

◆ getBaseJointMatrix()

const HeapArray< Matrix4f > & IQMFactory::getBaseJointMatrix ( ) const
inline

◆ getBiTangentArray()

const Vector3fArray & IQMFactory::getBiTangentArray ( ) const
inline

◆ getBounds()

Bounds * IQMFactory::getBounds ( uint index) const
inline

◆ getColorArray()

const Vector4fArray & IQMFactory::getColorArray ( ) const
inline

◆ getHeader()

const Header & IQMFactory::getHeader ( ) const
inline

◆ getJoint()

Joint * IQMFactory::getJoint ( uint index) const
inline

◆ getJointIndex()

uint IQMFactory::getJointIndex ( const char * name)

◆ getJointNode()

const HeapArray< JointNode > & IQMFactory::getJointNode ( ) const
inline

◆ getMesh()

Mesh * IQMFactory::getMesh ( uint index) const
inline

◆ getMeshName()

const String IQMFactory::getMeshName ( uint index) const

◆ getName()

template<class S >
char * IQMFactory::getName ( S * pStruct) const
inline

◆ getPose()

Pose * IQMFactory::getPose ( uint index) const
inline

◆ getTangentArray()

const Vector3fArray & IQMFactory::getTangentArray ( ) const
inline

◆ getTextureCoordArray()

const Vector2fArray & IQMFactory::getTextureCoordArray ( ) const
inline

◆ isLittleEndian()

static bool IQMFactory::isLittleEndian ( )
inlinestatic

◆ printAnimations()

void IQMFactory::printAnimations ( )

◆ printHeader()

void IQMFactory::printHeader ( )

◆ printJoints()

void IQMFactory::printJoints ( )

◆ printMeshes()

void IQMFactory::printMeshes ( )

◆ read() [1/3]

void IQMFactory::read ( const char * iqmFile)

◆ read() [2/3]

void IQMFactory::read ( GeometricBase * pGeometric)

Reads geometric and material into the IQM format. NOTE: Animations are currently not supported and joint matrices are stored as forward-kinematic rather than the inverse-kinematic. The joint-names are applied iteratively(joint1, joint2, etc...) as indexed within Shape::Skeletal.

◆ read() [3/3]

static HeapArray< Joint > IQMFactory::read ( Shape::Skeletal * pGeometry)
staticprotected

◆ write()

void IQMFactory::write ( const char * iqmFile)

Write the contents of the current IQM data buffer to the filesystem. NOTE: This method does not export the IQM assets(ie. textures)

Member Data Documentation

◆ baseJointMatrix

HeapArray< Matrix4f > IQMFactory::baseJointMatrix
protected

◆ bitangent

Vector3fArray IQMFactory::bitangent
protected

◆ color

Vector4fArray IQMFactory::color
protected

◆ frameJointMatrix

HeapArray2D< Matrix4f > IQMFactory::frameJointMatrix
protected

◆ magicString

char IQMFactory::magicString[] = "INTERQUAKEMODEL"
staticconstexpr

◆ normal

Vector3fArray IQMFactory::normal
protected

◆ tangent

Vector3fArray IQMFactory::tangent
protected

◆ textureCoord

Vector2fArray IQMFactory::textureCoord
protected

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