Support Forum G3D Web Page |
Inherits G3D::Model.
Classes | |
class | PointArray |
A single Model stores multiple PointArrays so that they can become different Surfaces and culled (or possibly in the future, rigid-body animated) More... | |
class | Specification |
Public Member Functions | |
virtual const String & | className () const override |
Name of the G3D::Model subclass. More... | |
bool | intersect (const Ray &ray, const CoordinateFrame &cframe, float &maxDistance, Model::HitInfo &info=Model::HitInfo::ignore, const Entity *entity=nullptr, const Model::Pose *pose=nullptr) const override |
Determines if the ray intersects the heightfield and fills the info with the proper information. More... | |
virtual const String & | name () const override |
Name of the instance (usually based on the filename it is loaded from) More... | |
int64 | numPoints () const |
float | pointRadius () const |
in meters More... | |
void | pose (Array< shared_ptr< Surface > > &surfaceArray, const CFrame &rootFrame, const CFrame &prevFrame, const shared_ptr< Entity > &entity, const Model::Pose *pose, const Model::Pose *prevPose, const Surface::ExpressiveLightScatteringProperties &e) override |
This will be replaced soon with a version that takes a shared_ptr<Pose>. More... | |
void | pose (Array< shared_ptr< Surface >> &surfaceArray, const shared_ptr< Entity > &entity=shared_ptr< Entity >()) const |
bool | renderAsDisk () const |
Static Public Member Functions | |
static shared_ptr< PointModel > | create (const String &name, const Specification &specification) |
static lazy_ptr< Model > | lazyCreate (const String &name, const Any &a) |
static lazy_ptr< Model > | lazyCreate (const PointModel::Specification &specification, const String &name) |
static void | setUseOptimizedIntersect (bool b) |
If true, complex models should use TriTree to accelerate intersect() calls where possible. More... | |
static bool | useOptimizedIntersect () |
Protected Member Functions | |
PointModel (const String &name) | |
void | addPoint (const Point3 &position, const Color4unorm8 radiance) |
Only call during loading. More... | |
void | buildGrid (const Vector3 &cellSize) |
Divides pointArrayArray[0] into multiple arrays. More... | |
void | computeBounds () |
Called after loading to compute bounds on all point arrays. More... | |
void | copyToGPU () |
Called after loading to upload all point arrays to the GPU. More... | |
void | load (const Specification &spec) |
bool | loadCache (const String &filename) |
Returns false if the cache load fails. More... | |
void | loadPLY (const Specification &spec) |
void | loadVOX (const Specification &spec) |
void | loadXYZ (const Specification &spec) |
void | saveCache (const String &filename) const |
Static Protected Member Functions | |
template<class T , class ... ArgTypes> | |
static shared_ptr< T > | createShared (ArgTypes &&... args) |
Like std::make_shared, but works for protected constructors. More... | |
static String | makeCacheFilename (const String &filename) |
Returns a binary cache file for filename if it exists and is not out of date. More... | |
static String | manglePathToFilename (const String &filename) |
Given a full path (in either Windows or Unix format), mangles it into a name that can be used as a legal filename. More... | |
Protected Attributes | |
String | m_name |
int64 | m_numPoints |
Array< shared_ptr< PointArray > > | m_pointArrayArray |
float | m_pointRadius |
Meters. More... | |
bool | m_renderAsDisk |
Static Protected Attributes | |
static const int | CURRENT_CACHE_FORMAT = 3 |
Friends | |
class | PointSurface |
|
inlineprotected |
|
protected |
Only call during loading.
Write to pointArrayArray[0]
|
protected |
Divides pointArrayArray[0] into multiple arrays.
|
inlineoverridevirtual |
Name of the G3D::Model subclass.
Implements G3D::Model.
|
protected |
Called after loading to compute bounds on all point arrays.
|
protected |
Called after loading to upload all point arrays to the GPU.
|
static |
filename | .points or .ply file, or a directory containing multiple .ply files |
|
inlinestaticprotectedinherited |
Like std::make_shared, but works for protected constructors.
Call as createShared<myclass>.
|
overridevirtual |
Determines if the ray intersects the heightfield and fills the info with the proper information.
maxDistance | Max distance to trace to on input, hit distance written on output if hit |
Reimplemented from G3D::Model.
|
static |
|
protected |
|
protected |
Returns false if the cache load fails.
|
protected |
|
protected |
|
protected |
Returns a binary cache file for filename if it exists and is not out of date.
Otherwise returns "".
Given a full path (in either Windows or Unix format), mangles it into a name that can be used as a legal filename.
e.g.:
"C:/foo/bar/baz_bat/file.ply" ==> "C_c_sfoo_bbar_sbaz_ubat_sfile_pply"
By the transformation: ':' ==> 'c' '/' ==> '_s' '\' ==> '_b' '.' ==> '_p' '?' ==> '_q' '*' ==> '_a' '' ==> '_u'
|
inlineoverridevirtual |
Name of the instance (usually based on the filename it is loaded from)
Implements G3D::Model.
|
inline |
|
inline |
in meters
|
overridevirtual |
This will be replaced soon with a version that takes a shared_ptr<Pose>.
pose | Must have the subclass of Model::Pose appropriate to the Model subclass. |
Implements G3D::Model.
void G3D::PointModel::pose | ( | Array< shared_ptr< Surface >> & | surfaceArray, |
const shared_ptr< Entity > & | entity = shared_ptr< Entity >() |
||
) | const |
|
inline |
|
protected |
|
inlinestaticinherited |
If true, complex models should use TriTree to accelerate intersect() calls where possible.
This can make the first intersect() call very slow for the tree build and can make loading slow. It may not affect performance of skinned or articulated models that animate.
This value should be set before the models are loaded. If it is changed after a model is loaded, the Model is not required to respond to it.
Default: false
|
inlinestaticinherited |
|
friend |
|
staticprotected |
|
protected |
Referenced by numPoints().
|
protected |
|
protected |
Meters.
Referenced by pointRadius().
|
protected |
Referenced by renderAsDisk().