Sirikata
Classes | Typedefs | Functions | Variables
Sirikata::Mesh Namespace Reference

Classes

struct  Billboard
class  CompositeFilter
 A CompositeFilter is essentially a pipeline of other filters. More...
class  FilterData
 FilterData is the input and output of a Filter. More...
class  Filter
class  FilterFactory
struct  SkinController
 Represents a skinned animation. More...
struct  SubMeshGeometry
struct  GeometryInstance
struct  LightInstance
struct  MaterialEffectInfo
struct  InstanceSkinAnimation
struct  TransformationKeyFrames
 Represents a series of key frames. More...
struct  Node
struct  ProgressiveMipmapLevel
struct  ProgressiveMipmapArchive
struct  ProgressiveData
struct  Meshdata
class  MeshSimplifier
class  Visual
 Base class for visual objects that are passed through the system. More...
class  CenterFilter
class  ComputeBoundsFilter
class  ComputeNormalsFilter
 For meshes that don't already specify them, fills in normals computed based on winding order. More...
class  DeduplicationFilter
class  LoadFilter
class  PrintFilter
class  SaveFilter
class  SingleMaterialGeometryFilter
 Splits any SubMeshGeometries (and corresponding GeometryInstances) into multiple parts, such that each SubMeshGeometry only has a single material (and the GeometryInstance has only 1 entry in its MaterialBindingMap). More...
class  SquashInstancedGeometryFilter
 Takes all instanced geometry in a mesh and squashes it to as few SubMeshGeometry/InstanceGeometries as possible. More...
class  SquashMaterialsFilter
class  SquashPrimitivesFilter
class  TransformFilter
class  TriangulateFilter
 TriangulateFilter converts non-triangulated meshes, e.g. More...
class  CompressTexturesFilter
class  TextureAtlasFilter
class  IndexedFaceContainer
class  FaceContainer
class  GeomContainer
class  GeomPairContainer

Typedefs

typedef std::tr1::shared_ptr
< Billboard
BillboardPtr
typedef std::tr1::weak_ptr
< Billboard
BillboardWPtr
typedef std::tr1::shared_ptr
< const FilterData
FilterDataPtr
typedef std::tr1::shared_ptr
< FilterData
MutableFilterDataPtr
typedef std::tr1::shared_ptr
< Filter
FilterPtr
typedef int32 NodeIndex
typedef std::vector< NodeIndexNodeIndexList
typedef std::vector< LightInfoLightInfoList
typedef std::vector< std::string > TextureList
typedef std::tr1::shared_ptr
< Meshdata
MeshdataPtr
typedef std::tr1::weak_ptr
< Meshdata
MeshdataWPtr
typedef std::vector
< SkinController
SkinControllerList
typedef std::vector
< SubMeshGeometry
SubMeshGeometryList
typedef std::vector
< GeometryInstance
GeometryInstanceList
typedef std::vector
< LightInstance
LightInstanceList
typedef std::vector
< MaterialEffectInfo
MaterialEffectInfoList
typedef std::vector< NodeNodeList
typedef std::map< uint32,
ProgressiveMipmapLevel
ProgressiveMipmaps
typedef std::map< std::string,
ProgressiveMipmapArchive
ProgressiveMipmapMap
typedef std::tr1::shared_ptr
< ProgressiveData
ProgressiveDataPtr
typedef std::tr1::shared_ptr
< Visual
VisualPtr
typedef std::tr1::weak_ptr
< Visual
VisualWPtr

Functions

SIRIKATA_MESH_FUNCTION_EXPORT void ComputeBounds (VisualPtr visual, BoundingBox3f3f *bbox=NULL, double *rad=NULL)
 Compute the bounds of the visual.
SIRIKATA_MESH_FUNCTION_EXPORT void ComputeBounds (VisualPtr visual, const Matrix4x4f &xform, BoundingBox3f3f *bbox=NULL, double *rad=NULL)
 Compute the bounds of the visual when trasnformed by xform.
