OpenSceneGraph
3.0.1
|
A domain operator which accepts different domain shapes as the parameter. More...
Classes | |
struct | Domain |
Public Member Functions | |
DomainOperator () | |
DomainOperator (const DomainOperator ©, const osg::CopyOp ©op=osg::CopyOp::SHALLOW_COPY) | |
META_Object (osgParticle, DomainOperator) | |
void | addPointDomain (const osg::Vec3 &p) |
Add a point domain. | |
void | addLineSegmentDomain (const osg::Vec3 &v1, const osg::Vec3 &v2) |
Add a line segment domain. | |
void | addTriangleDomain (const osg::Vec3 &v1, const osg::Vec3 &v2, const osg::Vec3 &v3) |
Add a triangle domain. | |
void | addRectangleDomain (const osg::Vec3 &corner, const osg::Vec3 &w, const osg::Vec3 &h) |
Add a rectangle domain. | |
void | addPlaneDomain (const osg::Plane &plane) |
Add a plane domain. | |
void | addSphereDomain (const osg::Vec3 &c, float r) |
Add a sphere domain. | |
void | addBoxDomain (const osg::Vec3 &min, const osg::Vec3 &max) |
Add a box domain. | |
void | addDiskDomain (const osg::Vec3 &c, const osg::Vec3 &n, float r1, float r2=0.0f) |
Add a disk domain. | |
void | addDomain (const Domain &domain) |
Add a domain object directly, used by the .osg wrappers and serializers. | |
const Domain & | getDomain (unsigned int i) const |
Get a domain object directly, used by the .osg wrappers and serializers. | |
void | removeDomain (unsigned int i) |
Remove a domain at specific index. | |
void | removeAllDomains () |
Remove all existing domains. | |
unsigned int | getNumDomains () const |
Get number of domains. | |
void | operate (Particle *P, double dt) |
Apply the acceleration to a particle. Do not call this method manually. | |
void | beginOperate (Program *prg) |
Perform some initializations. Do not call this method manually. | |
void | endOperate () |
Perform some post-operations. Do not call this method manually. | |
![]() | |
Operator () | |
Operator (const Operator ©, const osg::CopyOp ©op=osg::CopyOp::SHALLOW_COPY) | |
virtual const char * | libraryName () const |
return the name of the object's library. | |
virtual const char * | className () const |
return the name of the object's class type. | |
virtual bool | isSameKindAs (const osg::Object *obj) const |
bool | isEnabled () const |
Get whether this operator is enabled. | |
void | setEnabled (bool v) |
Enable or disable this operator. | |
virtual void | operateParticles (ParticleSystem *ps, double dt) |
Do something on all emitted particles. | |
![]() | |
Object () | |
Construct an object. | |
Object (bool threadSafeRefUnref) | |
Object (const Object &, const CopyOp ©op=CopyOp::SHALLOW_COPY) | |
Copy constructor, optional CopyOp object can be used to control shallow vs deep copying of dynamic data. | |
virtual Object * | cloneType () const =0 |
Clone the type of an object, with Object* return type. | |
virtual Object * | clone (const CopyOp &) const =0 |
Clone an object, with Object* return type. | |
virtual void | setThreadSafeRefUnref (bool threadSafe) |
Set whether to use a mutex to ensure ref() and unref() are thread safe. | |
virtual void | setName (const std::string &name) |
Set the name of object using C++ style string. | |
void | setName (const char *name) |
Set the name of object using a C style string. | |
const std::string & | getName () const |
Get the name of object. | |
void | setDataVariance (DataVariance dv) |
Set the data variance of this object. | |
DataVariance | getDataVariance () const |
Get the data variance of this object. | |
virtual void | computeDataVariance () |
Compute the DataVariance based on an assessment of callback etc. | |
void | setUserDataContainer (osg::UserDataContainer *udc) |
set the UserDataContainer object. | |
osg::UserDataContainer * | getUserDataContainer () |
get the UserDataContainer attached to this object. | |
const osg::UserDataContainer * | getUserDataContainer () const |
get the const UserDataContainer attached to this object. | |
osg::UserDataContainer * | getOrCreateUserDataContainer () |
Convinience method that returns the UserDataContainer, and if one doesn't already exist creates and assigns a DefaultUserDataContainer to the Object and then return this new UserDataContainer. | |
virtual void | setUserData (Referenced *obj) |
Set user data, data must be subclassed from Referenced to allow automatic memory handling. | |
virtual Referenced * | getUserData () |
Get user data. | |
virtual const Referenced * | getUserData () const |
Get const user data. | |
template<typename T > | |
bool | getUserValue (const std::string &name, T &value) const |
Convinience method that casts the named UserObject to osg::TemplateValueObject<T> and gets the value. | |
template<typename T > | |
void | setUserValue (const std::string &name, const T &value) |
Convinience method that creates the osg::TemplateValueObject<T> to store the specified value and adds it as a named UserObject. | |
virtual void | resizeGLObjectBuffers (unsigned int) |
Resize any per context GLObject buffers to specified size. | |
virtual void | releaseGLObjects (osg::State *=0) const |
If State is non-zero, this function releases any associated OpenGL objects for the specified graphics context. | |
![]() | |
Referenced () | |
Referenced (bool threadSafeRefUnref) | |
Referenced (const Referenced &) | |
Referenced & | operator= (const Referenced &) |
bool | getThreadSafeRefUnref () const |
Get whether a mutex is used to ensure ref() and unref() are thread safe. | |
OpenThreads::Mutex * | getRefMutex () const |
Get the mutex used to ensure thread safety of ref()/unref(). | |
int | ref () const |
Increment the reference count by one, indicating that this object has another pointer which is referencing it. | |
int | unref () const |
Decrement the reference count by one, indicating that a pointer to this object is referencing it. | |
int | unref_nodelete () const |
Decrement the reference count by one, indicating that a pointer to this object is referencing it. | |
int | referenceCount () const |
Return the number of pointers currently referencing this object. | |
ObserverSet * | getObserverSet () const |
Get the ObserverSet if one is attached, otherwise return NULL. | |
ObserverSet * | getOrCreateObserverSet () const |
Get the ObserverSet if one is attached, otherwise create an ObserverSet, attach it, then return this newly created ObserverSet. | |
void | addObserver (Observer *observer) const |
Add a Observer that is observing this object, notify the Observer when this object gets deleted. | |
void | removeObserver (Observer *observer) const |
Remove Observer that is observing this object. |
Protected Member Functions | |
virtual | ~DomainOperator () |
DomainOperator & | operator= (const DomainOperator &) |
virtual void | handlePoint (const Domain &domain, Particle *P, double dt) |
virtual void | handleLineSegment (const Domain &domain, Particle *P, double dt) |
virtual void | handleTriangle (const Domain &domain, Particle *P, double dt) |
virtual void | handleRectangle (const Domain &domain, Particle *P, double dt) |
virtual void | handlePlane (const Domain &domain, Particle *P, double dt) |
virtual void | handleSphere (const Domain &domain, Particle *P, double dt) |
virtual void | handleBox (const Domain &domain, Particle *P, double dt) |
virtual void | handleDisk (const Domain &domain, Particle *P, double dt) |
void | computeNewBasis (const osg::Vec3 &, const osg::Vec3 &, osg::Vec3 &, osg::Vec3 &) |
void | ignore (const std::string &func) |
![]() | |
virtual | ~Operator () |
Operator & | operator= (const Operator &) |
![]() | |
virtual | ~Object () |
Object destructor. | |
![]() | |
virtual | ~Referenced () |
void | signalObserversAndDelete (bool signalDelete, bool doDelete) const |
void | deleteUsingDeleteHandler () const |
Protected Attributes | |
std::vector< Domain > | _domains |
std::vector< Domain > | _backupDomains |
Additional Inherited Members | |
![]() | |
enum | DataVariance { DYNAMIC, STATIC, UNSPECIFIED } |
![]() | |
static OpenThreads::Mutex * | getGlobalReferencedMutex () |
Get the optional global Referenced mutex, this can be shared between all osg::Referenced. | |
static void | setThreadSafeReferenceCounting (bool enableThreadSafeReferenceCounting) |
Set whether reference counting should use a mutex for thread safe reference counting. | |
static bool | getThreadSafeReferenceCounting () |
Get whether reference counting is active. | |
static void | setDeleteHandler (DeleteHandler *handler) |
Set a DeleteHandler to which deletion of all referenced counted objects will be delegated. | |
static DeleteHandler * | getDeleteHandler () |
Get a DeleteHandler. |
A domain operator which accepts different domain shapes as the parameter.
It can be derived to implement operators that require particles interacting with domains. Refer to David McAllister's Particle System API (http://www.particlesystems.org)
|
inline |
|
inline |
|
inlineprotectedvirtual |
|
inline |
Add a box domain.
References _domains, osgParticle::DomainOperator::Domain::BOX_DOMAIN, osgParticle::DomainOperator::Domain::v1, and osgParticle::DomainOperator::Domain::v2.
|
inline |
Add a disk domain.
References _domains, osgParticle::DomainOperator::Domain::DISK_DOMAIN, osgParticle::DomainOperator::Domain::plane, osgParticle::DomainOperator::Domain::r1, osgParticle::DomainOperator::Domain::r2, osg::Plane::set(), osgParticle::DomainOperator::Domain::v1, and osgParticle::DomainOperator::Domain::v2.
|
inline |
Add a domain object directly, used by the .osg wrappers and serializers.
|
inline |
Add a line segment domain.
References _domains, osgParticle::DomainOperator::Domain::LINE_DOMAIN, osgParticle::DomainOperator::Domain::r1, osgParticle::DomainOperator::Domain::v1, and osgParticle::DomainOperator::Domain::v2.
|
inline |
Add a plane domain.
References _domains, osgParticle::DomainOperator::Domain::plane, osgParticle::DomainOperator::Domain::PLANE_DOMAIN, and osg::Plane::set().
|
inline |
Add a point domain.
References _domains, osgParticle::DomainOperator::Domain::POINT_DOMAIN, and osgParticle::DomainOperator::Domain::v1.
|
inline |
Add a rectangle domain.
References _domains, computeNewBasis(), osgParticle::DomainOperator::Domain::plane, osgParticle::DomainOperator::Domain::RECT_DOMAIN, osgParticle::DomainOperator::Domain::s1, osgParticle::DomainOperator::Domain::s2, osg::Plane::set(), osgParticle::DomainOperator::Domain::v1, osgParticle::DomainOperator::Domain::v2, and osgParticle::DomainOperator::Domain::v3.
|
inline |
Add a sphere domain.
References _domains, osgParticle::DomainOperator::Domain::r1, osgParticle::DomainOperator::Domain::SPHERE_DOMAIN, and osgParticle::DomainOperator::Domain::v1.
|
inline |
Add a triangle domain.
References _domains, computeNewBasis(), osgParticle::DomainOperator::Domain::plane, osgParticle::DomainOperator::Domain::s1, osgParticle::DomainOperator::Domain::s2, osg::Plane::set(), osgParticle::DomainOperator::Domain::TRI_DOMAIN, osgParticle::DomainOperator::Domain::v1, osgParticle::DomainOperator::Domain::v2, and osgParticle::DomainOperator::Domain::v3.
|
virtual |
Perform some initializations. Do not call this method manually.
Reimplemented from osgParticle::Operator.
Reimplemented in osgParticle::SinkOperator.
|
inlineprotected |
References osg::Vec3f::set(), osg::Vec3f::x(), osg::Vec3f::y(), and osg::Vec3f::z().
Referenced by addRectangleDomain(), and addTriangleDomain().
|
virtual |
Perform some post-operations. Do not call this method manually.
Reimplemented from osgParticle::Operator.
|
inline |
Get a domain object directly, used by the .osg wrappers and serializers.
|
inline |
Get number of domains.
|
inlineprotectedvirtual |
Reimplemented in osgParticle::SinkOperator.
|
inlineprotectedvirtual |
Reimplemented in osgParticle::SinkOperator, and osgParticle::BounceOperator.
|
inlineprotectedvirtual |
Reimplemented in osgParticle::SinkOperator.
|
inlineprotectedvirtual |
Reimplemented in osgParticle::SinkOperator, and osgParticle::BounceOperator.
|
inlineprotectedvirtual |
Reimplemented in osgParticle::SinkOperator.
|
inlineprotectedvirtual |
Reimplemented in osgParticle::SinkOperator, and osgParticle::BounceOperator.
|
inlineprotectedvirtual |
Reimplemented in osgParticle::SinkOperator, and osgParticle::BounceOperator.
|
inlineprotectedvirtual |
Reimplemented in osgParticle::SinkOperator, and osgParticle::BounceOperator.
|
inlineprotected |
References osgParticle::Operator::className(), and OSG_NOTICE.
osgParticle::DomainOperator::META_Object | ( | osgParticle | , |
DomainOperator | |||
) |
|
virtual |
Apply the acceleration to a particle. Do not call this method manually.
Implements osgParticle::Operator.
|
inlineprotected |
|
inline |
Remove all existing domains.
|
inline |
Remove a domain at specific index.
|
protected |
|
protected |
![]() | Generated at Tue Sep 4 2012 06:14:41 for the OpenSceneGraph by doxygen 1.8.1.2. |