Panda3D

Loading...
Searching...
No Matches
Public Member Functions | List of all members
OrientedParticle Class Reference

Describes a particle that has angular characteristics (velocity, orientation). More...

`#include "orientedParticle.h"`

Inheritance diagram for OrientedParticle:

## Public Member Functions
| OrientedParticle (const OrientedParticle &copy)
| copy constructor
| OrientedParticle (int lifespan=0, bool alive=false)
| simple constructor
virtual | ~OrientedParticle ()
| simple destructor
virtual void | die ()
| particle death routine
virtual void | init ()
| particle init routine
virtual PhysicsObject * | make_copy () const
| simple destructor
virtual void | output (std::ostream &out) const
| Write a string representation of this instance to <out>.
void | set_orientation ()
void | set_velocity ()
virtual void | update ()
| particle update routine.
virtual void | write (std::ostream &out, int indent=0) const
| Write a string representation of this instance to <out>.
Public Member Functions inherited from BaseParticle
PN_stdfloat | get_age () const
bool | get_alive () const
int | get_index () const
PN_stdfloat | get_lifespan () const
PN_stdfloat | get_parameterized_age () const
PN_stdfloat | get_parameterized_vel () const
virtual PN_stdfloat | get_theta () const
| for spriteParticleRenderer
void | set_age (PN_stdfloat age)
void | set_alive (bool alive)
void | set_index (int index)
void | set_lifespan (PN_stdfloat lifespan)
Public Member Functions inherited from PhysicsObject
| PhysicsObject ()
| Default Constructor.
| PhysicsObject (const PhysicsObject &copy)
| copy constructor
virtual | ~PhysicsObject ()
| Destructor.
virtual void | add_impact (const LPoint3 &offset_from_center_of_mass, const LVector3 &impulse)
| Adds an impulse and/or torque (i.e.
void | add_impulse (const LVector3 &impulse)
| Adds an impulse force (i.e.
virtual void | add_local_impact (const LPoint3 &offset_from_center_of_mass, const LVector3 &impulse)
| Adds an impulse and/or torque (i.e.
void | add_local_impulse (const LVector3 &impulse)
| Adds an impulse force (i.e.
void | add_local_torque (const LRotation &torque)
| Adds an torque force (i.e.
void | add_torque (const LRotation &torque)
| Adds an torque force (i.e.
virtual TypeHandle | force_init_type ()
bool | get_active () const
LVector3 | get_implicit_velocity () const
virtual LMatrix4 | get_inertial_tensor () const
| returns a transform matrix that represents the object's willingness to be forced.
LPoint3 | get_last_position () const
virtual LMatrix4 | get_lcs () const
| returns a transform matrix to this object's local coordinate system.
PN_stdfloat | get_mass () const
const std::string & | get_name ()
LOrientation | get_orientation () const
bool | get_oriented () const
LPoint3 | get_position () const
LRotation | get_rotation () const
PN_stdfloat | get_terminal_velocity () const
virtual TypeHandle | get_type () const
LVector3 | get_velocity () const
const PhysicsObject & | operator= (const PhysicsObject &other)
void | reset_orientation (const LOrientation &orientation)
| set the orientation while clearing the rotation velocity.
void | reset_position (const LPoint3 &pos)
| use this to place an object in a completely new position, that has nothing to do with its last position.
void | set_active (bool flag)
void | set_last_position (const LPoint3 &pos)
void | set_mass (PN_stdfloat)
void | set_name (const std::string &name)
void | set_orientation (const LOrientation &orientation)
void | set_oriented (bool flag)
void | set_position (const LPoint3 &pos)
void | set_position (PN_stdfloat x, PN_stdfloat y, PN_stdfloat z)
void | set_rotation (const LRotation &rotation)
void | set_terminal_velocity (PN_stdfloat tv)
void | set_velocity (const LVector3 &vel)
void | set_velocity (PN_stdfloat x, PN_stdfloat y, PN_stdfloat z)
Public Member Functions inherited from TypedReferenceCount
| TypedReferenceCount (const TypedReferenceCount &copy)
void | operator= (const TypedReferenceCount &copy)
Public Member Functions inherited from TypedObject
| TypedObject (const TypedObject &copy)=default
TypedObject * | as_typed_object ()
| Returns the object, upcast (if necessary) to a TypedObject pointer.
const TypedObject * | as_typed_object () const
| Returns the object, upcast (if necessary) to a TypedObject pointer.
int | get_best_parent_from_Set (const std::set< int > &) const
int | get_type_index () const
| Returns the internal index number associated with this object's TypeHandle, a unique number for each different type.
bool | is_exact_type (TypeHandle handle) const
| Returns true if the current object is the indicated type exactly.
bool | is_of_type (TypeHandle handle) const
| Returns true if the current object is or derives from the indicated type.
TypedObject & | operator= (const TypedObject &copy)=default
Public Member Functions inherited from MemoryBase
void | operator delete (void *, void *)
void | operator delete (void *ptr)
void | operator delete[] (void *, void *)
void | operator delete[] (void *ptr)
void * | operator new (size_t size)
void * | operator new (size_t size, void *ptr)
void * | operator new[] (size_t size)
void * | operator new[] (size_t size, void *ptr)
Public Member Functions inherited from ReferenceCount
int | get_ref_count () const
WeakReferenceList * | get_weak_list () const
| Returns the WeakReferenceList associated with this ReferenceCount object.
bool | has_weak_list () const
| Returns true if this particular ReferenceCount object has a WeakReferenceList created, false otherwise.
void | local_object ()
| This function should be called, once, immediately after creating a new instance of some ReferenceCount-derived object on the stack.
void | ref () const
| Explicitly increments the reference count.
bool | ref_if_nonzero () const
| Atomically increases the reference count of this object if it is not zero.
bool | test_ref_count_integrity () const
| Does some easy checks to make sure that the reference count isn't completely bogus.
bool | test_ref_count_nonzero () const
| Does some easy checks to make sure that the reference count isn't zero, or completely bogus.
virtual bool | unref () const
| Explicitly decrements the reference count.
bool | unref_if_one () const
| Atomically decreases the reference count of this object if it is one.
WeakReferenceList * | weak_ref ()
| Adds the indicated PointerToVoid as a weak reference to this object.
void | weak_unref ()
| Removes the indicated PointerToVoid as a weak reference to this object.

## Additional Inherited Members
Public Types inherited from PhysicsObject
typedef pvector< PT(PhysicsObject)> | Vector
Static Public Member Functions inherited from PhysicsObject
static TypeHandle | get_class_type ()
static void | init_type ()
Static Public Member Functions inherited from TypedReferenceCount
static TypeHandle | get_class_type ()
static void | init_type ()
Static Public Member Functions inherited from TypedObject
static TypeHandle | get_class_type ()
static void | init_type ()
| This function is declared non-inline to work around a compiler bug in g++ 2.96.
Static Public Member Functions inherited from ReferenceCount
static TypeHandle | get_class_type ()
static void | init_type ()
Public Attributes inherited from PhysicsObject
| get_active
| Process Flag Query.
| get_implicit_velocity
| Velocity Query over the last dt.
| get_last_position
| Get the position of the physics object at the start of the most recent do_physics.
| get_mass
| Get the mass in slugs (or kilograms).
| get_orientation
| get current orientation.
| get_oriented
| See set_oriented().
| get_position
| Position Query.
| get_rotation
| get rotation per second.
| get_terminal_velocity
| tv query
| get_velocity
| Velocity Query per second.
| set_active
| Process Flag assignment.
| set_last_position
| Last position assignment.
| set_mass
| Set the mass in slugs (or kilograms).
| set_orientation
| set_oriented
| Set flag to determine whether this object should do any rotation or orientation calculations.
| set_position
| Vector position assignment.
| set_rotation
| set rotation as a quaternion delta per second.
| set_terminal_velocity
| tv assignment
| set_velocity
| Vector velocity assignment.
Public Attributes inherited from TypedObject
| get_type
Public Attributes inherited from ReferenceCount
| get_ref_count
| Returns the current reference count.
Static Public Attributes inherited from PhysicsObject
static ConfigVariableDouble | _default_terminal_velocity

## Detailed Description

Describes a particle that has angular characteristics (velocity, orientation).

Definition at line 23 of file orientedParticle.h.

## Constructor & Destructor Documentation

## ◆ OrientedParticle() [1/2]

OrientedParticle::OrientedParticle | ( | int | lifespan = 0,
|  | bool | alive = false )

simple constructor

Definition at line 19 of file orientedParticle.cxx.

References PhysicsObject::set_oriented.

Referenced by OrientedParticle(), and make_copy().

## ◆ OrientedParticle() [2/2]

OrientedParticle::OrientedParticle | ( | const OrientedParticle & | copy | ) |

copy constructor

Definition at line 28 of file orientedParticle.cxx.

References OrientedParticle().

## ◆ ~OrientedParticle()

OrientedParticle::~OrientedParticle | ( |  | ) |
| virtual

simple destructor

Definition at line 36 of file orientedParticle.cxx.

## Member Function Documentation

## ◆ die()

void OrientedParticle::die | ( |  | ) |
| virtual

particle death routine

Implements BaseParticle.

Definition at line 58 of file orientedParticle.cxx.

## ◆ init()

void OrientedParticle::init | ( |  | ) |
| virtual

particle init routine

Implements BaseParticle.

Definition at line 51 of file orientedParticle.cxx.

## ◆ make_copy()

PhysicsObject * OrientedParticle::make_copy | ( |  | ) | const
| virtual

simple destructor

Implements BaseParticle.

Definition at line 43 of file orientedParticle.cxx.

References OrientedParticle(), and PhysicsObject::PhysicsObject().

## ◆ output()

void OrientedParticle::output | ( | std::ostream & | out | ) | const
| virtual

Write a string representation of this instance to <out>.

Reimplemented from BaseParticle.

Definition at line 73 of file orientedParticle.cxx.

## ◆ set_orientation()

void OrientedParticle::set_orientation | ( |  | ) |
| inline

Definition at line 26 of file orientedParticle.I.

## ◆ set_velocity()

void OrientedParticle::set_velocity | ( |  | ) |
| inline

Definition at line 18 of file orientedParticle.I.

## ◆ update()

void OrientedParticle::update | ( |  | ) |
| virtual

particle update routine.

This NEEDS to be filled in with quaternion slerp stuff, or oriented particles will not rotate.

Implements BaseParticle.

Definition at line 66 of file orientedParticle.cxx.

## ◆ write()

void OrientedParticle::write | ( | std::ostream & | out,
|  | int | indent = 0 ) const
| virtual

Write a string representation of this instance to <out>.

Reimplemented from BaseParticle.

Definition at line 83 of file orientedParticle.cxx.

References indent(), and BaseParticle::write().

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

- panda/src/particlesystem/orientedParticle.h
- panda/src/particlesystem/orientedParticle.cxx
- panda/src/particlesystem/orientedParticle.I