SIRIKATA_MESH_FUNCTION_EXPORT void ComputeBounds (MeshdataPtr mesh, BoundingBox3f3f *bbox=NULL, double *rad=NULL)
 Compute the bounds of the mesh.
SIRIKATA_MESH_FUNCTION_EXPORT void ComputeBounds (MeshdataPtr mesh, const Matrix4x4f &xform, BoundingBox3f3f *bbox=NULL, double *rad=NULL)
 Compute the bounds of the mesh when trasnformed by xform.
SIRIKATA_MESH_FUNCTION_EXPORT void ComputeBounds (BillboardPtr billboard, BoundingBox3f3f *bbox=NULL, double *rad=NULL)
 Compute the bounds of the billboard.
SIRIKATA_MESH_FUNCTION_EXPORT void ComputeBounds (BillboardPtr billboard, const Matrix4x4f &xform, BoundingBox3f3f *bbox=NULL, double *rad=NULL)
 Compute the bounds of the mesh when trasnformed by xform.
SIRIKATA_MESH_FUNCTION_EXPORT bool Raytrace (VisualPtr vis, const Matrix4x4f &vis_xform, const Vector3f &ray_start, const Vector3f &ray_dir, float32 *t_out, Vector3f *hit_out)
 Traces a ray an returns information about the first point it hits on an the mesh.
SIRIKATA_MESH_FUNCTION_EXPORT bool RaytraceType (MeshdataPtr vis, const Matrix4x4f &vis_xform, const Vector3f &ray_start, const Vector3f &ray_dir, float32 *t_out, Vector3f *hit_out)
SIRIKATA_MESH_FUNCTION_EXPORT bool RaytraceType (BillboardPtr vis, const Matrix4x4f &vis_xform, const Vector3f &ray_start, const Vector3f &ray_dir, float32 *t_out, Vector3f *hit_out)
FilterReduceDrawCalls (const String &args)
bool comp (Vector3f point1, Vector3f point2)
FilterAtlasAndReduceDrawCalls (const String &args)
bool custom_isnan (double data)
bool optimize (Matrix4x4d &Q, const Vector3f &v11, const Vector3f &v21, Vector3f &best)
void computeCosts (Mesh::MeshdataPtr agg_mesh, std::tr1::unordered_map< uint32, std::tr1::unordered_map< uint32, Matrix4x4d > > &submeshPositionQs, std::set< GeomPairContainer > &vertexPairs, std::tr1::unordered_map< GeomPairContainer, float64, GeomPairContainer::Hasher > &pairPriorities, std::tr1::unordered_map< uint32, std::tr1::unordered_map< uint32, std::tr1::unordered_set< uint32 > > > &submeshNeighborVertices, std::tr1::unordered_map< uint32, std::tr1::unordered_map< uint32, std::vector< uint32 > > > &vertexToFacesMap, std::tr1::unordered_map< GeomPairContainer, uint32, GeomPairContainer::Hasher > &pairFrequency)
uint32 findMappedVertex (std::tr1::unordered_map< int, int > &vertexMapping, uint32 idx)
void computeCosts (Mesh::MeshdataPtr agg_mesh, uint32 geomIdx, uint32 sourcePositionIdx, uint32 targetPositionIdx, std::tr1::unordered_map< int, int > &vertexMapping, std::tr1::unordered_map< uint32, std::tr1::unordered_map< uint32, Matrix4x4d > > &submeshPositionQs, std::set< GeomPairContainer > &vertexPairs, std::tr1::unordered_map< GeomPairContainer, float64, GeomPairContainer::Hasher > &pairPriorities, std::tr1::unordered_map< uint32, std::tr1::unordered_map< uint32, std::tr1::unordered_set< uint32 > > > &submeshNeighborVertices, std::tr1::unordered_map< uint32, std::tr1::unordered_map< uint32, std::vector< uint32 > > > &vertexToFacesMap, std::tr1::unordered_map< GeomPairContainer, uint32, GeomPairContainer::Hasher > &pairFrequency)
bool RaytraceTriangle (const Vector3f &v1, const Vector3f &v2, const Vector3f &v3, const Vector3f &normal, const Vector3f &ray_start, const Vector3f &ray_dir, bool positive_side, bool negative_side, float32 *t_out)
 Raytraces a single triangle.
bool RaytraceSphere (const Vector3f &center, float32 radius, const Vector3f &ray_start, const Vector3f &ray_dir, bool discard_inside, float32 *t_out)
 Raytraces a sphere.
bool RaytraceTriangle (const Vector3f &v1, const Vector3f &v2, const Vector3f &v3, const Vector3f &ray_start, const Vector3f &ray_dir, float32 *t_out)
 Raytraces a single triangle.
bool RaytraceSphere (const Vector3f &center, float32 radius, const Vector3f &ray_start, const Vector3f &ray_dir, float32 *t_out)
 Raytraces a sphere.

Variables

SIRIKATA_MESH_EXPORT NodeIndex NullNodeIndex = -1

Typedef Documentation

typedef std::tr1::shared_ptr<Billboard> Sirikata::Mesh::BillboardPtr
typedef std::tr1::weak_ptr<Billboard> Sirikata::Mesh::BillboardWPtr
typedef std::tr1::shared_ptr<const FilterData> Sirikata::Mesh::FilterDataPtr
typedef std::tr1::shared_ptr<Filter> Sirikata::Mesh::FilterPtr
typedef std::tr1::shared_ptr<Meshdata> Sirikata::Mesh::MeshdataPtr
typedef std::tr1::weak_ptr<Meshdata> Sirikata::Mesh::MeshdataWPtr
typedef std::tr1::shared_ptr<FilterData> Sirikata::Mesh::MutableFilterDataPtr
typedef std::vector<Node> Sirikata::Mesh::NodeList
typedef std::tr1::shared_ptr<ProgressiveData> Sirikata::Mesh::ProgressiveDataPtr
typedef std::vector<std::string> Sirikata::Mesh::TextureList
typedef std::tr1::shared_ptr<Visual> Sirikata::Mesh::VisualPtr
typedef std::tr1::weak_ptr<Visual> Sirikata::Mesh::VisualWPtr

Function Documentation

Filter* Sirikata::Mesh::AtlasAndReduceDrawCalls ( const String &  args)

Referenced by init().

bool Sirikata::Mesh::comp ( Vector3f  point1,
Vector3f  point2 
)
void SIRIKATA_MESH_FUNCTION_EXPORT Sirikata::Mesh::ComputeBounds ( VisualPtr  visual,
BoundingBox3f3f *  bbox = NULL,
double *  rad = NULL 
)
void SIRIKATA_MESH_FUNCTION_EXPORT Sirikata::Mesh::ComputeBounds ( MeshdataPtr  mesh,
const Matrix4x4f &  xform,
BoundingBox3f3f *  bbox = NULL,
double *  rad = NULL 
)

Compute the bounds of the mesh when trasnformed by xform.

The bounding box is computed *after* transforming the mesh, so it is tighter than computing the bounding box of the transformed original bounding box.

References Sirikata::Mesh::GeometryInstance::computeTransformedBounds(), and Sirikata::Mesh::Meshdata::GeometryInstanceIterator::next().

void SIRIKATA_MESH_FUNCTION_EXPORT Sirikata::Mesh::ComputeBounds ( VisualPtr  visual,
const Matrix4x4f &  xform,
BoundingBox3f3f *  bbox = NULL,
double *  rad = NULL 
)

Compute the bounds of the visual when trasnformed by xform.

The bounding box is computed *after* transforming the visual, so it is tighter than computing the bounding box of the transformed original bounding box.

References ComputeBounds().

void SIRIKATA_MESH_FUNCTION_EXPORT Sirikata::Mesh::ComputeBounds ( BillboardPtr  billboard,
BoundingBox3f3f *  bbox = NULL,
double *  rad = NULL 
)

Compute the bounds of the billboard.

void SIRIKATA_MESH_FUNCTION_EXPORT Sirikata::Mesh::ComputeBounds ( MeshdataPtr  mesh,
BoundingBox3f3f *  bbox = NULL,
double *  rad = NULL 
)
void SIRIKATA_MESH_FUNCTION_EXPORT Sirikata::Mesh::ComputeBounds ( BillboardPtr  billboard,
const Matrix4x4f &  xform,
BoundingBox3f3f *  bbox = NULL,
double *  rad = NULL 
)

Compute the bounds of the mesh when trasnformed by xform.

The bounding box is computed *after* transforming the mesh, so it is tighter than computing the bounding box of the transformed original bounding box.

void Sirikata::Mesh::computeCosts ( Mesh::MeshdataPtr  agg_mesh,
uint32  geomIdx,
uint32  sourcePositionIdx,
uint32  targetPositionIdx,
std::tr1::unordered_map< int, int > &  vertexMapping,
std::tr1::unordered_map< uint32, std::tr1::unordered_map< uint32, Matrix4x4d > > &  submeshPositionQs,
std::set< GeomPairContainer > &  vertexPairs,
std::tr1::unordered_map< GeomPairContainer, float64, GeomPairContainer::Hasher > &  pairPriorities,
std::tr1::unordered_map< uint32, std::tr1::unordered_map< uint32, std::tr1::unordered_set< uint32 > > > &  submeshNeighborVertices,
std::tr1::unordered_map< uint32, std::tr1::unordered_map< uint32, std::vector< uint32 > > > &  vertexToFacesMap,
std::tr1::unordered_map< GeomPairContainer, uint32, GeomPairContainer::Hasher > &  pairFrequency 
)
void Sirikata::Mesh::computeCosts ( Mesh::MeshdataPtr  agg_mesh,
std::tr1::unordered_map< uint32, std::tr1::unordered_map< uint32, Matrix4x4d > > &  submeshPositionQs,
std::set< GeomPairContainer > &  vertexPairs,
std::tr1::unordered_map< GeomPairContainer, float64, GeomPairContainer::Hasher > &  pairPriorities,
std::tr1::unordered_map< uint32, std::tr1::unordered_map< uint32, std::tr1::unordered_set< uint32 > > > &  submeshNeighborVertices,
std::tr1::unordered_map< uint32, std::tr1::unordered_map< uint32, std::vector< uint32 > > > &  vertexToFacesMap,
std::tr1::unordered_map< GeomPairContainer, uint32, GeomPairContainer::Hasher > &  pairFrequency 
)
bool Sirikata::Mesh::custom_isnan ( double  data)
uint32 Sirikata::Mesh::findMappedVertex ( std::tr1::unordered_map< int, int > &  vertexMapping,
uint32  idx 
) [inline]
bool Sirikata::Mesh::optimize ( Matrix4x4d &  Q,
const Vector3f &  v11,
const Vector3f &  v21,
Vector3f &  best 
)

First compute cost of contracting to endpoint

Referenced by computeCosts().

bool SIRIKATA_MESH_FUNCTION_EXPORT Sirikata::Mesh::Raytrace ( VisualPtr  vis,
const Matrix4x4f &  vis_xform,
const Vector3f &  ray_start,
const Vector3f &  ray_dir,
float32 *  t_out,
Vector3f *  hit_out 
)

Traces a ray an returns information about the first point it hits on an the mesh.

Ray tracing is performed in mesh space, so if you want to perform the operation in world space, you need to transform the ray into object space, run the raytrace, and transform the results back.

Parameters:
visthe mesh to test the ray against vis_xform transformation to apply to the mesh
ray_startthe starting position of the ray to trace
ray_dirthe direction of the ray to trace
t_outthe parametric value for the collision, in terms of ray_start and ray_dir
hit_outthe point of collision, if one was found
Returns:
true if a collision was found, false otherwise

References RaytraceType().

Referenced by Sirikata::JS::JSPositionListener::raytrace().

bool Sirikata::Mesh::RaytraceSphere ( const Vector3f &  center,
float32  radius,
const Vector3f &  ray_start,
const Vector3f &  ray_dir,
bool  discard_inside,
float32 *  t_out 
)

Raytraces a sphere.

Assumes that t_out is initialized and will only update output values and return true if the hit is at t < t_orig.

Parameters:
centerThe center position of the sphere
radiusThe radius of the sphere
ray_startthe starting position of the ray to trace
ray_dirthe direction of the ray to trace
discard_insidediscard hits that start from inside the sphere
t_outthe point of the collision, if one was found
returnstrue if the sphere was hit and it was before the existing hit

Referenced by RaytraceSphere(), and RaytraceType().

bool Sirikata::Mesh::RaytraceSphere ( const Vector3f &  center,
float32  radius,
const Vector3f &  ray_start,
const Vector3f &  ray_dir,
float32 *  t_out 
)

Raytraces a sphere.

Assumes that t_out is initialized and will only update output values and return true if the hit is at t < t_orig.

Parameters:
centerThe center position of the sphere
radiusThe radius of the sphere
ray_startthe starting position of the ray to trace
ray_dirthe direction of the ray to trace
t_outthe point of the collision, if one was found
returnstrue if the sphere was hit and it was before the existing hit

References RaytraceSphere().

bool Sirikata::Mesh::RaytraceTriangle ( const Vector3f &  v1,
const Vector3f &  v2,
const Vector3f &  v3,
const Vector3f &  normal,
const Vector3f &  ray_start,
const Vector3f &  ray_dir,
bool  positive_side,
bool  negative_side,
float32 *  t_out 
)

Raytraces a single triangle.

Assumes that t_out is initialized and will only update output values and return true if the hit is at t < t_orig.

Parameters:
v1First vertex of triangle
v2Second vertex of triangle
v3Third vertex of triangle
ray_startthe starting position of the ray to trace
ray_dirthe direction of the ray to trace
normalthe normal for this triangle
positive_sideuse collisions with the positive side of the triangle
negative_sideuse collisions with the positive side of the triangle
t_outthe point of the collision, if one was found
returnstrue if the triangle was hit and it was before the existing hit

Referenced by RaytraceTriangle(), and RaytraceType().

bool Sirikata::Mesh::RaytraceTriangle ( const Vector3f &  v1,
const Vector3f &  v2,
const Vector3f &  v3,
const Vector3f &  ray_start,
const Vector3f &  ray_dir,
float32 *  t_out 
)

Raytraces a single triangle.

Assumes that t_out is initialized and will only update output values and return true if the hit is at t < t_orig.

Parameters:
v1First vertex of triangle
v2Second vertex of triangle
v3Third vertex of triangle
ray_startthe starting position of the ray to trace
ray_dirthe direction of the ray to trace
t_outthe point of the collision, if one was found
returnstrue if the triangle was hit and it was before the existing hit

References RaytraceTriangle().

bool SIRIKATA_MESH_FUNCTION_EXPORT Sirikata::Mesh::RaytraceType ( BillboardPtr  vis,
const Matrix4x4f &  vis_xform,
const Vector3f &  ray_start,
const Vector3f &  ray_dir,
float32 *  t_out,
Vector3f *  hit_out 
)
bool SIRIKATA_MESH_FUNCTION_EXPORT Sirikata::Mesh::RaytraceType ( MeshdataPtr  vis,
const Matrix4x4f &  vis_xform,
const Vector3f &  ray_start,
const Vector3f &  ray_dir,
float32 *  t_out,
Vector3f *  hit_out 
)
Filter* Sirikata::Mesh::ReduceDrawCalls ( const String &  args)

Referenced by init().


Variable Documentation

SIRIKATA_MESH_EXPORT NodeIndex Sirikata::Mesh::NullNodeIndex = -1